Commit 21ca14bd authored by Mikaël Salson's avatar Mikaël Salson

testSegment.cpp: Add test with different seeds

parent ae223f5f
......@@ -443,6 +443,45 @@ void testProbability(IndexTypes index) {
TAP_TEST_EQUAL(kaa->getProbabilityAtLeastOrAbove(AFFECT_UNKNOWN, 0), 1, TEST_PROBABILITY_SEGMENTATION, ".getProbabilityAtLeastOrAbove() with AFFECT_UNKOWN");
}
void testDifferentSeeds(IndexTypes index) {
string v_seq = "AGAGAGAGAGAGAGAGAGAGAGAGAGAGAG";
string j_seq = "CACACACACACACACACACACACACACACA";
BioReader V, J;
V.add({"V", "V", v_seq, "", 0});
J.add({"J", "J", j_seq, "", 0});
Sequence seq = {"seq", "seq", "AGAGAGAGCACACACA", "", 0};
Germline germline_basic("Test1", 'T', V, BioReader(), J);
germline_basic.new_index(index);
germline_basic.finish();
Germline germline_small_seed_5("Test1", 'T', V, BioReader(), J, "####", "", "");
germline_small_seed_5.new_index(index);
germline_small_seed_5.finish();
Germline germline_small_seed_3("Test1", 'T', V, BioReader(), J, "", "", "####");
germline_small_seed_3.new_index(index);
germline_small_seed_3.finish();
Germline germline_small_seeds("Test1", 'T', V, BioReader(), J, "####", "", "####");
germline_small_seeds.new_index(index);
germline_small_seeds.finish();
KmerSegmenter ks1(seq, &germline_basic);
KmerSegmenter ks2(seq, &germline_small_seed_5);
KmerSegmenter ks3(seq, &germline_small_seed_3);
KmerSegmenter ks4(seq, &germline_small_seeds);
TAP_TEST(! ks1.isSegmented(), TEST_KMER_IS_SEGMENTED, "");
TAP_TEST(! ks2.isSegmented(), TEST_KMER_IS_SEGMENTED, "");
TAP_TEST(! ks3.isSegmented(), TEST_KMER_IS_SEGMENTED, "");
TAP_TEST(ks4.isSegmented(), TEST_KMER_IS_SEGMENTED, "");
TAP_TEST_EQUAL(ks1.getSegmentationStatus(), UNSEG_TOO_FEW_ZERO, TEST_KMER_SEGMENTATION_CAUSE, "");
TAP_TEST_EQUAL(ks2.getSegmentationStatus(), UNSEG_ONLY_V, TEST_KMER_SEGMENTATION_CAUSE, ks2.getInfoLineWithAffects());
TAP_TEST_EQUAL(ks3.getSegmentationStatus(), UNSEG_ONLY_J, TEST_KMER_SEGMENTATION_CAUSE, ks3.getInfoLineWithAffects());
TAP_TEST_EQUAL(ks4.getSegmentationStatus(), SEG_PLUS, TEST_KMER_SEGMENTATION_CAUSE, ks4.getInfoLineWithAffects());
}
void testSegment() {
testSegmentOverlap(KMER_INDEX);
testSegmentOverlap(AC_AUTOMATON);
......@@ -458,4 +497,5 @@ void testSegment() {
testBug2224(KMER_INDEX);
testBug2224(AC_AUTOMATON);
testBestLengthShifts();
testDifferentSeeds(AC_AUTOMATON); // KMER_INDEX can't deal with seeds of different sizes
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment