File: test_index_swift.cpp

package info (click to toggle)
seqan2 2.4.0+dfsg-11~bpo9+1
  • links: PTS, VCS
  • area: main
  • in suites: stretch-backports
  • size: 223,500 kB
  • sloc: cpp: 256,886; ansic: 91,672; python: 8,339; sh: 995; xml: 570; makefile: 251; awk: 51
file content (36 lines) | stat: -rw-r--r-- 1,109 bytes parent folder | download | duplicates (8)
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
31
32
33
34
35
36
#include <seqan/basic.h>
#include <seqan/index.h>
#include <seqan/sequence.h>

// Test SWIFT finder with empty pattern.
SEQAN_DEFINE_TEST(test_index_swift_find_empty_pattern)
{
    using namespace seqan;

    typedef Finder<Dna5String, Swift<SwiftSemiGlobal> > TSwiftFinder;

    typedef Dna5String TReadSeq_;
    typedef StringSet<TReadSeq_> TReadSet;
    typedef typename Value<TReadSet>::Type TReadSeq;
    typedef typename Value<TReadSeq>::Type TAlphabet;
    typedef Shape<TAlphabet, UngappedShape<10> > TShape;
    typedef Index<TReadSet, IndexQGram<TShape, OpenAddressing> > TQGramIndex;
    typedef Pattern<TQGramIndex, Swift<SwiftSemiGlobal> > TSwiftPattern;

    Dna5String contigSeq = "CGATCGATCGATCGATCGATCGATCGATCGATCGATCGATCGATCGATCGATCGATCGATCGATCGAT";

    StringSet<Dna5String> readSeqs;

    TQGramIndex index(readSeqs);
    TSwiftPattern swiftPattern(index);

    TSwiftFinder swiftFinder(contigSeq);
    while (find(swiftFinder, swiftPattern, 0.1))
        continue;
}

SEQAN_BEGIN_TESTSUITE(test_index_swift)
{
	SEQAN_CALL_TEST(test_index_swift_find_empty_pattern);
}
SEQAN_END_TESTSUITE