Skip to content

Commit

Permalink
fix blacklist bug (lines matching chr[\dXY]_* were included)
Browse files Browse the repository at this point in the history
  • Loading branch information
leepc12 committed Dec 20, 2016
1 parent e154168 commit a7b053e
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
10 changes: 5 additions & 5 deletions modules/callpeak_bigbed.bds
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ string peak_to_bigbed( string filetype, string peak, string o_dir, string group
sys $shcmd_init

sys zcat $peak | sort -k1,1 -k2,2n > $bigbed.tmp
// sys cat $chrsz | grep -P 'chr[0-9XY]+(?!_)' > $bigbed.chrsz.tmp
// sys bedToBigBed $bed_param $bigbed.tmp $bigbed.chrsz.tmp $bigbed
// sys rm -f $bigbed.tmp $bigbed.chrsz.tmp
sys bedToBigBed $bed_param $bigbed.tmp $chrsz $bigbed
sys rm -f $bigbed.tmp
sys cat $chrsz | grep -P 'chr[\dXY]+[ \t]' > $bigbed.chrsz.tmp
sys bedToBigBed $bed_param $bigbed.tmp $bigbed.chrsz.tmp $bigbed
sys rm -f $bigbed.tmp $bigbed.chrsz.tmp
// sys bedToBigBed $bed_param $bigbed.tmp $chrsz $bigbed
// sys rm -f $bigbed.tmp

sys $shcmd_finalize
}
Expand Down
2 changes: 1 addition & 1 deletion modules/callpeak_blacklist_filter.bds
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ string blacklist_filter_peak( string filetype, string peak, string o_dir, string

sys bedtools intersect -v -a $peak -b $blacklist \
| awk 'BEGIN{OFS="\t"} {if ($5>1000) $5=1000; print $0}' \
| grep -P 'chr[0-9XY]+(?!_)' | gzip -nc > $filtered
| grep -P 'chr[\dXY]+[ \t]' | gzip -nc > $filtered

sys $shcmd_finalize
}
Expand Down
2 changes: 1 addition & 1 deletion modules/callpeak_idr.bds
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ string[] idr2( string peak1, string peak2, string pooled, string idr_thresh, str

if ( path_exists( blacklist ) ) {
cmd1 = "bedtools intersect -v -a $peak_idr_trk_tmp -b $blacklist"+\
" | grep -P 'chr[0-9XY]+(?!_)'"+\
" | grep -P 'chr[\dXY]+[ \t]'"+\
" | awk 'BEGIN{OFS=\"\t\"} {if ($5>1000) $5=1000; print $0}'"+\
" | gzip -nc > $filt_peak_idr_trk_tmp"
cmd2 = "zcat $filt_peak_idr_trk_tmp | awk 'BEGIN{OFS=\"\t\"} {print $1,$2,$3,$4,$5,$6,$7,$8,$9,$10}' | gzip -nc > $filt_peak_idr"
Expand Down
2 changes: 1 addition & 1 deletion modules/callpeak_naive_overlap.bds
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ string naive_overlap_peak( string filetype, string peak_pooled, string peak_rep1
string cmd1
if ( path_exists( blacklist ) ) {
cmd1 = "bedtools intersect -v -a $peak_final -b $blacklist "+\
" | grep -P 'chr[0-9XY]+(?!_)'"+\
" | grep -P 'chr[\dXY]+[ \t]'"+\
" | awk 'BEGIN{OFS=\"\t\"} {if ($5>1000) $5=1000; print $0}'"+\
" | gzip -nc > $filt_peak_final"
}
Expand Down

0 comments on commit a7b053e

Please sign in to comment.