36 template <std::ranges::view urng_t>
38 requires std::ranges::sized_range<urng_t> &&
39 std::ranges::random_access_range<urng_t> &&
44 template <std::ranges::view urng_t>
46 requires std::ranges::sized_range<urng_t> &&
47 std::ranges::random_access_range<urng_t> &&
102 template <
bool single>
121 template <std::ranges::range urng_t>
124 static_assert(std::ranges::viewable_range<urng_t>,
125 "The range parameter to views::translate[_single] cannot be a temporary of a non-view range.");
126 static_assert(std::ranges::sized_range<urng_t>,
127 "The range parameter to views::translate[_single] must model std::ranges::sized_range.");
128 static_assert(std::ranges::random_access_range<urng_t>,
129 "The range parameter to views::translate[_single] must model std::ranges::random_access_range.");
131 "The range parameter to views::translate[_single] must be over elements of seqan3::nucleotide_alphabet.");
140 template <std::ranges::range urng_t>
143 return me(std::forward<urng_t>(urange));
157 template <std::ranges::view urng_t>
159 requires std::ranges::sized_range<urng_t> &&
160 std::ranges::random_access_range<urng_t> &&
172 "forward_frame0, reverse_frame0, forward_frame1, "
173 "reverse_frame1, forward_frame2 and reverse_frame2."};
214 :
urange{std::move(_urange)},
tf{_tf}
216 if (__builtin_popcount(
static_cast<uint8_t
>(_tf)) > 1)
230 template <
typename rng_t>
233 std::ranges::viewable_range<rng_t> &&
234 std::constructible_from<urng_t, std::ranges::ref_view<std::remove_reference_t<rng_t>>>
283 return {*
this,
size()};
289 return {*
this,
size()};
459 template <
typename urng_t>
464 template <
typename urng_t>
543 template <std::ranges::view urng_t>
545 requires std::ranges::sized_range<urng_t> &&
546 std::ranges::random_access_range<urng_t> &&
587 template <
typename t>
588 requires (range_dimension_v<t> == range_dimension_v<value_type> + 1) &&
589 std::is_same_v<std::remove_cvref_t<range_innermost_value_t<value_type>>,
591 static constexpr
bool is_compatible_this_aux =
true;
612 :
urange{std::move(_urange)},
tf{_tf}
632 template <
typename rng_t>
635 std::ranges::viewable_range<rng_t> &&
636 std::constructible_from<urng_t, std::ranges::ref_view<std::remove_reference_t<rng_t>>>
685 return {*
this,
size()};
691 return {*
this,
size()};
750 template <
typename urng_t>
752 requires std::ranges::sized_range<urng_t> &&
753 std::ranges::random_access_range<urng_t> &&
Provides seqan3::aa27, container aliases and string literals.
Provides seqan3::detail::adaptor_from_functor.
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: adaptor_from_functor.hpp:57
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:164
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:415
size_type size() const
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition: translate.hpp:330
reference operator[](size_type const n)
Return the n-th element.
Definition: translate.hpp:373
view_translate_single(rng_t &&_urange, translation_frames const _tf=translation_frames::forward_frame0)
Construct from another range.
Definition: translate.hpp:236
size_type size()
Returns the number of elements in the view.
Definition: translate.hpp:304
translation_frames tf
The frame that should be used for translation.
Definition: translate.hpp:169
iterator end() noexcept
Returns an iterator to the element following the last element of the container.
Definition: translate.hpp:281
std::ranges::range_difference_t< urng_t > difference_type
A signed integer type, usually std::ptrdiff_t.
Definition: translate.hpp:187
static constexpr small_string multiple_frame_error
Error thrown if tried to be used with multiple frames.
Definition: translate.hpp:171
view_translate_single() noexcept=default
Defaulted.
iterator begin() noexcept
Returns an iterator to the first element of the container.
Definition: translate.hpp:257
urng_t urange
The input range (of ranges).
Definition: translate.hpp:167
const_iterator end() const noexcept
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition: translate.hpp:287
const_iterator begin() const noexcept
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition: translate.hpp:263
std::ranges::range_size_t< urng_t > size_type
The size_type.
Definition: translate.hpp:185
The return type of seqan3::views::translate.
Definition: translate.hpp:550
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:741
translation_frames tf
The frames that should be used for translation.
Definition: translate.hpp:555
view_translate(rng_t &&_urange, translation_frames const _tf)
Construct from another range.
Definition: translate.hpp:638
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:572
const_iterator begin() const noexcept
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition: translate.hpp:665
reference operator[](size_type const n)
Return the n-th element.
Definition: translate.hpp:734
small_vector< translation_frames, 6 > selected_frames
The selected frames corresponding to the frames required.
Definition: translate.hpp:557
size_type size() noexcept
Returns the number of elements in the view.
Definition: translate.hpp:705
view_translate_single< urng_t > reference
The reference_type.
Definition: translate.hpp:564
iterator begin() noexcept
Returns an iterator to the first element of the container.
Definition: translate.hpp:659
std::ranges::range_size_t< urng_t > size_type
The size_type.
Definition: translate.hpp:570
iterator end() noexcept
Returns an iterator to the element following the last element of the container.
Definition: translate.hpp:683
urng_t urange
The data members of view_translate_single.
Definition: translate.hpp:553
const_iterator end() const noexcept
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition: translate.hpp:689
size_type size() const noexcept
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition: translate.hpp:711
Implements a small string that can be used for compile time computations.
Definition: small_string.hpp:44
constexpr char const * c_str() const noexcept
Returns the content represented as 0-terminated c-style string.
Definition: small_string.hpp:345
constexpr void push_back(value_type const value) noexcept
Appends the given element value to the end of the container.
Definition: small_vector.hpp:861
constexpr size_type size() const noexcept
Returns the number of elements in the container, i.e. std::distance(begin(), end()).
Definition: small_vector.hpp:590
A wrapper type around an existing view adaptor that enables "deep view" behaviour for that view.
Definition: deep.hpp:104
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:104
constexpr auto translate
A view that translates nucleotide into aminoacid alphabet with 1, 2, 3 or 6 frames.
Definition: translate.hpp:813
constexpr auto translate_single
A view that translates nucleotide into aminoacid alphabet for one of the six frames.
Definition: translate.hpp:524
@ single
The text is a single range.
Definition: concept.hpp:74
constexpr size_t size
The size of a type pack.
Definition: traits.hpp:151
A concept that indicates whether an alphabet represents nucleotides.
The internal SeqAn3 namespace.
Definition: aligned_sequence_concept.hpp:29
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.
view_translate(urng_t &&, translation_frames const) -> view_translate< std::views::all_t< urng_t >>
Class template argument deduction for view_translate.
The SeqAn namespace for views.
Definition: char_to.hpp:22
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:87
translation_frames
Specialisation values for single and multiple translation frames.
Definition: translate.hpp:68
@ forward_frame2
The third forward frame starting at position 2.
@ forward_frame0
The first forward frame starting at position 0.
@ reverse_frames
All reverse frames.
@ forward_frames
All forward frames.
@ reverse_frame0
The first reverse frame starting at position 0.
@ forward_reverse2
The first third and third reverse frame.
@ reverse_frame2
The third reverse frame starting at position 2.
@ forward_frame1
The second forward frame starting at position 1.
@ reverse_frame1
The second reverse frame starting at position 1.
@ forward_reverse0
The first forward and first reverse frame.
@ forward_reverse1
The second forward and second reverse frame.
SeqAn specific customisations in the standard namespace.
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:104
constexpr auto operator()(translation_frames const tf=default_frames) const
Store the argument and return a range adaptor closure object.
Definition: translate.hpp:111
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:122
static constexpr translation_frames default_frames
The default frames parameter for the translation view adaptors.
Definition: translate.hpp:106
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:141
Provides functions for translating a triplet of nucleotides into an amino acid.