Commit 26f752a7 authored by Mathieu Giraud's avatar Mathieu Giraud

tests: update tests with KmerSegmenter(..., germline)

Unit tests are passing again.
The code is now clearer, as these tests actually tested segmentation on only one germline.
We should now have real unit tests on KmerMultiSegmenter.
parent 2ade70be
......@@ -17,10 +17,6 @@ void testSegmentationBug1(int delta_min, int delta_max) {
Germline *germline ;
germline = new Germline("custom", 'x', seqV, seqV, seqJ, delta_min, delta_max);
germline->new_index("##############");
MultiGermline *multi ;
multi = new MultiGermline();
multi->insert(germline);
OnlineFasta input(buggy_sequences);
......@@ -41,8 +37,7 @@ void testSegmentationBug1(int delta_min, int delta_max) {
}
}
Segmenter *segment = new KmerSegmenter(input.getSequence(), multi);
KmerSegmenter *segment = new KmerSegmenter(input.getSequence(), germline);
if (strand == 2
|| (strand == 1
......@@ -56,7 +51,7 @@ void testSegmentationBug1(int delta_min, int delta_max) {
delete segment;
delete kaa;
}
delete multi;
delete germline;
}
void testBugs() {
......
......@@ -78,12 +78,9 @@ void testSegmentOverlap()
germline2 = new Germline("TRG2", 'G', seqV, seqV, seqJ, -50, 50);
germline2->new_index("##########");
MultiGermline *multi1 ;
multi1 = new MultiGermline();
multi1->insert(germline1);
for (int i = 0; i < data.size(); i++) {
KmerSegmenter ks(data.read(i), multi1);
KmerSegmenter ks(data.read(i), germline1);
TAP_TEST(ks.seg_V + ks.seg_N + ks.seg_J == data.sequence(i)
|| ks.seg_V + ks.seg_N + ks.seg_J == revcomp(data.sequence(i)),
TEST_KMER_SEGMENT_OVERLAP,
......@@ -96,7 +93,7 @@ void testSegmentOverlap()
" V= " << fs.seg_V << ", N = " << fs.seg_N << ", J = " << fs.seg_J);
}
delete multi1;
delete germline1;
delete germline2;
}
......@@ -110,15 +107,11 @@ void testSegmentationCause() {
germline = new Germline("TRG", 'G', seqV, seqV, seqJ, 0, 10);
germline->new_index("##########");
MultiGermline *multi ;
multi = new MultiGermline();
multi->insert(germline);
int nb_checked = 0;
for (int i = 0; i < data.size(); i++) {
KmerSegmenter ks(data.read(i), multi);
KmerSegmenter ks(data.read(i), germline);
if (data.read(i).label == "seq-seg+") {
TAP_TEST(ks.isSegmented(), TEST_KMER_IS_SEGMENTED, "seq is " << data.label(i));
TAP_TEST(ks.getSegmentationStatus() == SEG_PLUS, TEST_KMER_SEGMENTATION_CAUSE, "");
......@@ -200,7 +193,7 @@ void testSegmentationCause() {
TAP_TEST(nb_checked == 13, TEST_KMER_DATA, "");
delete multi;
delete germline;
}
void testExtractor() {
......
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