Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

slopBed chromsizes filter on raw MACS2 output #51

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions modules/callpeak_macs2_atac.bds
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ string[] macs2_atac( string tag, string smooth_window, string pval_thresh, bool
--nomodel --shift -$shiftsize --extsize $smooth_window --broad --keep-dup all $extra_param_macs2

//# Sort by Col8 in descending order and replace long peak names in Column 4 with Peak_<peakRank>
sys sort -k 8gr,8gr "$prefix"_peaks.broadPeak | awk 'BEGIN{OFS="\t"}{$4="Peak_"NR ; print $0}' | gzip -nc > $bpeakfile
sys sort -k 14gr,14gr "$prefix"_peaks.gappedPeak | awk 'BEGIN{OFS="\t"}{$4="Peak_"NR ; print $0}' | gzip -nc > $gpeakfile
sys slopBed -i "$prefix"_peaks.broadPeak -g "$chrsz" -b 0 | sort -k 8gr,8gr | awk 'BEGIN{OFS="\t"}{$4="Peak_"NR ; print $0}' | gzip -nc > $bpeakfile
sys slopBed -i "$prefix"_peaks.gappedPeak -g "$chrsz" -b 0 | sort -k 14gr,14gr | awk 'BEGIN{OFS="\t"}{$4="Peak_"NR ; print $0}' | gzip -nc > $gpeakfile
sys rm -f "$prefix"_peaks.broadPeak
sys rm -f "$prefix"_peaks.gappedPeak

Expand All @@ -91,7 +91,7 @@ string[] macs2_atac( string tag, string smooth_window, string pval_thresh, bool
--nomodel --shift -$shiftsize --extsize $smooth_window -B --SPMR --keep-dup all --call-summits $extra_param_macs2

//# Sort by Col8 in descending order and replace long peak names in Column 4 with Peak_<peakRank>
sys sort -k 8gr,8gr "$prefix"_peaks.narrowPeak | awk 'BEGIN{OFS="\t"}{$4="Peak_"NR ; print $0}' | gzip -nc > $peakfile
sys slopBed -i "$prefix"_peaks.narrowPeak -g "$chrsz" -b 0 | sort -k 8gr,8gr | awk 'BEGIN{OFS="\t"}{$4="Peak_"NR ; print $0}' | gzip -nc > $peakfile
sys rm -f "$prefix"_peaks.narrowPeak
sys rm -f "$prefix"_peaks.xls
sys rm -f "$prefix"_summits.bed
Expand Down