Commit 0fa2515f authored by arq5x's avatar arq5x
Browse files

only set end to 1 if slop is negative and rolls off start of chrom

parent e4955d31
......@@ -86,7 +86,11 @@ void BedSlop::AddSlop(BED &bed) {
if ( ((int)bed.end + (int)_leftSlop) <= chromSize )
bed.end = bed.end + (int)_leftSlop;
else
bed.end = chromSize;
// if the _leftSlop is negative and pushes bed.end to be < 0, set to 1
if ( (((int)bed.end + (int)_leftSlop) <= 0) && _leftSlop < 0)
bed.end = 1;
else
bed.end = chromSize;
}
else {
if ( ((int)bed.start - (int)_leftSlop) >= 0 )
......@@ -97,7 +101,7 @@ void BedSlop::AddSlop(BED &bed) {
bed.end = bed.end + (int)_rightSlop;
else
// if the _rightSlop is negative and pushes bed.end to be < 0, set to 1
if ( ((int)bed.end + (int)_rightSlop) <= 0 )
if ( (((int)bed.end + (int)_rightSlop) <= 0) && _rightSlop < 0)
bed.end = 1;
else
bed.end = chromSize;
......
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