Skip to content

Commit

Permalink
[DOC] clarification how shapes are applied in kmer-hash
Browse files Browse the repository at this point in the history
  • Loading branch information
SGSSGene committed May 16, 2022
1 parent a17f415 commit 705a777
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
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.
*
* ### 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.
{
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]
}
}

0 comments on commit 705a777

Please sign in to comment.