47{
48 std::string sequence("ACTGACTGACTGACTGACTGACTGACTGACTGACTGACTG");
49 std::string word;
50
51 word="ACTG";
52 check(m_failures, ++m_testNum, "Test wordMatch with std::string", true,
53 Sequence::wordMatch(sequence, 4, word));
54
55 std::stringstream output;
56
57 Sequence::printNearbyWords(output, sequence, 8, word, 4);
58
59 std::string expect("\
60word 'ACTG' found -4 away from position 8.\n\
61word 'ACTG' found 0 away from position 8.\n\
62");
63
64 check(m_failures, ++m_testNum, "Test printNearbyWords with std::string", expect, output.str());
65
66
67 Sequence::getString(sequence, 4, 4, word);
68
69 check(m_failures, ++m_testNum, "Test getString with std::string", "ACTG", word);
70
71 Sequence::getHighLightedString(sequence, 0, 12, word, 4, 8);
72 check(m_failures, ++m_testNum, "Test getHighLightedStribng with std::string", "ACTGactgACTG",word);
73
74#if 0
75
76 output.clear();
77 output.str(std::string());
78
79 Sequence::printBaseContext(output, sequence, 8, 4);
80 expect="\
81index: 8\n\
82ACTGACTGA\n\
83 ^\n\
84";
85 check(m_failures, ++m_testNum, "Test printBaseContext with std::string", expect, output.str());
86#endif
87 std::string result;
88 std::string read("ACTGZZZZACTG");
89 expect = " ^^^^ ";
90 Sequence::getMismatchHatString(sequence, 4, result, read);
91 check(m_failures, ++m_testNum, "Test getMismatchHatString with std::string", expect, result);
92
93
94 read="ACTG";
95 std::string quality("");
96 size_t location = Sequence::simpleLocalAligner(sequence, 0, read, quality, 12);
97 check(m_failures, ++m_testNum, "Test simpleLocalAligner with std::string", (size_t) 0, location);
98
99 read="ACNG";
100 int misMatches = Sequence::getMismatchCount(sequence, 0, read);
101 check(m_failures, ++m_testNum, "Test getMismatchCount with std::string", 1, misMatches);
102
103 read="ACNG";
104 quality="$$$$";
105 int sumQ = Sequence::getSumQ(sequence, 0, read, quality);
106 check(m_failures, ++m_testNum, "Test getSumQ with std::string", 3, sumQ);
107}