MCPcopy Create free account
hub / github.com/BirolLab/abyss / TEST

Function TEST

Unittest/PairedDBG/LoadAlgorithmTest.cpp:12–53  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

10using namespace std;
11
12TEST(LoadAlgorithmTest, base)
13{
14 typedef SequenceCollectionHash Graph;
15 Graph g;
16
17 // length of each kmer in kmer pair
18 Kmer::setLength(2);
19 // space between kmer pair
20 unsigned delta = 2;
21 // the length of both kmers plus the gap
22 KmerPair::setLength(Kmer::length() * 2 + delta);
23
24 // see test.png for an image of the paired
25 // de Bruijn graph for this sequence
26 Sequence seq("TAATGCCATGGGATGTT");
27
28 AssemblyAlgorithms::loadSequence(&g, seq);
29
30 unordered_set<KmerPair> kmerPairs, expectedKmerPairs;
31
32 expectedKmerPairs.insert(KmerPair("TAGC"));
33 expectedKmerPairs.insert(KmerPair("AACC"));
34 expectedKmerPairs.insert(KmerPair("ATCA"));
35 expectedKmerPairs.insert(KmerPair("GCTG"));
36 expectedKmerPairs.insert(KmerPair("CCGG"));
37 expectedKmerPairs.insert(KmerPair("CAGG"));
38 expectedKmerPairs.insert(KmerPair("ATGA"));
39 expectedKmerPairs.insert(KmerPair("GGTG"));
40 expectedKmerPairs.insert(KmerPair("GGGT"));
41 expectedKmerPairs.insert(KmerPair("GATT"));
42
43 for (Graph::const_iterator it = g.begin(); it != g.end(); ++it) {
44 KmerPair kmerPair(it->first);
45#if 0
46cerr << "visiting KmerPair: " << kmerPair << "\n";
47#endif
48 ASSERT_TRUE(expectedKmerPairs.find(kmerPair) != expectedKmerPairs.end());
49 expectedKmerPairs.erase(kmerPair);
50 }
51
52 ASSERT_TRUE(expectedKmerPairs.empty());
53}

Callers

nothing calls this directly

Calls 8

loadSequenceFunction · 0.85
KmerPairClass · 0.85
eraseMethod · 0.80
insertMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
findMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected