Commit a1c41609 authored by Mathieu Giraud's avatar Mathieu Giraud

core/segment.{h,cpp}, core/windowExtractor.cpp, core/windows.cpp: renames,...

core/segment.{h,cpp}, core/windowExtractor.cpp, core/windows.cpp: renames, 'isJunctionChanged', SEG_CHANGED_WINDOW
parent 25258d06
......@@ -211,7 +211,7 @@ Sequence Segmenter::getSequence() const {
string Segmenter::getJunction(int l, int shift) {
assert(isSegmented());
shiftedJunction = false;
junctionChanged = false;
// '-w all'
if (l == NO_LIMIT_VALUE)
return getSequence().sequence;
......@@ -230,7 +230,7 @@ string Segmenter::getJunction(int l, int shift) {
if (length_shift.first < l || length_shift.second != 0) {
info += " w" + string_of_int(length_shift.first) + "/" + string_of_int(length_shift.second);
shiftedJunction = true;
junctionChanged = true;
}
// Window succesfully extracted
......@@ -265,8 +265,8 @@ bool Segmenter::isDSegmented() const {
return dSegmented;
}
bool Segmenter::isJunctionShifted() const {
return shiftedJunction;
bool Segmenter::isJunctionChanged() const {
return junctionChanged;
}
// E-values
......
......@@ -53,7 +53,7 @@ using json = nlohmann::json;
enum SEGMENTED { NOT_PROCESSED,
TOTAL_SEG_AND_WINDOW,
SEG_PLUS, SEG_MINUS,
SEG_SHORTER_WINDOW,
SEG_CHANGED_WINDOW,
UNSEG_TOO_SHORT, UNSEG_STRAND_NOT_CONSISTENT,
UNSEG_TOO_FEW_ZERO, UNSEG_ONLY_V, UNSEG_ONLY_J,
UNSEG_BAD_DELTA_MIN, UNSEG_AMBIGUOUS,
......@@ -163,7 +163,7 @@ protected:
string CDR3aa;
bool reversed, segmented, dSegmented;
bool shiftedJunction;
bool junctionChanged;
int because;
/**
......@@ -209,7 +209,7 @@ protected:
* The junction is revcomp-ed if the original string comes from reverse
* strand.
* @post If the size or position of the window had to be dynamically adapted to fit
* in the read, isJunctionShifted() will return true
* in the read, isJunctionChanged() will return true
*/
string getJunction(int l, int shift=0);
......@@ -252,7 +252,7 @@ protected:
* @return true iff the junction has been shifted or shortened
* dynamically to fit into the sequence
*/
bool isJunctionShifted() const;
bool isJunctionChanged() const;
/**
* @return the status of the segmentation. Tells if the Sequence has been segmented
......
......@@ -70,16 +70,16 @@ WindowsStorage *WindowExtractor::extract(OnlineBioReader *reads,
if (!only_labeled_windows || windowsStorage->isInterestingJunction(junc)) {
// Store the window
if (seg->isJunctionShifted())
windowsStorage->add(junc, reads->getSequence(), seg->getSegmentationStatus(), seg->segmented_germline, {SEG_SHORTER_WINDOW});
if (seg->isJunctionChanged())
windowsStorage->add(junc, reads->getSequence(), seg->getSegmentationStatus(), seg->segmented_germline, {SEG_CHANGED_WINDOW});
else
windowsStorage->add(junc, reads->getSequence(), seg->getSegmentationStatus(), seg->segmented_germline);
}
// Update stats
stats[TOTAL_SEG_AND_WINDOW].insert(read_length) ;
if (seg->isJunctionShifted())
stats[SEG_SHORTER_WINDOW].insert(read_length);
if (seg->isJunctionChanged())
stats[SEG_CHANGED_WINDOW].insert(read_length);
stats_reads[seg->system].addScore(read_length);
if (out_segmented) {
......
......@@ -280,7 +280,7 @@ json WindowsStorage::sortedWindowsToJson(map <junction, json> json_data_segment)
json reads = {it->second};
windowsList["id"] = it->first;
if (status_by_window[it->first][SEG_SHORTER_WINDOW])
if (status_by_window[it->first][SEG_CHANGED_WINDOW])
json_add_warning(windowsList, "W5x", "Short or shifted window");
......
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