Commit 6a991ee8 authored by Mikaël Salson's avatar Mikaël Salson
Browse files

Tests: Add tests for getRequiredSequence()

parent 38670846
......@@ -29,7 +29,21 @@ void testRepresentative() {
representative = krc.getRepresentative();
TAP_TEST(representative.label.find("seq1") == 0, TEST_KMER_REPRESENTATIVE,
"When allowing two steps before stability, we should reach seq1 (" << representative.label << " instead)");
krc.setRevcomp(true);
krc.setRequiredSequence("ATCGCGCCCT"); // revcomp
krc.compute();
representative = krc.getRepresentative();
TAP_TEST(representative.label.find("seq2-[33,52]") == 0, TEST_KMER_REPRESENTATIVE_REQUIRED_SEQ,
"When requiring sequence ATCGCGCCCT, we should have seq2 (" << representative.label << " instead)");
krc.setRevcomp(false);
krc.compute();
TAP_TEST(! krc.hasRepresentative(), TEST_KMER_REPRESENTATIVE_REQUIRED_SEQ,
"When requiring sequence AGGGCGCGAT and revcomp=false, we shouldn't find anything (the sequence is revcomp-ed)");
krc.setRequiredSequence("");
krc.setMinCover(4);
krc.compute();
TAP_TEST(! krc.hasRepresentative(), TEST_KMER_REPRESENTATIVE,
......
......@@ -44,6 +44,7 @@ enum {
/* Representative */
TEST_KMER_REPRESENTATIVE,
TEST_KMER_REPRESENTATIVE_REQUIRED_SEQ,
TEST_KMER_REPRESENTATIVE_REVCOMP,
/* Kmer segmentation */
......@@ -118,6 +119,7 @@ inline void declare_tests() {
RECORD_TAP_TEST(TEST_EXTRACTOR_OUT_UNSEG, "Test unsegmentation output for WindowsExtractor");
RECORD_TAP_TEST(TEST_KMER_REPRESENTATIVE, "Test KmerRepresentativeComputer computations");
RECORD_TAP_TEST(TEST_KMER_REPRESENTATIVE_REQUIRED_SEQ, "Test KmerRepresentativeComputer computations with a required sequence");
RECORD_TAP_TEST(TEST_KMER_REPRESENTATIVE_REVCOMP, "Test KmerRepresentativeComputer computations on a dataset and its revcomp");
RECORD_TAP_TEST(TEST_BUG_SEGMENTATION, "Test segmentation bug");
RECORD_TAP_TEST(TEST_SEGMENT_POSITION, "Test V,D,J position");
......
......@@ -4,6 +4,7 @@ TAAAAAAAAAACCCCCCCCCCGGGGGGGGGGTTTTTTTTTTA
AAAACCCCCCCCCCGGGGGGGGGGTTTTTTTTTTA
TAGGGCGCGATCGACTTC
>seq3
ATCGGTACACAATCGAGCATGTAGGCTACACGGTA
GCGCGATCGACTTCTCGAGCATGTAGGCTACACGGTA
TAAAAAAAAAACCCCCCCCCCGGGGGGGGGGTTTTTT
>seq4
TATAGGGCGCGATCGACTTC
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