Skip to content

Commit

Permalink
Merge pull request #2523 from MitraDarja/search_views
Browse files Browse the repository at this point in the history
Move minimiser_view to search/views
  • Loading branch information
marehr committed Apr 20, 2021
2 parents d1d3a41 + 9b192b7 commit e9e55b3
Show file tree
Hide file tree
Showing 30 changed files with 1,627 additions and 1,566 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ assignment!
Task: Obtain the minimisers for "CCACGTCGACGGTT" with an ungapped shape of size 4 and a window size of 8.
\endassignment
\solution
\include doc/tutorial/ranges/views/minimiser/minimiser_solution1.cpp
\include doc/tutorial/search/views/minimiser/minimiser_solution1.cpp
\endsolution

If you have completed the assignment, you probably wonder what these large numbers mean. As explained above, the
Expand All @@ -71,7 +71,7 @@ XORs the hash values with a random seed (Default: 0x8F3F73B5CF1C9ADE). How would
then?
Well, you just use XOR again!

\include doc/tutorial/ranges/views/minimiser/seed_example.cpp
\include doc/tutorial/search/views/minimiser/seed_example.cpp

From these hash values, you can obtain the sequence they are representing by transforming the numbers to base 4. (For
example, 182 is "2312" in base four and therefore represents "GTCG".)
Expand Down Expand Up @@ -102,7 +102,7 @@ same hash value.

\endassignment
\solution
\include doc/tutorial/ranges/views/minimiser/minimiser_solution2.cpp
\include doc/tutorial/search/views/minimiser/minimiser_solution2.cpp
\endsolution

### Ignoring the backward strand
Expand All @@ -112,7 +112,7 @@ the backward strand should not be considered. If this is the desired behaviour t
to be used. Unlike the `seqan3::views::minimiser_hash`, `seqan3::views::minimiser` does not hash the values for you, so
you have to do this yourself. But fear not, `seqan3::views::kmer_hash` makes this really easy for you!

\snippet doc/tutorial/ranges/views/minimiser/minimiser_snippets.cpp minimiser
\snippet doc/tutorial/search/views/minimiser/minimiser_snippets.cpp minimiser


This syntax will result in minimisers with k-mer size 4 and a window-length of 8 (5 + 4 - 1). (So, to determine the
Expand Down Expand Up @@ -144,11 +144,11 @@ In order to ensure that this is the desired behaviour, using `seqan3::views::min
Last but not least, `seqan3::views::kmer_hash` and `seqan3::views::minimiser` do not have a seed parameter. So, in order
to obtain a random ordering, you have to XOR the view yourself. This can be done with the following command:
\snippet doc/tutorial/ranges/views/minimiser/minimiser_snippets.cpp minimiser_seed
\snippet doc/tutorial/search/views/minimiser/minimiser_snippets.cpp minimiser_seed
\assignment{Assignment 3: Fun with minimisers III}
Task: Repeat assignment 2 but this time do not consider the backward strand.
\endassignment
\solution
\include doc/tutorial/ranges/views/minimiser/minimiser_solution3.cpp
\include doc/tutorial/search/views/minimiser/minimiser_solution3.cpp
\endsolution
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
#include <iostream>
#include <vector>
#include <seqan3/std/ranges> // include all of the standard library's views
#include <vector>

#include <seqan3/alphabet/nucleotide/dna4.hpp>
#include <seqan3/range/views/kmer_hash.hpp>
#include <seqan3/range/views/minimiser.hpp>
#include <seqan3/search/views/kmer_hash.hpp>
#include <seqan3/search/views/minimiser.hpp>

using seqan3::operator""_dna4;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include <seqan3/alphabet/nucleotide/dna4.hpp>
#include <seqan3/core/debug_stream.hpp>
#include <seqan3/range/views/minimiser_hash.hpp>
#include <seqan3/search/views/minimiser_hash.hpp>

using seqan3::operator""_dna4;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include <seqan3/alphabet/nucleotide/dna4.hpp>
#include <seqan3/core/debug_stream.hpp>
#include <seqan3/range/views/minimiser_hash.hpp>
#include <seqan3/search/views/minimiser_hash.hpp>

using seqan3::operator""_dna4;
using seqan3::operator""_shape;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include <seqan3/alphabet/nucleotide/dna4.hpp>
#include <seqan3/core/debug_stream.hpp>
#include <seqan3/range/views/kmer_hash.hpp>
#include <seqan3/range/views/minimiser.hpp>
#include <seqan3/search/views/kmer_hash.hpp>
#include <seqan3/search/views/minimiser.hpp>

using seqan3::operator""_dna4;
using seqan3::operator""_shape;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include <seqan3/alphabet/nucleotide/dna4.hpp>
#include <seqan3/core/debug_stream.hpp>
#include <seqan3/range/views/minimiser_hash.hpp>
#include <seqan3/search/views/minimiser_hash.hpp>

using seqan3::operator""_dna4;

Expand Down
4 changes: 2 additions & 2 deletions include/seqan3/range/views/detail.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -352,9 +352,9 @@ class adaptor_for_view_without_args : public adaptor_base<adaptor_for_view_witho
*
* # Example
*
* From include/seqan3/range/views/kmer_hash.hpp:
* From include/seqan3/search/views/kmer_hash.hpp:
*
* \snippet include/seqan3/range/views/kmer_hash.hpp adaptor_def
* \snippet include/seqan3/search/views/kmer_hash.hpp adaptor_def
*
* This is the full proto-adaptor, first look at the second member function: it handles range and argument input and
* delegates to the view's constructor. In other, simpler cases you could invoke other adaptors here.
Expand Down
Loading

1 comment on commit e9e55b3

@vercel
Copy link

@vercel vercel bot commented on e9e55b3 Apr 20, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.