Views are "lazy range combinators" that offer modified views onto other ranges. More...
Classes | |
class | seqan3::view::deep< underlying_adaptor_t > |
A wrapper type around an existing view adaptor that enables "deep view" behaviour for that view. More... | |
Alphabet related views | |
template<Alphabet alphabet_type> | |
auto const | seqan3::view::char_to |
A view over an alphabet, given a range of characters. More... | |
auto const | seqan3::view::complement |
A view that converts a range of nucleotides to their complement. More... | |
auto constexpr | seqan3::view::kmer_hash |
A view that calls std::hash on each substring of length k in the input range. More... | |
template<typename alphabet_type > | |
auto const | seqan3::view::rank_to |
A view over an alphabet, given a range of ranks. More... | |
auto const | seqan3::view::to_char |
A view that calls seqan3::to_char() on each element in the input range. More... | |
auto const | seqan3::view::to_rank |
A view that calls seqan3::to_rank() on each element in the input range. More... | |
constexpr auto | seqan3::view::translate_single |
A view that translates nucleotide into aminoacid alphabet for one of the six frames. More... | |
constexpr auto | seqan3::view::translate |
A view that translates nucleotide into aminoacid alphabet with 1, 2, 3 or 6 frames. More... | |
constexpr auto | seqan3::view::trim |
A view that does quality-threshold trimming on a range of seqan3::QualityAlphabet. More... | |
General purpose views | |
template<typename out_t > | |
auto const | seqan3::view::convert |
A view that converts each element in the input range (implicitly or via static_cast ). More... | |
constexpr auto | seqan3::view::drop |
A view adaptor that returns all elements after n from the underlying range (or an empty range if the underlying range is shorter). More... | |
template<auto index> | |
auto const | seqan3::view::get |
A view calling std::get on each element in a range. More... | |
constexpr auto | seqan3::view::interleave |
A view that interleaves a given range into another range at regular intervals. More... | |
constexpr auto | seqan3::view::istreambuf |
A view factory that returns a view over the stream buffer of an input stream. More... | |
constexpr auto | seqan3::view::pairwise_combine |
A view adaptor that generates all pairwise combinations of the elements of the underlying range. More... | |
auto constexpr | seqan3::view::persist |
A view adaptor that wraps rvalue references of non-views. More... | |
constexpr detail::repeat_fn | seqan3::view::repeat |
A view factory that repeats a given value infinitely. More... | |
constexpr auto | seqan3::view::repeat_n |
A view factory that repeats a given value n times. More... | |
constexpr auto | seqan3::view::single_pass_input |
A view adapter that decays most of the range properties and adds single pass behavior. More... | |
constexpr auto | seqan3::view::slice |
A view adaptor that returns a half-open interval on the underlying range. More... | |
auto constexpr | seqan3::view::take |
A view adaptor that returns the first size elements from the underlying range (or less if the underlying range is shorter). More... | |
auto constexpr | seqan3::view::take_exactly |
A view adaptor that returns the first size elements from the underlying range (or less if the underlying range is shorter); also provides size information. More... | |
auto constexpr | seqan3::view::take_exactly_or_throw |
A view adaptor that returns the first size elements from the underlying range and also exposes size information; throws if the underlying range is smaller than size . More... | |
auto constexpr | seqan3::view::take_line = view::take_until_and_consume(is_char<'\r'> || is_char<'\n'>) |
A view adaptor that returns a single line from the underlying range or the full range if there is no newline. More... | |
auto constexpr | seqan3::view::take_line_or_throw = view::take_until_or_throw_and_consume(is_char<'\r'> || is_char<'\n'>) |
A view adaptor that returns a single line from the underlying range (throws if there is no end-of-line). More... | |
auto constexpr | seqan3::view::take_until |
A view adaptor that returns elements from the underlying range until the functor evaluates to true (or the end of the underlying range is reached). More... | |
auto constexpr | seqan3::view::take_until_or_throw |
A view adaptor that returns elements from the underlying range until the functor evaluates to true (throws if the end of the underlying range is reached). More... | |
auto constexpr | seqan3::view::take_until_and_consume |
A view adaptor that returns elements from the underlying range until the functor evaluates to true (or the end of the underlying range is reached; consumes end in single-pass ranges). More... | |
auto constexpr | seqan3::view::take_until_or_throw_and_consume |
A view adaptor that returns elements from the underlying range until the functor evaluates to true (throws if the end of the underlying range is reached; consumes end in single-pass ranges). More... | |
auto const | seqan3::view::to_lower |
A view that calls seqan3::to_lower() on each element in the input range. More... | |
auto const | seqan3::view::to_upper |
A view that calls seqan3::to_upper() on each element in the input range. More... | |
constexpr auto | seqan3::view::all |
A view adaptor that behaves like std::view:all, but type erases contiguous ranges. More... | |
Views are "lazy range combinators" that offer modified views onto other ranges.
SeqAn3 makes heavy use of views as defined in the Ranges Technical Specification. From the original documentation: "A view is a lightweight wrapper that presents a view of an underlying sequence of elements in some custom way without mutating or copying it. Views are cheap to create and copy, and have non-owning reference semantics. [...] The big advantage of ranges over iterators is their composability. They permit a functional style of programming where data is manipulated by passing it through a series of combinators. In addition, the combinators can be lazy, only doing work when the answer is requested, and purely functional, without mutating the original data. This makes it easier to reason about your code, especially when writing concurrent programs."
See the range module for how views relate to containers and decorators.
Most views provided by SeqAn3 are specific to biological operations, like seqan3::view::trim which trims sequences based on the quality or seqan3::view::complement which generates the complement of a nucleotide sequence. But SeqAn3 also provides some general purpose views.
ranges::view
.seqan3::view
.Functional and pipe notations:
Re-transform into a distinct container:
Composability:
When talking about views, two different entities are often conflated:
auto vec_view
above)view::reverse
and view::complement
are view adaptors)The view adaptor also facilitates the piping behaviour. It is the only entity that is publicly documented and the actual view type (the range type returned by the adaptor) is considered implementation defined. The properties of the returned range are however specified and documented as part of the adaptor, see below.
An exception to this rule are views that don't work on an underlying range and can only be placed at the beginning of a pipe of operations; they do not need an adaptor, because their constructor is sufficient. This is not relevant for the documentation, though, we always document view::foo
, independent of whether view::foo
is the adaptor that returns the "foo type" or whether view::foo
is the "foo type".
There are three view properties that are documented for a view, only if that view fulfills them:
Source-only views: Most views operate on an underlying range and return a (modified) range, i.e. they can be placed at the beginning, middle or end of a "pipe" of view operations. However, some views are limited to being at the front ("source"), e.g. std::view::single
, ranges::view::concat
and ranges::view::ints
. These views are marked as "source-only" and have no urng_t
column in the second table.
Sink-only views: The opposite of a source-only view. It can only be placed at the end of a pipe, i.e. it operates on views, but does not actually return a range (has no rrng_t
column in the second table).
Deep views: Some views are declared as "deeps views". This means, that in case they are given a range-of-range as input (as opposed to just a range), they will apply their transformation on the innermost range (instead of the outermost range which would be default). Most alphabet-based transformations are defined as deep, but you can use seqan3::view::deep to make any view (adaptor) deep. See seqan3::view::deep for more details.
For all views the following are documented:
range concepts and reference_t | urng_t (underlying range type) | rrng_t (returned range type) |
---|---|---|
std::ranges::InputRange | [required] (usually) | [preserved|lost|guaranteed] (usually preserved) |
std::ranges::ForwardRange | [required] (or not) | [preserved|lost|guaranteed] |
std::ranges::BidirectionalRange | [required] (or not) | [preserved|lost|guaranteed] |
std::ranges::RandomAccessRange | [required] (or not) | [preserved|lost|guaranteed] |
std::ranges::ContiguousRange | [required] (or not) | [preserved|lost|guaranteed] (usually lost) |
std::ranges::ViewableRange | [required] (usually) | [preserved|lost|guaranteed] (usually guaranteed) |
std::ranges::View | [required] (or not) | [preserved|lost|guaranteed] (usually guaranteed) |
std::ranges::SizedRange | [required] (or not) | [preserved|lost|guaranteed] |
std::ranges::CommonRange | [required] (or not) | [preserved|lost|guaranteed] |
std::ranges::OutputRange | [required] (or not) | [preserved|lost|guaranteed] |
seqan3::ConstIterableRange | [required] (or not) | [preserved|lost] |
seqan3::reference_t | optionally a type or concept | optionally a type or concept |
Underlying range requirements: All view adaptors that are not source-only make certain assumptions about their underlying range. The most basic assumption is that the range satisfies std::ranges::InputRange
, but many have stronger requirements, e.g. std::ranges::RandomAccessRange
. The concepts in the first block all build up on each other, i.e. requiring one implies requiring those above; the other concepts are mostly independent of each other. Most views also require that the underlying range satisfy std::ranges::ViewableRange which means they don't accept temporary range objects other than views (because they are cheap to copy). A prominent exception to the latter is view::persist that exists exactly for this purpose. Note that these being requirements means that they are the minimal set of properties assumed. Views may very well make use of stronger properties if available.
Return range guarantees: All view adaptors that are not sink-only return a range that meets at least std::ranges::InputRange
and also std::ranges::View
(and conversely also std::ranges::ViewableRange
, because all views are viewable). Most views also preserve stronger properties, e.g. std::ranges::RandomAccessRange
, but this depends on the view. Some views also add properties not present on the input range, e.g. the range returned by ranges::view::take_exactly
meets std::ranges::SizedRange
, independent of whether this was met by the input range.
Underlying range's reference type: The reference type is the type the elements of the underlying range are accessed by (since dereferencing an iterator or calling operator[] returns the reference type). The reference type may or may not actually contain a &
(see below). For many SeqAn specific views additional concept requirements are defined for the input range's reference type, e.g. seqan3::view::complement can only operate on ranges whose elements are nucleotides (meet seqan3::NucleotideAlphabet_check). In some case the type may even be a specific type or the result of a type trait.
Returned range's reference type: Conversely certain views make guarantees on the concepts satisfied by the return range's reference type or even always have a fixed type, e.g. seqan3::view::complement operates on nucleotides and of course also returns nucleotides and "seqan3::reference_t<urng_t>" would imply that the reference type is the same. However, and this is important to note, the reference type of seqan3::view::complement has any actual &
removed from the underlying ranges' reference type (if originally present), this goes hand-in-hand with std::ranges::OutputRange being lost → original elements cannot be written to through this view. This is because new elements are being generated. Other views like view::reverse
also preserve the &
(if originally present), because the elements in the return view still point to the elements in the original range (just in different order). This has the effect that through some combinations of views you can modify the elements in the original range (if all views in the pipe preserve std::ranges::OutputRange), but through others you can't.
|
inline |
A view adaptor that behaves like std::view:all, but type erases contiguous ranges.
urng_t | The type of the range being processed. See below for requirements. [template parameter is omitted in pipe notation] |
[in] | urange | The range being processed. [parameter is omitted in pipe notation] |
std::basic_string_view{urange}
, or std::span{urange}
, or std::view::all(urange)
.Header
range concepts and reference_t | urng_t (underlying range type) | rrng_t (returned range type) |
---|---|---|
std::ranges::InputRange | required | preserved |
std::ranges::ForwardRange | preserved | |
std::ranges::BidirectionalRange | preserved | |
std::ranges::RandomAccessRange | preserved | |
std::ranges::ContiguousRange | preserved | |
std::ranges::ViewableRange | required | guaranteed |
std::ranges::View | guaranteed | |
std::ranges::SizedRange | preserved | |
std::ranges::CommonRange | preserved | |
std::ranges::OutputRange | preserved | |
seqan3::ConstIterableRange | preserved | |
seqan3::reference_t | seqan3::reference_t<urng_t> |
See the view submodule documentation for detailed descriptions of the view properties.
urng_t (underlying range type) | rrng_t (returned range type) |
---|---|
std::basic_string const & or std::basic_string_view | std::basic_string_view |
seqan3::ForwardingRange && std::ranges::SizedRange && std::ranges::ContiguousRange | std::span |
seqan3::ForwardingRange && std::ranges::SizedRange && std::ranges::RandomAccessRange | std::ranges::subrange |
else | implementation defined type |
This adaptor is different from std::view::take in that it performs type erasure for some underlying ranges. It returns exactly the type specified above.
|
inline |
A view over an alphabet, given a range of characters.
urng_t | The type of the range being processed. See below for requirements. [template parameter is omitted in pipe notation] |
alphabet_t | The alphabet to convert to; must satisfy seqan3::Alphabet. |
[in] | urange | The range being processed. [parameter is omitted in pipe notation] |
Header
This view is a deep view: Given a range-of-range as input (as opposed to just a range), it will apply the transformation on the innermost range (instead of the outermost range).
range concepts and reference_t | urng_t (underlying range type) | rrng_t (returned range type) |
---|---|---|
std::ranges::InputRange | required | preserved |
std::ranges::ForwardRange | preserved | |
std::ranges::BidirectionalRange | preserved | |
std::ranges::RandomAccessRange | preserved | |
std::ranges::ContiguousRange | lost | |
std::ranges::ViewableRange | required | guaranteed |
std::ranges::View | guaranteed | |
std::ranges::SizedRange | preserved | |
std::ranges::CommonRange | preserved | |
std::ranges::OutputRange | lost | |
seqan3::ConstIterableRange | preserved | |
seqan3::reference_t | seqan3::alphabet_char_t<alphabet_t> | alphabet_t |
See the view submodule documentation for detailed descriptions of the view properties.
|
inline |
A view that converts a range of nucleotides to their complement.
urng_t | The type of the range being processed. See below for requirements. [template parameter is omitted in pipe notation] |
[in] | urange | The range being processed. [parameter is omitted in pipe notation] |
Calls seqan3::NucleotideAlphabet::complement() on every element of the input range.
Header
This view is a deep view: Given a range-of-range as input (as opposed to just a range), it will apply the transformation on the innermost range (instead of the outermost range).
range concepts and reference_t | urng_t (underlying range type) | rrng_t (returned range type) |
---|---|---|
std::ranges::InputRange | required | preserved |
std::ranges::ForwardRange | preserved | |
std::ranges::BidirectionalRange | preserved | |
std::ranges::RandomAccessRange | preserved | |
std::ranges::ContiguousRange | lost | |
std::ranges::ViewableRange | required | guaranteed |
std::ranges::View | guaranteed | |
std::ranges::SizedRange | preserved | |
std::ranges::CommonRange | preserved | |
std::ranges::OutputRange | lost | |
seqan3::ConstIterableRange | preserved | |
seqan3::reference_t | seqan3::NucleotideAlphabet | std::remove_reference_t<seqan3::reference_t<urng_t>> |
See the view submodule documentation for detailed descriptions of the view properties.
auto const seqan3::view::convert |
A view that converts each element in the input range (implicitly or via static_cast
).
urng_t | The type of the range being processed. See below for requirements. [template parameter is omitted in pipe notation] |
[in] | urange | The range being processed. [parameter is omitted in pipe notation] |
Header
range concepts and reference_t | urng_t (underlying range type) | rrng_t (returned range type) |
---|---|---|
std::ranges::InputRange | required | preserved |
std::ranges::ForwardRange | preserved | |
std::ranges::BidirectionalRange | preserved | |
std::ranges::RandomAccessRange | preserved | |
std::ranges::View | guaranteed | |
std::ranges::SizedRange | preserved | |
std::ranges::CommonRange | preserved | |
std::ranges::OutputRange | lost | |
seqan3::ConstIterableRange | preserved | |
seqan3::reference_t | seqan3::ConvertibleTo<out_t> | out_t |
See the view submodule documentation for detailed descriptions of the view properties.
Convert from int
to bool
:
Convert from seqan3::dna15 to seqan3::dna5:
|
inline |
A view adaptor that returns all elements after n from the underlying range (or an empty range if the underlying range is shorter).
urng_t | The type of the range being processed. See below for requirements. [template parameter is omitted in pipe notation] |
[in] | urange | The range being processed. [parameter is omitted in pipe notation] |
[in] | drop_size | The number of elements to drop from the beginning. |
drop_size
.Header
range concepts and reference_t | urng_t (underlying range type) | rrng_t (returned range type) |
---|---|---|
std::ranges::InputRange | required | preserved |
std::ranges::ForwardRange | preserved | |
std::ranges::BidirectionalRange | preserved | |
std::ranges::RandomAccessRange | preserved | |
std::ranges::ContiguousRange | preserved | |
std::ranges::ViewableRange | required | guaranteed |
std::ranges::View | guaranteed | |
std::ranges::SizedRange | preserved | |
std::ranges::CommonRange | preserved | |
std::ranges::OutputRange | preserved | |
seqan3::ConstIterableRange | preserved | |
seqan3::reference_t | seqan3::reference_t<urng_t> |
See the view submodule documentation for detailed descriptions of the view properties.
urng_t (underlying range type) | rrng_t (returned range type) |
---|---|
std::basic_string const & or std::basic_string_view | std::basic_string_view |
seqan3::ForwardingRange && std::ranges::SizedRange && std::ranges::ContiguousRange | std::span |
seqan3::ForwardingRange && std::ranges::SizedRange && std::ranges::RandomAccessRange | std::ranges::subrange |
else | implementation defined type |
The adaptor is different from std::view::drop in that it performs type erasure for some underlying ranges. It returns exactly the type specified above.
Construction time of the returned view is in if the underlying range models at least std::ranges::RandomAccessRange and std::ranges::SizedRange; otherwise in .
|
inline |
A view calling std::get on each element in a range.
size_t | The type of the range being processed. See below for requirements. [template parameter is omitted in pipe notation] |
index | The index to get. |
[in] | urange | The range being processed. [parameter is omitted in pipe notation] |
Header
range concepts and reference_t | urng_t (underlying range type) | rrng_t (returned range type) |
---|---|---|
std::ranges::InputRange | required | preserved |
std::ranges::ForwardRange | preserved | |
std::ranges::BidirectionalRange | preserved | |
std::ranges::RandomAccessRange | preserved | |
std::ranges::ContiguousRange | lost | |
std::ranges::ViewableRange | required | preserved |
std::ranges::View | preserved | |
std::ranges::SizedRange | preserved | |
std::ranges::CommonRange | preserved | |
std::ranges::OutputRange | preserved | |
seqan3::ConstIterableRange | preserved | |
seqan3::reference_t | seqan3::TupleLike | std::tuple_element_t<index, seqan3::reference_t<urng_t>> |
See the view submodule documentation for detailed descriptions of the view properties.
|
inline |
A view that interleaves a given range into another range at regular intervals.
urng_t | The type of the range being processed. |
inserted_rng_t | The type of the range being inserted. |
[in] | urange | The range being processed. |
[in] | inserted_range | The range being inserted. |
[in] | step_size | A value of size_type which indicates the interval to insert the inserted_range. |
This view can be used to insert one range into another range at regular intervals. It behaves essentially like | std::view::chunk(step_size) | std::view::join(inserted_range)
except that for input that models std::ranges::RandomAccessRange and std::ranges::SizedRange a more efficient data structure is returned (otherwise it returns exactly the above combination of views).
Header
range concepts and reference_t | urng_t (underlying range type) | rrng_t (returned range type) |
---|---|---|
std::ranges::InputRange | required | preserved |
std::ranges::ForwardRange | required | preserved |
std::ranges::BidirectionalRange | required | preserved |
std::ranges::RandomAccessRange | required | preserved |
std::ranges::ContiguousRange | lost | |
std::ranges::ViewableRange | required | guaranteed |
std::ranges::View | guaranteed | |
std::ranges::SizedRange | required | preserved |
std::ranges::CommonRange | preserved | |
std::ranges::OutputRange | preserved | |
seqan3::ConstIterableRange | preserved | |
seqan3::reference_t | seqan3::reference_t<urng_t> |
If above requirements are not met, this adaptor forwards to | ranges::view::chunk(step_size) | ranges::view::join(inserted_range)
which returns a view with the following properties:
range concepts and reference_t | urng_t (underlying range type) | rrng_t (returned range type) |
---|---|---|
std::ranges::InputRange | required | preserved |
std::ranges::ForwardRange | required | lost |
std::ranges::BidirectionalRange | lost | |
std::ranges::RandomAccessRange | lost | |
std::ranges::ContiguousRange | lost | |
std::ranges::ViewableRange | required | guaranteed |
std::ranges::View | guaranteed | |
std::ranges::SizedRange | lost | |
std::ranges::CommonRange | lost | |
std::ranges::OutputRange | lost | |
seqan3::ConstIterableRange | lost | |
seqan3::reference_t | seqan3::value_type_t<urng_t> |
urng_t
is the type of the range modified by this view (input).rrng_type
is the type of the range returned by this view.
|
inline |
A view factory that returns a view over the stream buffer of an input stream.
istreambuf_t | The type of the stream(buffer); must be std::basic_streambuf or model seqan3::IStream2. |
[in] | istreambuf | The stream buffer or an input stream of whome the buffer is retrieved. |
Header
This is a source-only view adaptor, also known as a range factory; you cannot pipe anything into it.
range concepts and reference_t | rrng_t (returned range type) |
---|---|
std::ranges::InputRange | guaranteed |
std::ranges::ForwardRange | |
std::ranges::BidirectionalRange | |
std::ranges::RandomAccessRange | |
std::ranges::ContiguousRange | |
std::ranges::ViewableRange | guaranteed |
std::ranges::View | guaranteed |
std::ranges::SizedRange | |
std::ranges::CommonRange | |
std::ranges::OutputRange | |
seqan3::ConstIterableRange | guaranteed |
seqan3::reference_t | istream_t::char_type |
See the view submodule documentation for detailed descriptions of the view properties.
This adaptor is different from std::ranges::istream_range in that it operates directly on the buffer. It further uses a custom streambuf_iterator (not std::istreambuf_iterator) that performs less virtual function calls.
|
inline |
A view that calls std::hash on each substring of length k in the input range.
urng_t | The type of the range being processed. See below for requirements. [template parameter is omitted in pipe notation] |
[in] | urange | The range being processed. [parameter is omitted in pipe notation] |
Header
range concepts and reference_t | urng_t (underlying range type) | rrng_t (returned range type) |
---|---|---|
std::ranges::InputRange | required | preserved |
std::ranges::ForwardRange | required | preserved |
std::ranges::BidirectionalRange | preserved | |
std::ranges::RandomAccessRange | preserved | |
std::ranges::ContiguousRange | lost | |
std::ranges::ViewableRange | required | guaranteed |
std::ranges::View | guaranteed | |
std::ranges::SizedRange | preserved | |
std::ranges::CommonRange | preserved | |
std::ranges::OutputRange | lost | |
seqan3::ConstIterableRange | preserved | |
seqan3::reference_t | seqan3::Semialphabet | std::size_t |
See the view submodule documentation for detailed descriptions of the view properties.
|
inline |
A view adaptor that generates all pairwise combinations of the elements of the underlying range.
urng_t | The type of the range being processed. See below for requirements. |
[in] | urange | The range being processed. |
This view generates two-element tuples representing all unique combinations of the elements of the underlying range (the order of the elements is undefined). If the underlying range has less than two elements the returned range is empty, otherwise the size of the returned range corresponds to the binomial coefficient n choose 2
, where n
is the size of the underlying range. The reference type of this range is a tuple over the reference type of the underlying range. In order to receive the end iterator in constant time an iterator pointing to the last element of the underlying range will be cached upon construction of this view. This construction takes linear time for underlying ranges that do not model std::ranges::BidirectionalRange.
The returned iterator from begin does not model Cpp17Iterator since it does not return a reference to the represented type but a prvalue. Thus this iterator might not be usable within some legacy algorithms of the STL. But it is guaranteed to work with the ranges algorithms.
Header
range concepts and reference_t | urng_t (underlying range type) | rrng_t (returned range type) |
---|---|---|
std::ranges::InputRange | required | preserved |
std::ranges::ForwardRange | required | preserved |
std::ranges::BidirectionalRange | preserved | |
std::ranges::RandomAccessRange | preserved | |
std::ranges::ContiguousRange | lost | |
std::ranges::ViewableRange | required | guaranteed |
std::ranges::View | guaranteed | |
std::ranges::SizedRange | preserved | |
std::ranges::CommonRange | required | guaranteed |
std::ranges::OutputRange | lost | |
seqan3::ConstIterableRange | preserved | |
seqan3::reference_t | std::tuple<seqan3::reference_t<urng_t>, seqan3::reference_t<urng_t>> |
See the view submodule documentation for detailed descriptions of the view properties.
Concurrent access to this view, e.g. while iterating over it, is thread-safe and must not be protected externally.
|
inline |
A view adaptor that wraps rvalue references of non-views.
urng_t | The type of the range being processed. See below for requirements. [template parameter is omitted in pipe notation] |
[in] | urange | The range being processed. [parameter is omitted in pipe notation] |
For ranges that model std::ranges::ViewableRange, this adaptor just returns std::view::all. However this adaptor can also take ranges that are not "viewable", e.g. temporaries of containers. It wraps them in a shared pointer internally so all view requirements like constant copy are satisfied. However construction and copying might be slightly slower, because of reference counting.
Header
range concepts and reference_t | urng_t (underlying range type) | rrng_t (returned range type) |
---|---|---|
std::ranges::InputRange | required | preserved |
std::ranges::ForwardRange | preserved | |
std::ranges::BidirectionalRange | preserved | |
std::ranges::RandomAccessRange | preserved | |
std::ranges::ContiguousRange | preserved | |
std::ranges::ViewableRange | not required | guaranteed |
std::ranges::View | guaranteed | |
std::ranges::SizedRange | preserved | |
std::ranges::CommonRange | preserved | |
std::ranges::OutputRange | preserved | |
seqan3::ConstIterableRange | preserved | |
seqan3::reference_t | seqan3::reference_t<urng_t> |
See the view submodule documentation for detailed descriptions of the view properties.
|
inline |
A view over an alphabet, given a range of ranks.
urng_t | The type of the range being processed. See below for requirements. [template parameter is omitted in pipe notation] |
alphabet_t | The alphabet to convert to; must satisfy seqan3::WritableSemialphabet. |
[in] | urange | The range being processed. [parameter is omitted in pipe notation] |
Header
This view is a deep view: Given a range-of-range as input (as opposed to just a range), it will apply the transformation on the innermost range (instead of the outermost range).
range concepts and reference_t | urng_t (underlying range type) | rrng_t (returned range type) |
---|---|---|
std::ranges::InputRange | required | preserved |
std::ranges::ForwardRange | preserved | |
std::ranges::BidirectionalRange | preserved | |
std::ranges::RandomAccessRange | preserved | |
std::ranges::ContiguousRange | lost | |
std::ranges::ViewableRange | required | guaranteed |
std::ranges::View | guaranteed | |
std::ranges::SizedRange | preserved | |
std::ranges::CommonRange | preserved | |
std::ranges::OutputRange | lost | |
seqan3::ConstIterableRange | preserved | |
seqan3::reference_t | seqan3::alphabet_rank_t<alphabet_t> | alphabet_t |
See the view submodule documentation for detailed descriptions of the view properties.
|
inline |
A view factory that repeats a given value infinitely.
value_t | The type of value to repeat wrapped in a std::view::single; must model std::CopyConstructible. |
[in] | value | The value to repeat. |
Header
This view is source-only, it can only be at the beginning of a pipe of range transformations.
range concepts and reference_t | rrng_t (returned range type) |
---|---|
std::ranges::InputRange | guaranteed |
std::ranges::ForwardRange | guaranteed |
std::ranges::BidirectionalRange | guaranteed |
std::ranges::RandomAccessRange | guaranteed |
std::ranges::ContiguousRange | |
std::ranges::ViewableRange | guaranteed |
std::ranges::View | guaranteed |
std::ranges::SizedRange | |
std::ranges::CommonRange | |
std::ranges::OutputRange | guaranteed |
seqan3::ConstIterableRange | guaranteed |
seqan3::reference_t | std::remove_reference_t<value_t> & |
See the view submodule documentation for detailed descriptions of the view properties.
|
inline |
A view factory that repeats a given value n
times.
value_t | The type of value to repeat; must be std::CopyConstructible. |
[in] | value | The value to repeat. |
[in] | count | The number of times to repeat value . |
count
, where each element equals value
.Header
This view is source-only, it can only be at the beginning of a pipe of range transformations.
range concepts and reference_t | rrng_t (returned range type) |
---|---|
std::ranges::InputRange | guaranteed |
std::ranges::ForwardRange | guaranteed |
std::ranges::BidirectionalRange | guaranteed |
std::ranges::RandomAccessRange | guaranteed |
std::ranges::ContiguousRange | |
std::ranges::ViewableRange | guaranteed |
std::ranges::View | guaranteed |
std::ranges::SizedRange | guaranteed |
std::ranges::CommonRange | |
std::ranges::OutputRange | guaranteed |
seqan3::ConstIterableRange | guaranteed |
seqan3::reference_t | std::remove_reference_t<value_t> & |
See the view submodule documentation for detailed descriptions of the view properties.
|
inline |
A view adapter that decays most of the range properties and adds single pass behavior.
urng_t | The type of the range being processed. See below for requirements. |
[in] | urange | The range being processed. |
This view adds single-pass semantics to any input view. This means, that begin
always returns the iterator to the current location in the underlying range after k
elements have been already consumed and not to the begin of the underlying range, i.e. it mirrors the behavior of an input stream. Note, the view updates an internal state after moving the associated iterator. Thus, the const begin
and const end
are explicitly deleted.
Header
range concepts and reference_t | urng_t (underlying range type) | rrng_t (returned range type) |
---|---|---|
std::ranges::InputRange | required | preserved |
std::ranges::ForwardRange | lost | |
std::ranges::BidirectionalRange | lost | |
std::ranges::RandomAccessRange | lost | |
std::ranges::ContiguousRange | lost | |
std::ranges::ViewableRange | required | guaranteed |
std::ranges::View | guaranteed | |
std::ranges::SizedRange | lost | |
std::ranges::CommonRange | lost | |
std::ranges::OutputRange | preserved | |
seqan3::ConstIterableRange | lost | |
seqan3::reference_t | seqan3::reference_t<urng_t> |
See the view submodule documentation for detailed descriptions of the view properties.
Concurrent access to this view, e.g. while iterating over it, is not thread-safe and must be protected externally.
|
inline |
A view adaptor that returns a half-open interval on the underlying range.
urng_t | The type of the range being processed. See below for requirements. [template parameter is omitted in pipe notation] |
[in] | urange | The range being processed. [parameter is omitted in pipe notation] |
[in] | begin_pos | The beginning of the interval (index of first element returned). |
[in] | end_pos | The end of the interval (index behind the last element returned). |
end_pos - begin_pos
elements of the underlying range. std::invalid_argument | If end_pos < begin_pos . |
Header
range concepts and reference_t | urng_t (underlying range type) | rrng_t (returned range type) |
---|---|---|
std::ranges::InputRange | required | preserved |
std::ranges::ForwardRange | preserved | |
std::ranges::BidirectionalRange | preserved | |
std::ranges::RandomAccessRange | preserved | |
std::ranges::ContiguousRange | preserved | |
std::ranges::ViewableRange | required | guaranteed |
std::ranges::View | guaranteed | |
std::ranges::SizedRange | preserved | |
std::ranges::CommonRange | preserved | |
std::ranges::OutputRange | preserved | |
seqan3::ConstIterableRange | preserved | |
seqan3::reference_t | seqan3::reference_t<urng_t> |
See the view submodule documentation for detailed descriptions of the view properties.
This adaptor is a combination of seqan3::view::drop and seqan3::view::take.
If begin_pos
is larger than the size of the underlying range an empty range is returned. If end_pos
is larger than the size of the underlying range less elements are returned.
If end_pos < begin_pos
an exception of type std::invalid_argument is thrown.
urng_t (underlying range type) | rrng_t (returned range type) |
---|---|
std::basic_string const & or std::basic_string_view | std::basic_string_view |
seqan3::ForwardingRange && std::ranges::SizedRange && std::ranges::ContiguousRange | std::span |
seqan3::ForwardingRange && std::ranges::SizedRange && std::ranges::RandomAccessRange | std::ranges::subrange |
else | implementation defined type |
The adaptor returns exactly the type specified above.
Construction of the returned view is in for some views, see seqan3::view::drop.
|
inline |
A view adaptor that returns the first size
elements from the underlying range (or less if the underlying range is shorter).
urng_t | The type of the range being processed. See below for requirements. [template parameter is omitted in pipe notation] |
[in] | urange | The range being processed. [parameter is omitted in pipe notation] |
[in] | size | The target size of the view. |
size
elements of the underlying range.Header
range concepts and reference_t | urng_t (underlying range type) | rrng_t (returned range type) |
---|---|---|
std::ranges::InputRange | required | preserved |
std::ranges::ForwardRange | preserved | |
std::ranges::BidirectionalRange | preserved | |
std::ranges::RandomAccessRange | preserved | |
std::ranges::ContiguousRange | preserved | |
std::ranges::ViewableRange | required | guaranteed |
std::ranges::View | guaranteed | |
std::ranges::SizedRange | preserved | |
std::ranges::CommonRange | preserved | |
std::ranges::OutputRange | preserved | |
seqan3::ConstIterableRange | preserved | |
seqan3::reference_t | seqan3::reference_t<urng_t> |
See the view submodule documentation for detailed descriptions of the view properties.
urng_t (underlying range type) | rrng_t (returned range type) |
---|---|
std::basic_string const & or std::basic_string_view | std::basic_string_view |
seqan3::ForwardingRange && std::ranges::SizedRange && std::ranges::ContiguousRange | std::span |
seqan3::ForwardingRange && std::ranges::SizedRange && std::ranges::RandomAccessRange | std::ranges::subrange |
else | implementation defined type |
This adaptor is different from std::view::take in that it performs type erasure for some underlying ranges. It returns exactly the type specified above.
Some benchmarks have shown that it is also faster than std::view::take for pure forward and input ranges.
|
inline |
A view adaptor that returns the first size
elements from the underlying range (or less if the underlying range is shorter); also provides size information.
urng_t | The type of the range being processed. See below for requirements. [template parameter is omitted in pipe notation] |
[in] | urange | The range being processed. [parameter is omitted in pipe notation] |
[in] | size | The target size of the view. |
size
elements of the underlying range.Header
range concepts and reference_t | urng_t (underlying range type) | rrng_t (returned range type) |
---|---|---|
std::ranges::InputRange | required | preserved |
std::ranges::ForwardRange | preserved | |
std::ranges::BidirectionalRange | preserved | |
std::ranges::RandomAccessRange | preserved | |
std::ranges::ContiguousRange | preserved | |
std::ranges::ViewableRange | required | guaranteed |
std::ranges::View | guaranteed | |
std::ranges::SizedRange | guaranteed | |
std::ranges::CommonRange | preserved | |
std::ranges::OutputRange | preserved except if urng_t is std::basic_string | |
seqan3::ConstIterableRange | preserved | |
seqan3::reference_t | seqan3::reference_t<urng_t> |
See the view submodule documentation for detailed descriptions of the view properties.
The difference to seqan3::view::take is that this view always exposes size information – even if the underlying range is not sized. You should only use this if you know that the underlying range will always be at least size
long.
For seqan3::view::take_exactly if the underlying range is shorter than size
, the behaviour is undefined. seqan3::view::take_exactly_or_throw is a safer alternative, because it throws an exception when an iterator before the size
-th one compares equal to the end sentinel; and it also throws on construction if it knows that the underlying range is smaller.
|
inline |
A view adaptor that returns the first size
elements from the underlying range and also exposes size information; throws if the underlying range is smaller than size
.
seqan3::unexpected_end_of_input | If the underlying range is smaller than size . |
urng_t | The type of the range being processed. See below for requirements. [template parameter is omitted in pipe notation] |
[in] | urange | The range being processed. [parameter is omitted in pipe notation] |
[in] | size | The target size of the view. |
size
elements of the underlying range.Header
range concepts and reference_t | urng_t (underlying range type) | rrng_t (returned range type) |
---|---|---|
std::ranges::InputRange | required | preserved |
std::ranges::ForwardRange | preserved | |
std::ranges::BidirectionalRange | preserved | |
std::ranges::RandomAccessRange | preserved | |
std::ranges::ContiguousRange | preserved | |
std::ranges::ViewableRange | required | guaranteed |
std::ranges::View | guaranteed | |
std::ranges::SizedRange | guaranteed | |
std::ranges::CommonRange | preserved | |
std::ranges::OutputRange | preserved except if urng_t is std::basic_string | |
seqan3::ConstIterableRange | preserved | |
seqan3::reference_t | seqan3::reference_t<urng_t> |
See the view submodule documentation for detailed descriptions of the view properties.
The difference to seqan3::view::take is that this view always exposes size information – even if the underlying range is not sized. You should only use this if you know that the underlying range will always be at least size
long.
For seqan3::view::take_exactly if the underlying range is shorter than size
, the behaviour is undefined. seqan3::view::take_exactly_or_throw is a safer alternative, because it throws an exception when an iterator before the size
-th one compares equal to the end sentinel; and it also throws on construction if it knows that the underlying range is smaller.
|
inline |
A view adaptor that returns a single line from the underlying range or the full range if there is no newline.
urng_t | The type of the range being processed. See below for requirements. [template parameter is omitted in pipe notation] |
[in] | urange | The range being processed. [parameter is omitted in pipe notation] |
\n
or \r\n
). See below for the properties of the returned range.This adaptor returns a single line excluding the end-line character(s), but moving the cursor behind them for single-pass ranges. I.e. for all ranges that satisfy std::ranges::ForwardRange this is the same as calling
but for single pass input ranges this means that any endline characters after the returned range are also consumed (this potentially includes multiple newline characters).
Header
range concepts and reference_t | urng_t (underlying range type) | rrng_t (returned range type) |
---|---|---|
std::ranges::InputRange | required | preserved |
std::ranges::ForwardRange | preserved | |
std::ranges::BidirectionalRange | preserved | |
std::ranges::RandomAccessRange | preserved | |
std::ranges::ContiguousRange | preserved | |
std::ranges::ViewableRange | required | guaranteed |
std::ranges::View | guaranteed | |
std::ranges::SizedRange | lost | |
std::ranges::CommonRange | lost | |
std::ranges::OutputRange | preserved | |
seqan3::ConstIterableRange | preserved | |
seqan3::reference_t | std::CommonReference<char> | seqan3::reference_t<urng_t> |
See the view submodule documentation for detailed descriptions of the view properties.
Behaviour on std::ranges::ForwardRange:
On single pass std::ranges::InputRange it can be used to tokenise the input stream line-wise:
|
inline |
A view adaptor that returns a single line from the underlying range (throws if there is no end-of-line).
seqan3::unexpected_end_of_input | If the underlying range contains no end-of-line marker. |
urng_t | The type of the range being processed. See below for requirements. [template parameter is omitted in pipe notation] |
[in] | urange | The range being processed. [parameter is omitted in pipe notation] |
\n
or \r\n
). See below for the properties of the returned range.This adaptor returns a single line excluding the end-line character(s), but moving the cursor behind them for single-pass ranges. I.e. for all ranges that satisfy std::ranges::ForwardRange this is the same as calling
but for single pass input ranges this means that any endline characters after the returned range are also consumed (this potentially includes multiple newline characters).
Header
range concepts and reference_t | urng_t (underlying range type) | rrng_t (returned range type) |
---|---|---|
std::ranges::InputRange | required | preserved |
std::ranges::ForwardRange | preserved | |
std::ranges::BidirectionalRange | preserved | |
std::ranges::RandomAccessRange | preserved | |
std::ranges::ContiguousRange | preserved | |
std::ranges::ViewableRange | required | guaranteed |
std::ranges::View | guaranteed | |
std::ranges::SizedRange | lost | |
std::ranges::CommonRange | lost | |
std::ranges::OutputRange | preserved | |
seqan3::ConstIterableRange | preserved | |
seqan3::reference_t | std::CommonReference<char> | seqan3::reference_t<urng_t> |
See the view submodule documentation for detailed descriptions of the view properties.
Behaviour on std::ranges::ForwardRange:
On single pass std::ranges::InputRange it can be used to tokenise the input stream line-wise:
|
inline |
A view adaptor that returns elements from the underlying range until the functor evaluates to true (or the end of the underlying range is reached).
urng_t | The type of the range being processed. See below for requirements. [template parameter is omitted in pipe notation] |
fun_t | The type of the functor; must model std::Invocable with seqan3::reference_t<urng_t> and return a type convertible to bool . |
[in] | urange | The range being processed. [parameter is omitted in pipe notation] |
[in] | fun | The functor. |
Header
range concepts and reference_t | urng_t (underlying range type) | rrng_t (returned range type) |
---|---|---|
std::ranges::InputRange | required | preserved |
std::ranges::ForwardRange | preserved*¹ | |
std::ranges::BidirectionalRange | *preserved*¹ | |
std::ranges::RandomAccessRange | *preserved*¹ | |
std::ranges::ContiguousRange | *preserved*¹ | |
std::ranges::ViewableRange | *required | guaranteed |
std::ranges::View | guaranteed | |
std::ranges::SizedRange | lost | |
std::ranges::CommonRange | lost | |
std::ranges::OutputRange | preserved | |
seqan3::ConstIterableRange | *preserved*¹ | |
seqan3::reference_t | seqan3::reference_t<urng_t> |
See the view submodule documentation for detailed descriptions of the view properties.
¹ The marked properties are only preserved if the specified functor models std::RegularInvocable<fun_t, reference_t<urng_t>
, i.e. applying the functor doesn't change the functor. If the functor only models std::Invocable
and not std::RegularInvocable
these concepts are lost.
Throwing: seqan3::view::take_until_or_throw
and seqan3::view::take_until_or_throw_and_consume
throw an exception if the end of the underlying range is reached before their own termination criterium is met. This is useful if you want a "strict" evaluation of the functor.
Consuming: seqan3::view::take_until_and_consume
and seqan3::view::take_until_or_throw_and_consume
behave the same as their non-consuming counter-parts if the underlying range models at least std::ForwardRange
. If, however, the underlying range is a pure std::InputRange
, the view will keep moving the underlying iterator forward as long as the termination criterium holds and the underlying range is not at end. This is useful for string tokenisation among other things.
|
inline |
A view adaptor that returns elements from the underlying range until the functor evaluates to true (or the end of the underlying range is reached; consumes end in single-pass ranges).
seqan3::unexpected_end_of_input | If the underlying range contains no element that satisfies the functor. |
urng_t | The type of the range being processed. See below for requirements. [template parameter is omitted in pipe notation] |
fun_t | The type of the functor; must model std::Invocable with seqan3::reference_t<urng_t> and return a type convertible to bool . |
[in] | urange | The range being processed. [parameter is omitted in pipe notation] |
[in] | fun | The functor. |
Header
range concepts and reference_t | urng_t (underlying range type) | rrng_t (returned range type) |
---|---|---|
std::ranges::InputRange | required | preserved |
std::ranges::ForwardRange | preserved*¹ | |
std::ranges::BidirectionalRange | *preserved*¹ | |
std::ranges::RandomAccessRange | *preserved*¹ | |
std::ranges::ContiguousRange | *preserved*¹ | |
std::ranges::ViewableRange | *required | guaranteed |
std::ranges::View | guaranteed | |
std::ranges::SizedRange | lost | |
std::ranges::CommonRange | lost | |
std::ranges::OutputRange | preserved | |
seqan3::ConstIterableRange | *preserved*¹ | |
seqan3::reference_t | seqan3::reference_t<urng_t> |
See the view submodule documentation for detailed descriptions of the view properties.
¹ The marked properties are only preserved if the specified functor models std::RegularInvocable<fun_t, reference_t<urng_t>
, i.e. applying the functor doesn't change the functor. If the functor only models std::Invocable
and not std::RegularInvocable
these concepts are lost.
Throwing: seqan3::view::take_until_or_throw
and seqan3::view::take_until_or_throw_and_consume
throw an exception if the end of the underlying range is reached before their own termination criterium is met. This is useful if you want a "strict" evaluation of the functor.
Consuming: seqan3::view::take_until_and_consume
and seqan3::view::take_until_or_throw_and_consume
behave the same as their non-consuming counter-parts if the underlying range models at least std::ForwardRange
. If, however, the underlying range is a pure std::InputRange
, the view will keep moving the underlying iterator forward as long as the termination criterium holds and the underlying range is not at end. This is useful for string tokenisation among other things.
|
inline |
A view adaptor that returns elements from the underlying range until the functor evaluates to true (throws if the end of the underlying range is reached).
seqan3::unexpected_end_of_input | If the underlying range contains no element that satisfies the functor. |
urng_t | The type of the range being processed. See below for requirements. [template parameter is omitted in pipe notation] |
fun_t | The type of the functor; must model std::Invocable with seqan3::reference_t<urng_t> and return a type convertible to bool . |
[in] | urange | The range being processed. [parameter is omitted in pipe notation] |
[in] | fun | The functor. |
Header
range concepts and reference_t | urng_t (underlying range type) | rrng_t (returned range type) |
---|---|---|
std::ranges::InputRange | required | preserved |
std::ranges::ForwardRange | preserved*¹ | |
std::ranges::BidirectionalRange | *preserved*¹ | |
std::ranges::RandomAccessRange | *preserved*¹ | |
std::ranges::ContiguousRange | *preserved*¹ | |
std::ranges::ViewableRange | *required | guaranteed |
std::ranges::View | guaranteed | |
std::ranges::SizedRange | lost | |
std::ranges::CommonRange | lost | |
std::ranges::OutputRange | preserved | |
seqan3::ConstIterableRange | *preserved*¹ | |
seqan3::reference_t | seqan3::reference_t<urng_t> |
See the view submodule documentation for detailed descriptions of the view properties.
¹ The marked properties are only preserved if the specified functor models std::RegularInvocable<fun_t, reference_t<urng_t>
, i.e. applying the functor doesn't change the functor. If the functor only models std::Invocable
and not std::RegularInvocable
these concepts are lost.
Throwing: seqan3::view::take_until_or_throw
and seqan3::view::take_until_or_throw_and_consume
throw an exception if the end of the underlying range is reached before their own termination criterium is met. This is useful if you want a "strict" evaluation of the functor.
Consuming: seqan3::view::take_until_and_consume
and seqan3::view::take_until_or_throw_and_consume
behave the same as their non-consuming counter-parts if the underlying range models at least std::ForwardRange
. If, however, the underlying range is a pure std::InputRange
, the view will keep moving the underlying iterator forward as long as the termination criterium holds and the underlying range is not at end. This is useful for string tokenisation among other things.
|
inline |
A view adaptor that returns elements from the underlying range until the functor evaluates to true (throws if the end of the underlying range is reached; consumes end in single-pass ranges).
seqan3::unexpected_end_of_input | If the underlying range contains no element that satisfies the functor. |
urng_t | The type of the range being processed. See below for requirements. [template parameter is omitted in pipe notation] |
fun_t | The type of the functor; must model std::Invocable with seqan3::reference_t<urng_t> and return a type convertible to bool . |
[in] | urange | The range being processed. [parameter is omitted in pipe notation] |
[in] | fun | The functor. |
Header
range concepts and reference_t | urng_t (underlying range type) | rrng_t (returned range type) |
---|---|---|
std::ranges::InputRange | required | preserved |
std::ranges::ForwardRange | preserved*¹ | |
std::ranges::BidirectionalRange | *preserved*¹ | |
std::ranges::RandomAccessRange | *preserved*¹ | |
std::ranges::ContiguousRange | *preserved*¹ | |
std::ranges::ViewableRange | *required | guaranteed |
std::ranges::View | guaranteed | |
std::ranges::SizedRange | lost | |
std::ranges::CommonRange | lost | |
std::ranges::OutputRange | preserved | |
seqan3::ConstIterableRange | *preserved*¹ | |
seqan3::reference_t | seqan3::reference_t<urng_t> |
See the view submodule documentation for detailed descriptions of the view properties.
¹ The marked properties are only preserved if the specified functor models std::RegularInvocable<fun_t, reference_t<urng_t>
, i.e. applying the functor doesn't change the functor. If the functor only models std::Invocable
and not std::RegularInvocable
these concepts are lost.
Throwing: seqan3::view::take_until_or_throw
and seqan3::view::take_until_or_throw_and_consume
throw an exception if the end of the underlying range is reached before their own termination criterium is met. This is useful if you want a "strict" evaluation of the functor.
Consuming: seqan3::view::take_until_and_consume
and seqan3::view::take_until_or_throw_and_consume
behave the same as their non-consuming counter-parts if the underlying range models at least std::ForwardRange
. If, however, the underlying range is a pure std::InputRange
, the view will keep moving the underlying iterator forward as long as the termination criterium holds and the underlying range is not at end. This is useful for string tokenisation among other things.
|
inline |
A view that calls seqan3::to_char() on each element in the input range.
urng_t | The type of the range being processed. See below for requirements. [template parameter is omitted in pipe notation] |
[in] | urange | The range being processed. [parameter is omitted in pipe notation] |
Header
This view is a deep view: Given a range-of-range as input (as opposed to just a range), it will apply the transformation on the innermost range (instead of the outermost range).
range concepts and reference_t | urng_t (underlying range type) | rrng_t (returned range type) |
---|---|---|
std::ranges::InputRange | required | preserved |
std::ranges::ForwardRange | preserved | |
std::ranges::BidirectionalRange | preserved | |
std::ranges::RandomAccessRange | preserved | |
std::ranges::ContiguousRange | lost | |
std::ranges::ViewableRange | required | guaranteed |
std::ranges::View | guaranteed | |
std::ranges::SizedRange | preserved | |
std::ranges::CommonRange | preserved | |
std::ranges::OutputRange | lost | |
seqan3::ConstIterableRange | preserved | |
seqan3::reference_t | seqan3::Alphabet | seqan3::alphabet_char_t<seqan3::value_type_t<urng_t>> |
See the view submodule documentation for detailed descriptions of the view properties.
|
inline |
A view that calls seqan3::to_lower() on each element in the input range.
urng_t | The type of the range being processed. See below for requirements. [template parameter is omitted in pipe notation] |
[in] | urange | The range being processed. [parameter is omitted in pipe notation] |
Header
This view is a deep view: Given a range-of-range as input (as opposed to just a range), it will apply the transformation on the innermost range (instead of the outermost range).
range concepts and reference_t | urng_t (underlying range type) | rrng_t (returned range type) |
---|---|---|
std::ranges::InputRange | required | preserved |
std::ranges::ForwardRange | preserved | |
std::ranges::BidirectionalRange | preserved | |
std::ranges::RandomAccessRange | preserved | |
std::ranges::ContiguousRange | lost | |
std::ranges::ViewableRange | required | guaranteed |
std::ranges::View | guaranteed | |
std::ranges::SizedRange | preserved | |
std::ranges::CommonRange | preserved | |
std::ranges::OutputRange | lost | |
seqan3::ConstIterableRange | preserved | |
seqan3::reference_t | seqan3::Char | seqan3::remove_reference_t<seqan3::reference_t<urngt_>> |
See the view submodule documentation for detailed descriptions of the view properties.
|
inline |
A view that calls seqan3::to_rank() on each element in the input range.
urng_t | The type of the range being processed. See below for requirements. [template parameter is omitted in pipe notation] |
[in] | urange | The range being processed. [parameter is omitted in pipe notation] |
Header
This view is a deep view: Given a range-of-range as input (as opposed to just a range), it will apply the transformation on the innermost range (instead of the outermost range).
range concepts and reference_t | urng_t (underlying range type) | rrng_t (returned range type) |
---|---|---|
std::ranges::InputRange | required | preserved |
std::ranges::ForwardRange | preserved | |
std::ranges::BidirectionalRange | preserved | |
std::ranges::RandomAccessRange | preserved | |
std::ranges::ContiguousRange | lost | |
std::ranges::ViewableRange | required | guaranteed |
std::ranges::View | guaranteed | |
std::ranges::SizedRange | preserved | |
std::ranges::CommonRange | preserved | |
std::ranges::OutputRange | lost | |
seqan3::ConstIterableRange | preserved | |
seqan3::reference_t | seqan3::Alphabet | seqan3::alphabet_rank_t<seqan3::value_type_t<urng_t>> |
See the view submodule documentation for detailed descriptions of the view properties.
We also convert to unsigned here, because the seqan3::alphabet_rank_t is often uint8_t
which is often implemented as unsigned char
and thus will not be printed as a number by default.
|
inline |
A view that calls seqan3::to_upper() on each element in the input range.
urng_t | The type of the range being processed. See below for requirements. [template parameter is omitted in pipe notation] |
[in] | urange | The range being processed. [parameter is omitted in pipe notation] |
Header
This view is a deep view: Given a range-of-range as input (as opposed to just a range), it will apply the transformation on the innermost range (instead of the outermost range).
range concepts and reference_t | urng_t (underlying range type) | rrng_t (returned range type) |
---|---|---|
std::ranges::InputRange | required | preserved |
std::ranges::ForwardRange | preserved | |
std::ranges::BidirectionalRange | preserved | |
std::ranges::RandomAccessRange | preserved | |
std::ranges::ContiguousRange | lost | |
std::ranges::ViewableRange | required | guaranteed |
std::ranges::View | guaranteed | |
std::ranges::SizedRange | preserved | |
std::ranges::CommonRange | preserved | |
std::ranges::OutputRange | lost | |
seqan3::ConstIterableRange | preserved | |
seqan3::reference_t | seqan3::Char | seqan3::remove_reference_t<seqan3::reference_t<urngt_>> |
See the view submodule documentation for detailed descriptions of the view properties.
|
inline |
A view that translates nucleotide into aminoacid alphabet with 1, 2, 3 or 6 frames.
urng_t | The type of the range being processed. |
[in] | urange | The range being processed. |
[in] | tf | A value of seqan3::tanslation_frames that indicates the desired frames. |
This view can be used to translate nucleotide sequences into aminoacid sequences (see translation_frames for possible combination of frames).
Header
range concepts and reference_t | urng_t (underlying range type) | rrng_t (returned range type) |
---|---|---|
std::ranges::InputRange | required | preserved |
std::ranges::ForwardRange | required | preserved |
std::ranges::BidirectionalRange | required | preserved |
std::ranges::RandomAccessRange | required | preserved |
std::ranges::ContiguousRange | lost | |
std::ranges::ViewableRange | required | guaranteed |
std::ranges::View | guaranteed | |
std::ranges::SizedRange | required | preserved |
std::ranges::CommonRange | guaranteed | |
std::ranges::OutputRange | lost | |
seqan3::ConstIterableRange | required | preserved |
seqan3::reference_t | seqan3::NucleotideAlphabet | std::ranges::View && std::ranges::RandomAccessRange && std::ranges::SizedRange |
urng_t
is the type of the range modified by this view (input).rrng_type
is the type of the range returned by this view.Operating on a range of seqan3::dna5:
|
inline |
A view that translates nucleotide into aminoacid alphabet for one of the six frames.
urng_t | The type of the range being processed. |
[in] | urange | The range being processed. |
[in] | tf | A value of seqan3::translation_frames that indicates the desired frames. |
This view can be used to translate nucleotide sequences into aminoacid sequences (see translation_frames for possible combination of frames).
Header
range concepts and reference_t | urng_t (underlying range type) | rrng_t (returned range type) |
---|---|---|
std::ranges::InputRange | required | preserved |
std::ranges::ForwardRange | required | preserved |
std::ranges::BidirectionalRange | required | preserved |
std::ranges::RandomAccessRange | required | preserved |
std::ranges::ContiguousRange | lost | |
std::ranges::ViewableRange | required | guaranteed |
std::ranges::View | guaranteed | |
std::ranges::SizedRange | required | preserved |
std::ranges::CommonRange | guaranteed | |
std::ranges::OutputRange | lost | |
seqan3::ConstIterableRange | required | preserved |
seqan3::reference_t | seqan3::NucleotideAlphabet | seqan3::aa27 |
urng_t
is the type of the range modified by this view (input).rrng_type
is the type of the range returned by this view.Operating on a range of seqan3::dna5:
|
inline |
A view that does quality-threshold trimming on a range of seqan3::QualityAlphabet.
urng_t | The type of the range being processed. See below for requirements. |
threshold_t | Either seqan3::value_type_t<urng_t> or seqan3::alphabet_phred_t<seqan3::value_type_t<urng_t>>. |
[in] | urange | The range being processed. [parameter is omitted in pipe notation] |
[in] | threshold | The minimum quality. |
This view can be used to do easy quality based trimming of sequences.
Header
This view is a deep view: Given a range-of-range as input (as opposed to just a range), it will apply the transformation on the innermost range (instead of the outermost range).
range concepts and reference_t | urng_t (underlying range type) | rrng_t (returned range type) |
---|---|---|
std::ranges::InputRange | required | preserved |
std::ranges::ForwardRange | preserved | |
std::ranges::BidirectionalRange | preserved | |
std::ranges::RandomAccessRange | preserved | |
std::ranges::View | guaranteed | |
std::ranges::SizedRange | lost | |
std::ranges::CommonRange | lost | |
std::ranges::OutputRange | preserved | |
seqan3::ConstIterableRange | preserved | |
seqan3::reference_t | seqan3::QualityAlphabet | seqan3::reference_t<urng_t> |
See the view submodule documentation for detailed descriptions of the view properties.
Operating on a range of seqan3::phred42:
Or operating on a range of seqan3::dna5q: