Une MAJ de sécurité est nécessaire sur notre version actuelle. Elle sera effectuée lundi 02/08 entre 12h30 et 13h. L'interruption de service devrait durer quelques minutes (probablement moins de 5 minutes).

Commit 32ee38d5 authored by Mikaël Salson's avatar Mikaël Salson
Browse files

segment.cpp: Add a UNSEG_NOISY cause when the e-value is not high enough

parent ef8e47fc
......@@ -396,6 +396,11 @@ int Segmenter::getSegmentationStatus() const {
return because;
}
void Segmenter::setSegmentationStatus(int status) {
because = status;
segmented = (status == SEG_PLUS || status == SEG_MINUS);
}
// FineSegmenter
void best_align(int overlap, string seq_left, string seq_right,
......
......@@ -32,13 +32,14 @@ using namespace std;
enum SEGMENTED { DONT_KNOW, SEG_PLUS, SEG_MINUS, UNSEG_TOO_SHORT, UNSEG_STRAND_NOT_CONSISTENT,
UNSEG_TOO_FEW_ZERO, UNSEG_TOO_FEW_V, UNSEG_TOO_FEW_J,
UNSEG_BAD_DELTA_MIN, UNSEG_BAD_DELTA_MAX, UNSEG_AMBIGUOUS,
UNSEG_BAD_DELTA_MIN, UNSEG_BAD_DELTA_MAX, UNSEG_AMBIGUOUS, UNSEG_NOISY,
TOTAL_SEG_AND_WINDOW,
TOTAL_SEG_BUT_TOO_SHORT_FOR_THE_WINDOW,
STATS_SIZE } ;
const char* const segmented_mesg[] = { "?", "SEG_+", "SEG_-", "UNSEG too short", "UNSEG strand",
"UNSEG too few (0)", "UNSEG too few V", "UNSEG too few J",
"UNSEG < delta_min", "UNSEG > delta_max", "UNSEG ambiguous",
"UNSEG noisy",
"= SEG, with window",
"= SEG, no window",
} ;
......@@ -136,6 +137,11 @@ protected:
string getInfoLine() const;
/**
* @post status == SEG_PLUS || status == SEG_MINUS <==> isSegmented()
*/
void setSegmentationStatus(int status);
friend ostream &operator<<(ostream &out, const Segmenter &s);
};
......
......@@ -120,6 +120,16 @@ void testSegmentationCause() {
TEST_KMER_JUNCTION, "");
TAP_TEST(ks.getLeft() == 17, TEST_KMER_LEFT, "left = " << ks.getLeft());
TAP_TEST(ks.getRight() == 18, TEST_KMER_RIGHT, "right = " << ks.getRight());
ks.setSegmentationStatus(DONT_KNOW);
TAP_TEST(! ks.isSegmented(), TEST_SET_SEGMENTATION_CAUSE, "");
TAP_TEST(ks.getSegmentationStatus() == DONT_KNOW, TEST_SET_SEGMENTATION_CAUSE, "");
ks.setSegmentationStatus(UNSEG_NOISY);
TAP_TEST(! ks.isSegmented(), TEST_SET_SEGMENTATION_CAUSE, "");
TAP_TEST(ks.getSegmentationStatus() == UNSEG_NOISY, TEST_SET_SEGMENTATION_CAUSE, "");
ks.setSegmentationStatus(SEG_PLUS);
TAP_TEST(ks.isSegmented(), TEST_SET_SEGMENTATION_CAUSE, "");
TAP_TEST(ks.getSegmentationStatus(), TEST_SET_SEGMENTATION_CAUSE, "");
nb_checked++;
} else if (data.read(i).label == "seq-seg-") {
TAP_TEST(ks.isSegmented(), TEST_KMER_IS_SEGMENTED, "");
......
......@@ -101,6 +101,7 @@ enum {
/* Kmer segmentation */
TEST_KMER_IS_SEGMENTED,
TEST_KMER_SEGMENTATION_CAUSE,
TEST_SET_SEGMENTATION_CAUSE,
TEST_KMER_JUNCTION,
TEST_KMER_DATA,
TEST_KMER_LEFT,
......@@ -237,6 +238,7 @@ inline void declare_tests() {
RECORD_TAP_TEST(TEST_KMER_IS_SEGMENTED, "Test isSegmented() in KmerSegmenter");
RECORD_TAP_TEST(TEST_KMER_SEGMENTATION_CAUSE, "Test getSegmentationStatus() in KmerSegmenter");
RECORD_TAP_TEST(TEST_SET_SEGMENTATION_CAUSE, "Test setSegmentationStatus() in KmerSegmenter");
RECORD_TAP_TEST(TEST_KMER_JUNCTION, "Test getJunction() in KmerSegmenter");
RECORD_TAP_TEST(TEST_KMER_DATA, "Test that data is consistent with what we expect for KmerSegmenter");
RECORD_TAP_TEST(TEST_KMER_LEFT, "Test V end (resp. J start) with KmerSegmenter on fwd (resp bwd) strand");
......
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