Skip to content
Snippets Groups Projects
Commit ecb4afaa authored by Brent Pedersen's avatar Brent Pedersen
Browse files

fix slop with -pct

parent 92498166
No related branches found
No related tags found
No related merge requests found
......@@ -41,6 +41,7 @@ BedSlop::~BedSlop(void) {
void BedSlop::SlopBed() {
BED bedEntry; // used to store the current BED line from the BED file.
float l, r;
_bed->Open();
// report header first if asked.
......@@ -53,9 +54,13 @@ void BedSlop::SlopBed() {
AddSlop(bedEntry);
}
else {
_leftSlop = _leftSlop * (float)bedEntry.size();
l = _leftSlop;
_leftSlop = _leftSlop * (float)bedEntry.size();
r = _rightSlop;
_rightSlop = _rightSlop * (float)bedEntry.size();
AddSlop(bedEntry);
_rightSlop = r;
_leftSlop = l;
}
_bed->reportBedNewLine(bedEntry);
}
......@@ -86,7 +91,6 @@ void BedSlop::AddSlop(BED &bed) {
bed.start = bed.start - (int)_leftSlop;
else
bed.start = 0;
if ( ((CHRPOS)bed.end + (CHRPOS)_rightSlop) <= chromSize )
bed.end = bed.end + (int)_rightSlop;
else
......
......@@ -167,4 +167,9 @@ echo -e "chr1\t16778272\t16778572"| $BT slop -l 200 -r 200 -i - -g ../../genomes
check obs exp
rm obs exp
echo " slop.t15...\c"
echo \
"chr1 159 171" > exp
echo -e "chr1\t160\t170"| $BT slop -b 0.1 -pct -i - -g ../../genomes/human.hg19.genome > obs
check obs exp
rm obs exp
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