Commit 5882cdc0 authored by Mathieu Giraud's avatar Mathieu Giraud

core/segment.{h,s}: getJunction() may shift the window

See #1580.
parent 034f6d09
......@@ -207,7 +207,7 @@ Sequence Segmenter::getSequence() const {
return s ;
}
string Segmenter::getJunction(int l) const {
string Segmenter::getJunction(int l, int shift) const {
assert(isSegmented());
// '-w all'
......@@ -215,7 +215,7 @@ string Segmenter::getJunction(int l) const {
return getSequence().sequence;
// Regular '-w'
int start = (getLeft() + getRight())/2 - l/2;
int start = (getLeft() + getRight())/2 - l/2 + shift;
// Yield UNSEG_TOO_SHORT_FOR_WINDOW into windowExtractor
if (start < 0 or start + l > (int)sequence.size()) // TODO: +l ou +l-1 ?
......
......@@ -197,7 +197,7 @@ protected:
* The junction is revcomp-ed if the original string comes from reverse
* strand.
*/
string getJunction(int l) const;
string getJunction(int l, int shift=0) const;
/**
* @return the left position (on forward strand) of the segmentation.
......
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