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> &&
104 template <
bool single>
123 template <std::ranges::range urng_t>
126 static_assert(std::ranges::viewable_range<urng_t>,
127 "The range parameter to views::translate[_single] cannot be a temporary of a non-view range.");
128 static_assert(std::ranges::sized_range<urng_t>,
129 "The range parameter to views::translate[_single] must model std::ranges::sized_range.");
130 static_assert(std::ranges::random_access_range<urng_t>,
131 "The range parameter to views::translate[_single] must model std::ranges::random_access_range.");
133 "The range parameter to views::translate[_single] must be over elements of seqan3::nucleotide_alphabet.");
142 template <std::ranges::range urng_t>
145 return me(std::forward<urng_t>(urange));
159 template <std::ranges::view urng_t>
161 requires std::ranges::sized_range<urng_t> &&
162 std::ranges::random_access_range<urng_t> &&
174 "REV_FRAME_0, FWD_FRAME_1, REV_FRAME_1, FWD_FRAME_2 and "
218 if (__builtin_popcount(
static_cast<uint8_t
>(_tf)) > 1)
232 template <
typename rng_t>
235 std::ranges::viewable_range<rng_t> &&
236 std::constructible_from<urng_t, std::ranges::ref_view<std::remove_reference_t<rng_t>>>
285 return {*
this,
size()};
291 return {*
this,
size()};
449 template <
typename urng_t>
454 template <
typename urng_t>
533 template <std::ranges::view urng_t>
535 requires std::ranges::sized_range<urng_t> &&
536 std::ranges::random_access_range<urng_t> &&
577 template <
typename t>
578 requires (range_dimension_v<t> == range_dimension_v<value_type> + 1) &&
579 std::is_same_v<std::remove_cvref_t<range_innermost_value_t<value_type>>,
581 static constexpr
bool is_compatible_this_aux =
true;
622 template <
typename rng_t>
625 std::ranges::viewable_range<rng_t> &&
626 std::constructible_from<urng_t, std::ranges::ref_view<std::remove_reference_t<rng_t>>>
633 #ifdef SEQAN3_DEPRECATED_310
634 template <
typename rng_t>
637 std::ranges::viewable_range<rng_t> &&
638 std::constructible_from<urng_t, std::ranges::ref_view<std::remove_reference_t<rng_t>>>
688 return {*
this,
size()};
694 return {*
this,
size()};
755 #ifdef SEQAN3_DEPRECATED_310
756 template <
typename urng_t>
758 requires std::ranges::sized_range<urng_t> &&
759 std::ranges::random_access_range<urng_t> &&
766 template <
typename urng_t>
768 requires std::ranges::sized_range<urng_t> &&
769 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:166
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:411
size_type size() const
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition: translate.hpp:332
reference operator[](size_type const n)
Return the n-th element.
Definition: translate.hpp:375
size_type size()
Returns the number of elements in the view.
Definition: translate.hpp:306
translation_frames tf
The frame that should be used for translation.
Definition: translate.hpp:171
iterator end() noexcept
Returns an iterator to the element following the last element of the container.
Definition: translate.hpp:283
std::ranges::range_difference_t< urng_t > difference_type
A signed integer type, usually std::ptrdiff_t.
Definition: translate.hpp:189
view_translate_single(rng_t &&_urange, translation_frames const _tf=translation_frames::FWD_FRAME_0)
Construct from another range.
Definition: translate.hpp:238
static constexpr small_string multiple_frame_error
Error thrown if tried to be used with multiple frames.
Definition: translate.hpp:173
view_translate_single() noexcept=default
Defaulted.
iterator begin() noexcept
Returns an iterator to the first element of the container.
Definition: translate.hpp:259
urng_t urange
The input range (of ranges).
Definition: translate.hpp:169
const_iterator end() const noexcept
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition: translate.hpp:289
const_iterator begin() const noexcept
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition: translate.hpp:265
std::ranges::range_size_t< urng_t > size_type
The size_type.
Definition: translate.hpp:187
The return type of seqan3::views::translate.
Definition: translate.hpp:540
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:744
translation_frames tf
The frames that should be used for translation.
Definition: translate.hpp:545
view_translate(rng_t &&_urange)
Definition: translate.hpp:640
view_translate(rng_t &&_urange, translation_frames const _tf)
Construct from another range.
Definition: translate.hpp:628
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:562
const_iterator begin() const noexcept
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition: translate.hpp:668
reference operator[](size_type const n)
Return the n-th element.
Definition: translate.hpp:737
small_vector< translation_frames, 6 > selected_frames
The selected frames corresponding to the frames required.
Definition: translate.hpp:547
size_type size() noexcept
Returns the number of elements in the view.
Definition: translate.hpp:708
view_translate_single< urng_t > reference
The reference_type.
Definition: translate.hpp:554
iterator begin() noexcept
Returns an iterator to the first element of the container.
Definition: translate.hpp:662
std::ranges::range_size_t< urng_t > size_type
The size_type.
Definition: translate.hpp:560
iterator end() noexcept
Returns an iterator to the element following the last element of the container.
Definition: translate.hpp:686
urng_t urange
The data members of view_translate_single.
Definition: translate.hpp:543
const_iterator end() const noexcept
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition: translate.hpp:692
size_type size() const noexcept
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition: translate.hpp:714
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:103
Provides various transformation traits used by the range module.
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
@ 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:834
constexpr auto translate_single
A view that translates nucleotide into aminoacid alphabet for one of the six frames.
Definition: translate.hpp:514
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 &&) -> view_translate< std::views::all_t< urng_t >>
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.
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:89
translation_frames
Specialisation values for single and multiple translation frames.
Definition: translate.hpp:70
@ 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:106
constexpr auto operator()(translation_frames const tf=default_frames) const
Store the argument and return a range adaptor closure object.
Definition: translate.hpp:113
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:124
static constexpr translation_frames default_frames
The default frames parameter for the translation view adaptors.
Definition: translate.hpp:108
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:143
Provides functions for translating a triplet of nucleotides into an amino acid.
Provides seqan3::views::deep.