File: minimiser_snippets.cpp

package info (click to toggle)
seqan3 3.0.2%2Bds-9
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 16,052 kB
  • sloc: cpp: 144,641; makefile: 1,288; ansic: 294; sh: 228; xml: 217; javascript: 50; python: 27; php: 25
file content (30 lines) | stat: -rw-r--r-- 852 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#include <iostream>
#include <vector>
#include <seqan3/std/ranges> // include all of the standard library's views
#include <seqan3/alphabet/nucleotide/dna4.hpp>
#include <seqan3/range/views/kmer_hash.hpp>
#include <seqan3/range/views/minimiser.hpp>

using seqan3::operator""_dna4;

int main()
{
std::vector<seqan3::dna4> text{"CCACGTCGACGGTT"_dna4};
{
//![minimiser]
//![def]
auto minimisers = text | seqan3::views::kmer_hash(seqan3::ungapped{4}) | seqan3::views::minimiser(5);
//![minimiser]
}

{
//![minimiser_seed]
//![def]
uint64_t const seed = 0x8F3F73B5CF1C9ADE;
auto minimisers = text | seqan3::views::kmer_hash(seqan3::ungapped{4})
                       | std::views::transform([seed] (uint64_t i)
                                               {return i ^ seed;})
                       | seqan3::views::minimiser(5);
//![minimiser_seed]
}
}