82 template <genetic_code gc = genetic_code::CANONICAL, nucleot
ide_concept nucl_type>
88 return seqan3::detail::translation_table<nucl_type, gc>::VALUE[
to_rank(n1)][
to_rank(n2)][
to_rank(n3)];
92 using rna2dna_t = std::conditional_t<std::Same<nucl_type, rna4>,
dna4,
93 std::conditional_t<std::Same<nucl_type, rna5>,
dna5,
94 std::conditional_t<std::Same<nucl_type, rna15>,
dna15,
void>>>;
97 return seqan3::detail::translation_table<rna2dna_t, gc>::VALUE[
to_rank(n1)][
to_rank(n2)][
to_rank(n3)];
103 return seqan3::detail::translation_table<dna15, gc>::VALUE[
to_rank(static_cast<dna15>(n1))]
104 [
to_rank(static_cast<dna15>(n2))]
105 [
to_rank(static_cast<dna15>(n3))];
125 template <genetic_code gc = genetic_code::CANONICAL,
typename tuple_type>
127 requires std::tuple_size<tuple_type>::value == 3 &&
134 return translate_triplet(std::get<0>(input_tuple), std::get<1>(input_tuple), std::get<2>(input_tuple));
153 template <genetic_code gc = genetic_code::CANONICAL, std::ranges::InputRange range_type>
159 auto n1 =
begin(input_range);
163 assert(n1 !=
end(input_range));
164 assert(n2 !=
end(input_range));
165 assert(n3 !=
end(input_range));
187 template <genetic_code gc = genetic_code::CANONICAL, std::ranges::RandomAccessRange range_type>
193 assert(input_range.begin() !=
end(input_range));
194 assert(input_range.begin() + 1 !=
end(input_range));
195 assert(input_range.begin() + 2 !=
end(input_range));
Contains translation details for nucleotide to aminoacid translation.
The four letter DNA alphabet of A,C,G,T.
Definition: dna4.hpp:73
Contains various shortcuts for common std::ranges functions.
Contains seqan3::aa27, container aliases and string literals.
The 15 letter DNA alphabet, containing all IUPAC smybols minus the gap.
Definition: dna15.hpp:73
The main SeqAn3 namespace.
Definition: aligned_sequence_concept.hpp:58
Genetic codes used for translating a triplet of nucleotides into an amino acid.
The twenty-seven letter amino acid alphabet.
Definition: aa27.hpp:67
The five letter DNA alphabet of A,C,G,T and the unknown character N.
Definition: dna5.hpp:73
Provides seqan3::nucleotide_concept.
Adaptations of concepts from the Ranges TS.
::ranges::begin begin
Alias for ranges::begin. Returns an iterator to the beginning of a range.
Definition: ranges:185
The concept std::Same<T, U> is satisfied if and only if T and U denote the same type.
Provides various metafunctions used by the range module.
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:83
::ranges::end end
Alias for ranges::end. Returns an iterator to the end of a range.
Definition: ranges:190
constexpr underlying_rank_t< alphabet_type > to_rank(alphabet_type const alph) requires requires(alphabet_type alph)
Implementation of seqan3::semi_alphabet_concept::to_rank() that delegates to a member function...
Definition: member_exposure.hpp:97
A concept that indicates whether an alphabet represents nucleotides.In addition to the requirements f...