Skip to content
Snippets Groups Projects
Commit 4c8e1221 authored by Aaron's avatar Aaron
Browse files

Fixed casting issue in windowBed.AddWindow() that cuased slop positions to run...

Fixed casting issue in windowBed.AddWindow() that cuased slop positions to run off the end of the chromosome.
parent e2bcd09a
No related branches found
No related tags found
No related merge requests found
......@@ -221,19 +221,22 @@ void BedWindow::AddWindow(const BED &a, CHRPOS &fudgeStart, CHRPOS &fudgeEnd) {
// if "-", the left is right and right is left.
if (_strandWindows) {
if (a.strand == "+") {
if ((a.start - _leftSlop) > 0) fudgeStart = a.start - _leftSlop;
if ((int) (a.start - _leftSlop) > 0)
fudgeStart = a.start - _leftSlop;
else fudgeStart = 0;
fudgeEnd = a.end + _rightSlop;
}
else {
if ((a.start - _rightSlop) > 0) fudgeStart = a.start - _rightSlop;
if ((int) (a.start - _rightSlop) > 0)
fudgeStart = a.start - _rightSlop;
else fudgeStart = 0;
fudgeEnd = a.end + _leftSlop;
}
}
// If not, add the windows irrespective of strand
else {
if ((a.start - _leftSlop) > 0) fudgeStart = a.start - _leftSlop;
if ((int) (a.start - _leftSlop) > 0)
fudgeStart = a.start - _leftSlop;
else fudgeStart = 0;
fudgeEnd = a.end + _rightSlop;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment