Example Program
Index Finder
File "index_find.cpp"
A tutorial about find algorithms using an index.
1 | |
2 | |
3 | |
4 | |
5 | |
6 | |
7 |
The following code creates an Index of "tobeornottobe" .
As there is no second template parameter given to Index<..> ,
the default index based on an enhanced suffix array is used.
8 | |
9 | |
10 | |
11 | |
12 | |
13 | |
14 | |
15 |
Now we explicitly create a q-gram index using an ungapped 2-gram and do the same.
Instead of this fixed-size shape you can use arbitrary
shapes and assign them before calling find via indexShape.
16 | |
17 | |
18 | |
19 | |
20 | |
21 | |
22 | |
23 | |
24 | |
25 | |
26 |
Output
weese@tanne:~/seqan/demos$ make index_find
weese@tanne:~/seqan/demos$ ./index_find
hit at 11 2
hit at 2 11
weese@tanne:~/seqan/demos$
SeqAn - Sequence Analysis Library - www.seqan.de