Skip to content

Commit cd78af4

Browse files
committed
blacklist filter spp peaks
1 parent 8ad7139 commit cd78af4

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

modules/callpeak_spp.bds

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,13 @@ string[] spp( string tag, string ctl_tag, string fraglen, string o_dir, string g
3939
prefix_x := "$o_dir/" + make_x_basename_wo_gz( tag, ctl_tag, "" )
4040
rpeakfile_vs := "$prefix_vs.regionPeak.gz"
4141
rpeakfile := "$prefix_x.regionPeak.gz"
42+
filt_rpeakfile := "$prefix_x.filt.regionPeak.gz"
4243
ccscore := "$prefix_x.ccscore"
4344
pdf_tmp := replace_dir( rm_ext( tag, ["gz"] ), o_dir ) + ".pdf"
4445
pdf := "$prefix_x.pdf"
4546

47+
blacklist_exists := path_exists(blacklist)
48+
4649
in := [ tag, ctl_tag ]
4750
out := [ rpeakfile, ccscore, pdf ]
4851

@@ -76,6 +79,10 @@ string[] spp( string tag, string ctl_tag, string fraglen, string o_dir, string g
7679
// if no rpeak file, do something to return non-zero exit code
7780
sys if [ ! -f $rpeakfile ]; then error_in_spp_output_peak_does_not_exist; fi
7881

82+
sys if [[ $blacklist_exists == "true" ]]; then \
83+
bedtools intersect -v -a $rpeakfile -b $blacklist | gzip -nc > $filt_rpeakfile; \
84+
fi
85+
7986
sys $shcmd_finalize
8087
}
8188

0 commit comments

Comments
 (0)