Skip to content

Commit

Permalink
[MISC] Lower case seqan3::detail::translation_table::value.
Browse files Browse the repository at this point in the history
  • Loading branch information
simonsasse committed May 4, 2021
1 parent 0b25413 commit 805cbe8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions include/seqan3/alphabet/aminoacid/translation.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ constexpr aa27 translate_triplet(nucl_type const & n1, nucl_type const & n2, nuc
if constexpr (std::same_as<nucl_type, dna4> || std::same_as<nucl_type, dna5> || std::same_as<nucl_type, dna15>)
{
// table exists for dna15 and is generated for dna4 and dna5 (compile time ok, because small)
return seqan3::detail::translation_table<nucl_type, gc>::VALUE[to_rank(n1)][to_rank(n2)][to_rank(n3)];
return seqan3::detail::translation_table<nucl_type, gc>::value[to_rank(n1)][to_rank(n2)][to_rank(n3)];
}
else if constexpr (std::same_as<nucl_type, rna4> || std::same_as<nucl_type, rna5> || std::same_as<nucl_type, rna15>)
{
Expand All @@ -66,13 +66,13 @@ constexpr aa27 translate_triplet(nucl_type const & n1, nucl_type const & n2, nuc
std::conditional_t<std::same_as<nucl_type, rna15>, dna15, void>>>;

// we can use dna's tables, because ranks are identical
return seqan3::detail::translation_table<rna2dna_t, gc>::VALUE[to_rank(n1)][to_rank(n2)][to_rank(n3)];
return seqan3::detail::translation_table<rna2dna_t, gc>::value[to_rank(n1)][to_rank(n2)][to_rank(n3)];
}
else // composites or user defined nucleotide
{
// we cast to dna15; slightly slower run-time, but lot's of compile time saved for large alphabets.
// (nucleotide types can be converted to dna15 by definition)
return seqan3::detail::translation_table<dna15, gc>::VALUE[to_rank(static_cast<dna15>(n1))]
return seqan3::detail::translation_table<dna15, gc>::value[to_rank(static_cast<dna15>(n1))]
[to_rank(static_cast<dna15>(n2))]
[to_rank(static_cast<dna15>(n3))];
}
Expand Down
4 changes: 2 additions & 2 deletions include/seqan3/alphabet/aminoacid/translation_details.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ struct translation_table
{
//!\brief Holds the generic translation table.
static constexpr std::array<std::array<std::array<aa27, alphabet_size<nucl_type>>, alphabet_size<nucl_type>>,
alphabet_size<nucl_type>> VALUE
alphabet_size<nucl_type>> value
{
[] () constexpr
{
Expand All @@ -46,7 +46,7 @@ struct translation_table
for (size_t k = 0; k < alphabet_size<nucl_type>; ++k)
{
dna15 n3(assign_rank_to(k, nucl_type{}));
table[i][j][k] = translation_table<dna15, gc, void_type>::VALUE[to_rank(n1)][to_rank(n2)][to_rank(n3)];
table[i][j][k] = translation_table<dna15, gc, void_type>::value[to_rank(n1)][to_rank(n2)][to_rank(n3)];
}
}
}
Expand Down

0 comments on commit 805cbe8

Please sign in to comment.