38 template <std::ranges::view urng_t>
40 requires std::ranges::sized_range<urng_t> &&
41 std::ranges::random_access_range<urng_t> &&
46 template <std::ranges::view urng_t>
48 requires std::ranges::sized_range<urng_t> &&
49 std::ranges::random_access_range<urng_t> &&
101 template <
bool single>
120 template <std::ranges::range urng_t>
123 static_assert(std::ranges::viewable_range<urng_t>,
124 "The range parameter to views::translate[_single] cannot be a temporary of a non-view range.");
125 static_assert(std::ranges::sized_range<urng_t>,
126 "The range parameter to views::translate[_single] must model std::ranges::sized_range.");
127 static_assert(std::ranges::random_access_range<urng_t>,
128 "The range parameter to views::translate[_single] must model std::ranges::random_access_range.");
130 "The range parameter to views::translate[_single] must be over elements of seqan3::nucleotide_alphabet.");
139 template <std::ranges::range urng_t>
142 return me(std::forward<urng_t>(urange));
156 template <std::ranges::view urng_t>
158 requires std::ranges::sized_range<urng_t> &&
159 std::ranges::random_access_range<urng_t> &&
171 "REV_FRAME_0, FWD_FRAME_1, REV_FRAME_1, FWD_FRAME_2 and "
215 if (__builtin_popcount(
static_cast<uint8_t
>(_tf)) > 1)
229 template <
typename rng_t>
232 std::ranges::viewable_range<rng_t> &&
233 std::constructible_from<urng_t, std::ranges::ref_view<std::remove_reference_t<rng_t>>>
282 return {*
this,
size()};
288 return {*
this,
size()};
446 template <
typename urng_t>
451 template <
typename urng_t>
528 template <std::ranges::view urng_t>
530 requires std::ranges::sized_range<urng_t> &&
531 std::ranges::random_access_range<urng_t> &&
572 template <
typename t>
573 requires (range_dimension_v<t> == range_dimension_v<value_type> + 1) &&
574 std::is_same_v<std::remove_cvref_t<range_innermost_value_t<value_type>>,
576 static constexpr
bool is_compatible_this_aux =
true;
617 template <
typename rng_t>
620 std::ranges::viewable_range<rng_t> &&
621 std::constructible_from<urng_t, std::ranges::ref_view<std::remove_reference_t<rng_t>>>
670 return {*
this,
size()};
676 return {*
this,
size()};
735 template <
typename urng_t>
737 requires std::ranges::sized_range<urng_t> &&
738 std::ranges::random_access_range<urng_t> &&
Provides seqan3::aa27, container aliases and string literals.
Provides seqan3::add_enum_bitwise_operators.
The twenty-seven letter amino acid alphabet.
Definition: aa27.hpp:46
Template for range adaptor closure objects that store arguments and wrap a proto-adaptor.
Definition: detail.hpp:371
A generic random access iterator that delegates most operations to the range.
Definition: random_access_iterator.hpp:310
The return type of seqan3::views::translate_single.
Definition: translate.hpp:163
const_reference operator[](size_type const n) const
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition: translate.hpp:408
size_type size() const
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition: translate.hpp:329
reference operator[](size_type const n)
Return the n-th element.
Definition: translate.hpp:372
size_type size()
Returns the number of elements in the view.
Definition: translate.hpp:303
translation_frames tf
The frame that should be used for translation.
Definition: translate.hpp:168
iterator end() noexcept
Returns an iterator to the element following the last element of the container.
Definition: translate.hpp:280
std::ranges::range_difference_t< urng_t > difference_type
A signed integer type, usually std::ptrdiff_t.
Definition: translate.hpp:186
view_translate_single(rng_t &&_urange, translation_frames const _tf=translation_frames::FWD_FRAME_0)
Construct from another range.
Definition: translate.hpp:235
static constexpr small_string multiple_frame_error
Error thrown if tried to be used with multiple frames.
Definition: translate.hpp:170
view_translate_single() noexcept=default
Defaulted.
iterator begin() noexcept
Returns an iterator to the first element of the container.
Definition: translate.hpp:256
urng_t urange
The input range (of ranges).
Definition: translate.hpp:166
const_iterator end() const noexcept
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition: translate.hpp:286
const_iterator begin() const noexcept
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition: translate.hpp:262
std::ranges::range_size_t< urng_t > size_type
The size_type.
Definition: translate.hpp:184
The return type of seqan3::views::translate.
Definition: translate.hpp:535
const_reference operator[](size_type const n) const
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition: translate.hpp:726
translation_frames tf
The frames that should be used for translation.
Definition: translate.hpp:540
view_translate() noexcept=default
Defaulted.
std::ranges::range_difference_t< urng_t > difference_type
A signed integer type, usually std::ptrdiff_t.
Definition: translate.hpp:557
const_iterator begin() const noexcept
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition: translate.hpp:650
reference operator[](size_type const n)
Return the n-th element.
Definition: translate.hpp:719
small_vector< translation_frames, 6 > selected_frames
The selected frames corresponding to the frames required.
Definition: translate.hpp:542
size_type size() noexcept
Returns the number of elements in the view.
Definition: translate.hpp:690
view_translate_single< urng_t > reference
The reference_type.
Definition: translate.hpp:549
view_translate(rng_t &&_urange, translation_frames const _tf=translation_frames::SIX_FRAME)
Construct from another range.
Definition: translate.hpp:623
iterator begin() noexcept
Returns an iterator to the first element of the container.
Definition: translate.hpp:644
std::ranges::range_size_t< urng_t > size_type
The size_type.
Definition: translate.hpp:555
iterator end() noexcept
Returns an iterator to the element following the last element of the container.
Definition: translate.hpp:668
urng_t urange
The data members of view_translate_single.
Definition: translate.hpp:538
const_iterator end() const noexcept
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition: translate.hpp:674
size_type size() const noexcept
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition: translate.hpp:696
Implements a small string that can be used for compile time computations.
Definition: small_string.hpp:43
constexpr char const * c_str() const noexcept
Returns the content represented as 0-terminated c-style string.
Definition: small_string.hpp:320
constexpr void push_back(value_type const value) noexcept
Appends the given element value to the end of the container.
Definition: small_vector.hpp:756
constexpr size_type size() const noexcept
Returns the number of elements in the container, i.e. std::distance(begin(), end()).
Definition: small_vector.hpp:511
A wrapper type around an existing view adaptor that enables "deep view" behaviour for that view.
Definition: deep.hpp:102
Provides various transformation traits used by the range module.
Provides seqan3::views::deep.
Provides seqan3::dna5, container aliases and string literals.
constexpr aa27 translate_triplet(nucl_type const &n1, nucl_type const &n2, nucl_type const &n3) noexcept
Translate one nucleotide triplet into single amino acid (single nucleotide interface).
Definition: translation.hpp:55
constexpr auto complement
Return the complement of a nucleotide object.
Definition: concept.hpp:95
@ single
The text is a single range.
Definition: concept.hpp:84
constexpr size_t size
The size of a type pack.
Definition: traits.hpp:150
constexpr auto translate
A view that translates nucleotide into aminoacid alphabet with 1, 2, 3 or 6 frames.
Definition: translate.hpp:798
constexpr auto translate_single
A view that translates nucleotide into aminoacid alphabet for one of the six frames.
Definition: translate.hpp:509
auto const move
A view that turns lvalue-references into rvalue-references.
Definition: move.hpp:70
A concept that indicates whether an alphabet represents nucleotides.
The internal SeqAn3 namespace.
Definition: aligned_sequence_concept.hpp:29
view_translate(urng_t &&, translation_frames const =translation_frames{}) -> view_translate< std::views::all_t< urng_t >>
Class template argument deduction for view_translate.
view_translate_single(urng_t &&, translation_frames const) -> view_translate_single< std::views::all_t< urng_t >>
Class template argument deduction for view_translate_single.
The SeqAn namespace for views.
The main SeqAn3 namespace.
Definition: aligned_sequence_concept.hpp:29
constexpr bool add_enum_bitwise_operators< translation_frames >
Enable bitwise operators for enum translation_frames.
Definition: translate.hpp:86
translation_frames
Specialisation values for single and multiple translation frames.
Definition: translate.hpp:67
@ FWD_REV_0
The first forward and first reverse frame.
@ REV_FRAME_0
The first reverse frame starting at position 0.
@ REV_FRAME_1
The second reverse frame starting at position 1.
@ FWD_REV_2
The first third and third reverse frame.
@ FWD_FRAME_2
The third forward frame starting at position 2.
@ FWD_FRAME_1
The second forward frame starting at position 1.
@ REV_FRAME_2
The third reverse frame starting at position 2.
@ FWD_FRAME_0
The first forward frame starting at position 0.
@ FWD_REV_1
The second forward and second reverse frame.
SeqAn specific customisations in the standard namespace.
Provides the seqan3::detail::random_access_iterator class.
Adaptations of concepts from the standard library.
Auxiliary header for the views submodule .
Adaptations of concepts from the Ranges TS.
A constexpr string implementation to manipulate string literals at compile time.
Definition of the range adaptor object type for seqan3::views::translate and seqan3::views::translate...
Definition: translate.hpp:103
constexpr auto operator()(translation_frames const tf=default_frames) const
Store the argument and return a range adaptor closure object.
Definition: translate.hpp:110
constexpr auto operator()(urng_t &&urange, translation_frames const tf=default_frames) const
Directly return an instance of the view, initialised with the given parameters.
Definition: translate.hpp:121
static constexpr translation_frames default_frames
The default frames parameter for the translation view adaptors.
Definition: translate.hpp:105
constexpr friend auto operator|(urng_t &&urange, translate_fn const &me)
This adaptor is usable without setting the frames parameter in which case the default is chosen.
Definition: translate.hpp:140
Provides functions for translating a triplet of nucleotides into an amino acid.