Skip to content

Commit

Permalink
[DOC] Refactor phred snippets. The int cast is not needed.
Browse files Browse the repository at this point in the history
Signed-off-by: Lydia Buntrock <[email protected]>
  • Loading branch information
Irallia committed Dec 9, 2020
1 parent c812a00 commit 951398c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
5 changes: 2 additions & 3 deletions test/snippet/alphabet/quality/phred42.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,11 @@ int main()
{
seqan3::phred42 phred;
phred.assign_rank(2); // wrapper for assign_phred(2)
seqan3::debug_stream << (int) phred.to_phred() << "\n"; // 2
seqan3::debug_stream << phred.to_phred() << "\n"; // 2
seqan3::debug_stream << phred.to_char() << "\n"; // '#'
seqan3::debug_stream << (int) phred.to_rank() << "\n"; // 2
seqan3::debug_stream << phred.to_rank() << "\n"; // 2

seqan3::phred42 another_phred;
another_phred.assign_phred(49); // converted down to 41
seqan3::debug_stream << another_phred.to_phred() << "\n"; // 41
// we need to cast to(int)for human readable console output
}
5 changes: 2 additions & 3 deletions test/snippet/alphabet/quality/phred63.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,12 @@ int main()
{
seqan3::phred63 phred;
phred.assign_rank(2); // wrapper for assign_phred(2)
seqan3::debug_stream << static_cast<int>(phred.to_phred()) << "\n"; // 2
seqan3::debug_stream << phred.to_phred() << "\n"; // 2
seqan3::debug_stream << phred.to_char() << "\n"; // '#'
seqan3::debug_stream << static_cast<int>(phred.to_rank()) << "\n"; // 2
seqan3::debug_stream << phred.to_rank() << "\n"; // 2

seqan3::phred63 another_phred{49};
seqan3::debug_stream << another_phred.to_phred() << "\n"; // 49
// we need to cast to (int) for human readable console output

seqan3::phred63 a_third_phred;
another_phred.assign_phred(75); // converted down to 62
Expand Down

0 comments on commit 951398c

Please sign in to comment.