Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DOC] clarification how shapes are applied in kmer-hash #2981

Merged
merged 3 commits into from
May 17, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions include/seqan3/search/views/kmer_hash.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -774,6 +774,9 @@ namespace seqan3::views
*
* See the \link views views submodule documentation \endlink for detailed descriptions of the view properties.
*
* \attention The Shape is defined is from right to left. The mask 0b1101 applied to ACGT will return
* the sequence AGT.
eseiler marked this conversation as resolved.
Show resolved Hide resolved
*
* ### Example
*
* \include test/snippet/search/views/kmer_hash.cpp
Expand Down
9 changes: 9 additions & 0 deletions test/snippet/search/views/kmer_hash.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,13 @@ int main()
seqan3::debug_stream << (text | seqan3::views::kmer_hash(seqan3::ungapped{3})) << '\n'; // [6,27,44,50,9]

seqan3::debug_stream << (text | seqan3::views::kmer_hash(0b101_shape)) << '\n'; // [2,7,8,14,1]

// Note: the Shape is defined is from right to left. The mask 0b1101 applied to ACGT will give
// the same result as mask 0b111 applied to AGT.
eseiler marked this conversation as resolved.
Show resolved Hide resolved
{
auto text1 = "ACGT"_dna4;
auto text2 = "AGT"_dna4;
seqan3::debug_stream << (text1 | seqan3::views::kmer_hash(0b1101_shape)) << '\n'; // [11]
seqan3::debug_stream << (text2 | seqan3::views::kmer_hash(0b111_shape)) << '\n'; // [11]
}
}
2 changes: 2 additions & 0 deletions test/snippet/search/views/kmer_hash.err
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
[6,27,44,50,9]
[6,27,44,50,9]
[2,7,8,14,1]
[11]
[11]