SeqAn3  3.0.3
The Modern C++ library for sequence analysis.
gap_decorator.hpp
Go to the documentation of this file.
1 // -----------------------------------------------------------------------------------------------------
2 // Copyright (c) 2006-2020, Knut Reinert & Freie Universität Berlin
3 // Copyright (c) 2016-2020, Knut Reinert & MPI für molekulare Genetik
4 // This file may be used, modified and/or redistributed under the terms of the 3-clause BSD-License
5 // shipped with this file and also available at: https://github.com/seqan/seqan3/blob/master/LICENSE.md
6 // -----------------------------------------------------------------------------------------------------
7 
14 #pragma once
15 
16 #include <seqan3/std/algorithm>
17 #include <limits>
18 #include <seqan3/std/ranges>
19 #include <set>
20 #include <tuple>
21 #include <type_traits>
22 
31 
32 namespace seqan3
33 {
34 
80 template <std::ranges::viewable_range inner_type>
82  requires std::ranges::random_access_range<inner_type> && std::ranges::sized_range<inner_type> &&
83  (std::is_const_v<std::remove_reference_t<inner_type>> || std::ranges::view<inner_type>)
86 {
87 private:
88  // Declaration of class's iterator types; for the definition see below.
90 
95  using const_iterator = iterator;
96 
98  using ungapped_view_type = decltype(views::type_reduce(std::declval<inner_type &&>()));
99 
100 public:
109 
115 
122 
127  using size_type = std::ranges::range_size_t<inner_type>;
128 
133  using difference_type = std::ranges::range_difference_t<inner_type>;
135 
140  using unaligned_sequence_type = inner_type;
141 
144 
155  gap_decorator() = default;
156  gap_decorator(gap_decorator const &) = default;
157  gap_decorator & operator=(gap_decorator const &) = default;
158  gap_decorator(gap_decorator && rhs) = default;
159  gap_decorator & operator=(gap_decorator && rhs) = default;
160  ~gap_decorator() = default;
161 
166  template <typename other_range_t>
168  requires (!std::same_as<other_range_t, gap_decorator>) &&
169  std::same_as<std::remove_cvref_t<other_range_t>, std::remove_cvref_t<inner_type>> &&
170  std::ranges::viewable_range<other_range_t> // at end, otherwise it competes with the move ctor
172  gap_decorator(other_range_t && range) : ungapped_view{views::type_reduce(std::forward<inner_type>(range))}
173  {} // TODO (@smehringer) only works for copyable views. Has to be changed once views are not required to be copyable anymore.
174  // !\}
175 
189  size_type size() const
190  {
191  if (anchors.size())
192  return anchors.rbegin()->second + ungapped_view.size();
193 
194  return ungapped_view.size();
195  }
196 
213  {
214  if (!count) // [[unlikely]]
215  return it;
216 
217  size_type const pos = it - begin();
218  assert(pos <= size());
219 
220  set_iterator_type it_set = anchors.upper_bound(anchor_gap_t{pos, bound_dummy});
221 
222  if (it_set == anchors.begin()) // will also catch if anchors is empty since begin() == end()
223  {
224  anchors.emplace_hint(anchors.begin(), anchor_gap_t{pos, count});
225  }
226  else // there are gaps before pos
227  {
228  --it_set;
229  auto gap_len{it_set->second};
230  if (it_set != anchors.begin())
231  gap_len -= (*(std::prev(it_set))).second;
232 
233  if (it_set->first + gap_len >= pos) // extend existing gap
234  {
235  anchor_gap_t gap{it_set->first, it_set->second + count};
236  it_set = anchors.erase(it_set);
237  anchors.insert(it_set, gap);
238  }
239  else // insert new gap
240  {
241  anchor_gap_t gap{pos, it_set->second + count};
242  ++it_set;
243  anchors.insert(it_set, gap);
244  }
245  }
246 
247  // post-processing: reverse update of succeeding gaps
248  rupdate(pos, count);
249  return iterator{*this, pos};
250  }
251 
266  {
267  // check if [it, it+gap_len[ covers [first, last[
268  if ((*it) != gap{}) // [[unlikely]]
269  throw gap_erase_failure("The range to be erased does not correspond to a consecutive gap.");
270 
271  return erase_gap(it, std::next(it));
272  }
273 
290  {
291  size_type const pos1 = first - begin();
292  size_type const pos2 = last - begin();
293  set_iterator_type it = anchors.upper_bound(anchor_gap_t{pos1, bound_dummy}); // first element greater than pos1
294 
295  if (it == anchors.begin())
296  throw gap_erase_failure{"There is no gap to erase in range [" + std::to_string(pos1) + "," +
297  std::to_string(pos2) + "]."};
298 
299  --it;
300  size_type const gap_len = gap_length(it);
301 
302  // check if [it, it+gap_len[ covers [first, last[
303  if ((it->first + gap_len) < pos2) // [[unlikely]]
304  {
305  throw gap_erase_failure{"The range to be erased does not correspond to a consecutive gap."};
306  }
307  // case 1: complete gap is deleted
308  else if (gap_len == pos2 - pos1)
309  {
310  it = anchors.erase(it);
311  }
312  // case 2: gap to be deleted in tail or larger than 1 (equiv. to shift tail left, i.e. pos remains unchanged)
313  else
314  {
315  anchor_gap_t gap{it->first, it->second - pos2 + pos1};
316  it = anchors.erase(it);
317  it = anchors.insert(it, gap); // amortized constant because of hint
318  ++it; // update node after the current
319  }
320 
321  // post-processing: forward update of succeeding gaps
322  update(it, pos2 - pos1);
323 
324  return iterator{*this, pos1};
325  }
326 
334  template <typename unaligned_sequence_t> // generic template to use forwarding reference
336  requires std::assignable_from<gap_decorator &, unaligned_sequence_t>
338  friend void assign_unaligned(gap_decorator & dec, unaligned_sequence_t && unaligned)
339  {
340  dec = unaligned;
341  }
343 
362  const_iterator begin() const noexcept
363  {
364  return iterator{*this};
365  }
366 
368  const_iterator cbegin() const noexcept
369  {
370  return const_iterator{*this};
371  }
372 
388  const_iterator end() const noexcept
389  {
390  return iterator{*this, size()};
391  }
392 
394  const_iterator cend() const noexcept
395  {
396  return const_iterator{*this, size()};
397  }
399 
418  {
419  if (i >= size()) // [[unlikely]]
420  throw std::out_of_range{"Trying to access element behind the last in gap_decorator."};
421  return (*this)[i];
422  }
423 
425  const_reference at(size_type const i) const
426  {
427  if (i >= size()) // [[unlikely]]
428  throw std::out_of_range{"Trying to access element behind the last in gap_decorator."};
429  return (*this)[i];
430  }
431 
445  {
446  return *iterator{*this, i};
447  }
449 
473  friend bool operator==(gap_decorator const & lhs, gap_decorator const & rhs)
474  {
475  if (lhs.size() == rhs.size() &&
476  lhs.anchors == rhs.anchors &&
477  std::ranges::equal(lhs.ungapped_view, rhs.ungapped_view))
478  {
479  return true;
480  }
481 
482  return false;
483  }
484 
489  friend bool operator!=(gap_decorator const & lhs, gap_decorator const & rhs)
490  {
491  return !(lhs == rhs);
492  }
493 
498  friend bool operator<(gap_decorator const & lhs, gap_decorator const & rhs)
499  {
500  auto lit = lhs.begin();
501  auto rit = rhs.begin();
502 
503  while (lit != lhs.end() && rit != rhs.end() && *lit == *rit)
504  ++lit, ++rit;
505 
506  if (rit == rhs.end())
507  return false; // lhs == rhs, or rhs prefix of lhs
508  else if (lit == lhs.end())
509  return true; // lhs prefix of rhs
510 
511  return *lit < *rit;
512  }
513 
518  friend bool operator<=(gap_decorator const & lhs, gap_decorator const & rhs)
519  {
520  auto lit = lhs.begin();
521  auto rit = rhs.begin();
522 
523  while (lit != lhs.end() && rit != rhs.end() && *lit == *rit)
524  ++lit, ++rit;
525 
526  if (lit == lhs.end())
527  return true; // lhs == rhs, or lhs prefix of rhs
528  else if (rit == rhs.end())
529  return false; // rhs prefix of lhs
530 
531  return *lit < *rit;
532  }
533 
538  friend bool operator>(gap_decorator const & lhs, gap_decorator const & rhs)
539  {
540  return !(lhs <= rhs);
541  }
542 
547  friend bool operator>=(gap_decorator const & lhs, gap_decorator const & rhs)
548  {
549  return !(lhs < rhs);
550  }
552 
553 private:
555  using anchor_gap_t = typename std::pair<size_t, size_t>;
556 
558  using anchor_set_type = std::set<anchor_gap_t>;
559 
561  using set_iterator_type = typename anchor_set_type::iterator;
562 
564  constexpr static size_t bound_dummy{std::numeric_limits<size_t>::max()};
565 
578  size_type gap_length(set_iterator_type it) const
579  {
580  return (it == anchors.begin()) ? it->second : it->second - (*std::prev(it)).second;
581  }
582 
595  void rupdate(size_type const pos, size_type const offset)
596  {
597  for (auto it = std::prev(anchors.end(), 1); it->first > pos;)
598  {
599  anchors.emplace_hint(it, anchor_gap_t{it->first + offset, it->second + offset});
600  anchors.erase(*it--);
601  }
602  }
603 
616  void update(set_iterator_type it, size_type const offset)
617  {
618  while (it != anchors.end())
619  {
620  anchor_gap_t gap{it->first - offset, it->second - offset};
621  it = anchors.erase(it);
622  it = anchors.insert(it, gap);
623  ++it;
624  }
625  }
626 
628  ungapped_view_type ungapped_view{};
629 
631  anchor_set_type anchors{};
632 };
633 
641 template <std::ranges::viewable_range urng_t>
643  requires (!std::ranges::view<std::remove_reference_t<urng_t>>)
645 gap_decorator(urng_t && range) -> gap_decorator<std::remove_reference_t<urng_t> const &>;
646 
651 template <std::ranges::view urng_t>
652 gap_decorator(urng_t range) -> gap_decorator<urng_t>;
654 
671 template <std::ranges::viewable_range inner_type>
673  requires std::ranges::random_access_range<inner_type> && std::ranges::sized_range<inner_type> &&
674  (std::is_const_v<std::remove_reference_t<inner_type>> || std::ranges::view<inner_type>)
677 {
678 protected:
682  typename gap_decorator::size_type pos{0u};
684  int64_t ungapped_view_pos{0}; // must be signed because we need this value to be -1 in case of leading gaps.
687  typename gap_decorator::size_type left_gap_end{0};
690  typename gap_decorator::set_iterator_type anchor_set_it{};
692  bool is_at_gap{true};
693 
695  void jump(typename gap_decorator::size_type const new_pos)
696  {
697  assert(new_pos <= host->size());
698  pos = new_pos;
699 
700  anchor_set_it = host->anchors.upper_bound(anchor_gap_t{pos, host->bound_dummy});
701  ungapped_view_pos = pos;
702 
703  if (anchor_set_it != host->anchors.begin())
704  {
705  typename gap_decorator::set_iterator_type prev{std::prev(anchor_set_it)};
706  size_type gap_len{prev->second};
707 
708  if (prev != host->anchors.begin())
709  gap_len -= std::prev(prev)->second;
710 
711  ungapped_view_pos -= prev->second;
712  left_gap_end = prev->first + gap_len;
713  }
714 
715  if (ungapped_view_pos != static_cast<int64_t>(host->ungapped_view.size()) &&
716  pos >= left_gap_end && (anchor_set_it == host->anchors.end() || pos < anchor_set_it->first))
717  is_at_gap = false;
718  else
719  is_at_gap = true;
720  }
721 
722 public:
733  using pointer = value_type *;
737 
747 
749  explicit gap_decorator_iterator(gap_decorator const & host_) :
750  host(&host_), anchor_set_it{host_.anchors.begin()}
751  {
752  if (host_.anchors.size() && (*host_.anchors.begin()).first == 0) // there are gaps at the very front
753  {
754  --ungapped_view_pos; // set ungapped_view_pos to -1 so operator++ works without an extra if-branch.
755  left_gap_end = anchor_set_it->second;
756  ++anchor_set_it;
757  }
758  else
759  {
760  is_at_gap = false;
761  }
762  }
763 
765  gap_decorator_iterator(gap_decorator const & host_, typename gap_decorator::size_type const pos_) : host(&host_)
766  {
767  jump(pos_); // random access to pos
768  }
770 
776  {
777  assert(host); // host is set
778  ++pos;
779 
780  if (pos < left_gap_end) // we stay within the preceding gap stretch
781  return *this;
782 
783  if (anchor_set_it == host->anchors.end() || pos < anchor_set_it->first)
784  { // proceed within the view since we are right of the previous gap but didn't arrive at the right gap yet
785  ++ungapped_view_pos;
786  if (ungapped_view_pos != static_cast<int64_t>(host->ungapped_view.size()))
787  is_at_gap = false;
788  }
789  else
790  { // we arrived at the right gap and have to update the variables. ungapped_view_pos remains unchanged.
791  left_gap_end = anchor_set_it->first + anchor_set_it->second -
792  ((anchor_set_it != host->anchors.begin()) ? (std::prev(anchor_set_it))->second : 0);
793  ++anchor_set_it;
794  is_at_gap = true;
795 
796  if (left_gap_end == host->size()) // very last gap
797  ++ungapped_view_pos;
798  }
799 
800  return *this;
801  }
802 
805  {
806  gap_decorator_iterator cpy{*this};
807  ++(*this);
808  return cpy;
809  }
810 
813  {
814  this->jump(this->pos + skip);
815  return *this;
816  }
817 
820  {
821  return gap_decorator_iterator{*(this->host), this->pos + skip};
822  }
823 
826  {
827  return it + skip;
828  }
829 
832  {
833  assert(host); // host is set
834  --pos;
835 
836  if (pos < left_gap_end)
837  { // there was no gap before but we arrive at the left gap and have to update the variables.
838  (anchor_set_it != host->anchors.begin()) ? --anchor_set_it : anchor_set_it;
839 
840  if (anchor_set_it != host->anchors.begin())
841  {
842  auto prev = std::prev(anchor_set_it);
843  left_gap_end = prev->first + prev->second -
844  ((prev != host->anchors.begin()) ? std::prev(prev)->second : 0);
845  }
846  else // [[unlikely]]
847  {
848  left_gap_end = 0;
849  }
850  is_at_gap = true;
851  }
852  else if (anchor_set_it == host->anchors.end() || pos < anchor_set_it->first)
853  { // we are neither at the left nor right gap
854  --ungapped_view_pos;
855  is_at_gap = false;
856  }
857  // else -> no op (we are still within the right gap stretch)
858 
859  return *this;
860  }
861 
864  {
865  gap_decorator_iterator cpy{*this};
866  --(*this);
867  return cpy;
868  }
869 
872  {
873  this->jump(this->pos - skip);
874  return *this;
875  }
876 
879  {
880  return gap_decorator_iterator{*(this->host), this->pos - skip};
881  }
882 
885  {
886  return it - skip;
887  }
888 
891  {
892  return static_cast<difference_type>(this->pos - lhs.pos);
893  }
895 
901  {
902  return (is_at_gap) ? reference{gap{}} : reference{host->ungapped_view[ungapped_view_pos]};
903  }
904 
907  {
908  return *(*this + n);
909  }
911 
918  friend bool operator==(gap_decorator_iterator const & lhs, gap_decorator_iterator const & rhs) noexcept
919  {
920  return lhs.pos == rhs.pos;
921  }
922 
924  friend bool operator!=(gap_decorator_iterator const & lhs, gap_decorator_iterator const & rhs) noexcept
925  {
926  return lhs.pos != rhs.pos;
927  }
928 
930  friend bool operator<(gap_decorator_iterator const & lhs, gap_decorator_iterator const & rhs) noexcept
931  {
932  return lhs.pos < rhs.pos;
933  }
934 
936  friend bool operator>(gap_decorator_iterator const & lhs, gap_decorator_iterator const & rhs) noexcept
937  {
938  return lhs.pos > rhs.pos;
939  }
940 
942  friend bool operator<=(gap_decorator_iterator const & lhs, gap_decorator_iterator const & rhs) noexcept
943  {
944  return lhs.pos <= rhs.pos;
945  }
946 
948  friend bool operator>=(gap_decorator_iterator const & lhs, gap_decorator_iterator const & rhs) noexcept
949  {
950  return lhs.pos >= rhs.pos;
951  }
953 };
954 
955 } // namespace seqan
Adaptations of algorithms from the Ranges TS.
Includes customized exception types for the alignment module .
Core alphabet concept and free function/type trait wrappers.
T begin(T... args)
A combined alphabet that can hold values of either of its alternatives.
Definition: alphabet_variant.hpp:132
The iterator type over a seqan3::gap_decorator.
Definition: gap_decorator.hpp:677
friend bool operator<=(gap_decorator_iterator const &lhs, gap_decorator_iterator const &rhs) noexcept
Checks whether *this is less than or equal to rhs.
Definition: gap_decorator.hpp:942
reference operator*() const
Dereference operator returns a copy of the element currently pointed at.
Definition: gap_decorator.hpp:900
gap_decorator_iterator & operator--()
Decrements iterator.
Definition: gap_decorator.hpp:831
gap_decorator_iterator & operator=(gap_decorator_iterator const &)=default
Defaulted.
typename gap_decorator::difference_type difference_type
The difference type.
Definition: gap_decorator.hpp:727
gap_decorator_iterator & operator=(gap_decorator_iterator &&)=default
Defaulted.
friend gap_decorator_iterator operator+(difference_type const skip, gap_decorator_iterator const &it)
Returns an iterator copy advanced by skip many positions.
Definition: gap_decorator.hpp:825
gap_decorator_iterator operator--(int)
Returns a decremented iterator copy.
Definition: gap_decorator.hpp:863
gap_decorator_iterator operator+(difference_type const skip) const
Returns an iterator copy advanced by skip many positions.
Definition: gap_decorator.hpp:819
difference_type operator-(gap_decorator_iterator const lhs) const noexcept
Returns the distance between two iterators.
Definition: gap_decorator.hpp:890
gap_decorator_iterator operator++(int)
Returns an incremented iterator copy.
Definition: gap_decorator.hpp:804
gap_decorator_iterator & operator+=(difference_type const skip)
Advances iterator by skip many positions.
Definition: gap_decorator.hpp:812
gap_decorator_iterator & operator++()
Increments iterator.
Definition: gap_decorator.hpp:775
typename gap_decorator::const_reference reference
The reference type.
Definition: gap_decorator.hpp:731
gap_decorator_iterator operator-(difference_type const skip) const
Returns an iterator copy advanced by skip many positions.
Definition: gap_decorator.hpp:878
friend bool operator<(gap_decorator_iterator const &lhs, gap_decorator_iterator const &rhs) noexcept
Checks whether *this is less than rhs.
Definition: gap_decorator.hpp:930
gap_decorator_iterator(gap_decorator const &host_)
Construct from seqan3::gap_decorator and initialising to first position.
Definition: gap_decorator.hpp:749
gap_decorator_iterator(gap_decorator_iterator &&)=default
Defaulted.
friend gap_decorator_iterator operator-(difference_type const skip, gap_decorator_iterator const &it)
Returns an iterator copy advanced by skip many positions.
Definition: gap_decorator.hpp:884
friend bool operator!=(gap_decorator_iterator const &lhs, gap_decorator_iterator const &rhs) noexcept
Checks whether *this is not equal to rhs.
Definition: gap_decorator.hpp:924
gap_decorator_iterator(gap_decorator const &host_, typename gap_decorator::size_type const pos_)
Construct from seqan3::gap_decorator and explicit position.
Definition: gap_decorator.hpp:765
friend bool operator>=(gap_decorator_iterator const &lhs, gap_decorator_iterator const &rhs) noexcept
Checks whether *this is greater than or equal to rhs.
Definition: gap_decorator.hpp:948
friend bool operator>(gap_decorator_iterator const &lhs, gap_decorator_iterator const &rhs) noexcept
Checks whether *this is greater than rhs.
Definition: gap_decorator.hpp:936
gap_decorator_iterator(gap_decorator_iterator const &)=default
Defaulted.
gap_decorator_iterator & operator-=(difference_type const skip)
Advances iterator by skip many positions.
Definition: gap_decorator.hpp:871
friend bool operator==(gap_decorator_iterator const &lhs, gap_decorator_iterator const &rhs) noexcept
Checks whether *this is equal to rhs.
Definition: gap_decorator.hpp:918
value_type * pointer
The pointer type.
Definition: gap_decorator.hpp:733
typename gap_decorator::value_type value_type
The value type.
Definition: gap_decorator.hpp:729
void jump(typename gap_decorator::size_type const new_pos)
A helper function that performs the random access into the anchor set, updating all member variables.
Definition: gap_decorator.hpp:695
reference operator[](difference_type const n) const
Return underlying container value currently pointed at.
Definition: gap_decorator.hpp:906
A gap decorator allows the annotation of sequences with gap symbols while leaving the underlying sequ...
Definition: gap_decorator.hpp:86
gap_decorator & operator=(gap_decorator &&rhs)=default
Defaulted.
reference at(size_type const i)
Return the i-th element as a reference.
Definition: gap_decorator.hpp:417
friend bool operator==(gap_decorator const &lhs, gap_decorator const &rhs)
Checks whether lhs is equal to rhs.
Definition: gap_decorator.hpp:473
gap_decorator(gap_decorator &&rhs)=default
Defaulted.
const_reference at(size_type const i) const
Return the i-th element as a reference.
Definition: gap_decorator.hpp:425
std::ranges::range_difference_t< inner_type > difference_type
The difference type of the underlying sequence.
Definition: gap_decorator.hpp:133
const_iterator cend() const noexcept
Returns an iterator pointing behind the last element of the decorator.
Definition: gap_decorator.hpp:394
const_iterator end() const noexcept
Returns an iterator pointing behind the last element of the decorator.
Definition: gap_decorator.hpp:388
inner_type unaligned_sequence_type
The underlying ungapped range type.
Definition: gap_decorator.hpp:140
gap_decorator(other_range_t &&range)
Construct with the ungapped range type.
Definition: gap_decorator.hpp:172
reference operator[](size_type const i) const
Return the i-th element as a reference.
Definition: gap_decorator.hpp:444
friend bool operator!=(gap_decorator const &lhs, gap_decorator const &rhs)
Checks whether lhs is not equal to rhs.
Definition: gap_decorator.hpp:489
iterator erase_gap(const_iterator const it)
Erase one gap symbol at the indicated iterator postion.
Definition: gap_decorator.hpp:265
const_iterator begin() const noexcept
Returns an iterator to the first element of the container.
Definition: gap_decorator.hpp:362
unaligned_sequence_type unaligned_seq_type
Definition: gap_decorator.hpp:143
iterator insert_gap(const_iterator const it, size_type const count=1)
Insert a gap of length count at the aligned sequence iterator position.
Definition: gap_decorator.hpp:212
~gap_decorator()=default
Defaulted.
iterator erase_gap(const_iterator const first, const_iterator const last)
Erase gap symbols at the iterator postions [first, last[.
Definition: gap_decorator.hpp:289
gap_decorator(gap_decorator const &)=default
Defaulted.
friend bool operator<=(gap_decorator const &lhs, gap_decorator const &rhs)
Checks whether lhs is less than or equal to rhs.
Definition: gap_decorator.hpp:518
size_type size() const
Returns the total length of the aligned sequence.
Definition: gap_decorator.hpp:189
reference const_reference
const_reference type equals reference type equals value type because the underlying sequence must not...
Definition: gap_decorator.hpp:121
gap_decorator & operator=(gap_decorator const &)=default
Defaulted.
gapped< std::ranges::range_value_t< inner_type > > value_type
The variant type of the alphabet type and gap symbol type (see seqan3::gapped).
Definition: gap_decorator.hpp:108
friend bool operator>(gap_decorator const &lhs, gap_decorator const &rhs)
Checks whether lhs is greater than rhs.
Definition: gap_decorator.hpp:538
friend bool operator>=(gap_decorator const &lhs, gap_decorator const &rhs)
Checks whether lhs is greater than or equal to rhs.
Definition: gap_decorator.hpp:547
gap_decorator()=default
Default constructor.
friend bool operator<(gap_decorator const &lhs, gap_decorator const &rhs)
Checks whether lhs is less than rhs.
Definition: gap_decorator.hpp:498
std::ranges::range_size_t< inner_type > size_type
The size_type of the underlying sequence.
Definition: gap_decorator.hpp:127
friend void assign_unaligned(gap_decorator &dec, unaligned_sequence_t &&unaligned)
Assigns a new sequence of type seqan3::gap_decorator::unaligned_sequence_type to the decorator.
Definition: gap_decorator.hpp:338
const_iterator cbegin() const noexcept
Returns an iterator to the first element of the container.
Definition: gap_decorator.hpp:368
Thrown in function seqan3::erase_gap, if a position does not contain a gap.
Definition: exception.hpp:24
The alphabet of a gap character '-'.
Definition: gap.hpp:39
Provides seqan3::gap.
Provides seqan3::gapped.
@ offset
Sequence (seqan3::field::seq) relative start position (0-based), unsigned value.
constexpr ptrdiff_t count
Count the occurrences of a type in a pack.
Definition: traits.hpp:168
constexpr size_t size
The size of a type pack.
Definition: traits.hpp:150
constexpr auto type_reduce
A view adaptor that behaves like std::views::all, but type erases certain ranges.
Definition: type_reduce.hpp:158
Provides the seqan3::detail::inherited_iterator_base template.
T max(T... args)
The main SeqAn3 namespace.
Definition: aligned_sequence_concept.hpp:29
SeqAn specific customisations in the standard namespace.
T next(T... args)
#define SEQAN3_DEPRECATED_310
Deprecation message for SeqAn 3.1.0 release.
Definition: platform.hpp:202
T prev(T... args)
Provides the seqan3::detail::random_access_iterator class.
Adaptations of concepts from the standard library.
Adaptations of concepts from the Ranges TS.
T size(T... args)
T to_string(T... args)
Provides seqan3::views::type_reduce.