Skip to content

Commit

Permalink
Remove support for jarch in run_add_peaks_per_hotspot.
Browse files Browse the repository at this point in the history
  • Loading branch information
rthurman committed Apr 11, 2014
1 parent fa10291 commit b5b2401
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 19 deletions.
8 changes: 8 additions & 0 deletions hotspot-distr/CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -82,3 +82,11 @@ run_badspot

Remove use of /tmp. All scripts now write temp files "in place" to
output directories.


run_add_peaks_per_hotspot
-------------------------------------------------------------------

Remove support for jarch density files. Jarch format has been
supplanted by starch, and its use triggers 141 exit codes, as
previously noted.
25 changes: 6 additions & 19 deletions hotspot-distr/pipeline-scripts/run_add_peaks_per_hotspot
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,6 @@ elif [ -d $dens ]; then
dens=$dens/$proj.tagdensity.bed.starch
fi

dentype=${dens##*.}

## Check genome-wide output.
pk=$pdir/$proj.peaks.bed
if [ ! -e $pk ]; then
Expand Down Expand Up @@ -107,23 +105,12 @@ do
echo "$thisscr: error: $dens does not exist; run run_wavelet_peak_finding to generate."
exit 1
fi
if [ $dentype == "jarch" ]; then
gchr $dens \
| bedmap --delim ";" --echo-map --max $tmpdom - \
| awk 'BEGIN{FS=";"}{max=$NF; i=1; go=1; while(i<NF && go==1){split($i, a, "\t"); if(a[5] == max){print $i; go=0}; i++}}' \
| awk -v sz=$halfHSS 'BEGIN {FS="\t";OFS=FS} {d=int(($2+$3)/2); e=d-sz; if ( e < 0 ) { e = 0; } print $1, e, d+sz, $4, int($5)}' \
| sort-bed - \
| bedops -u - $tout \
> $combbed
else
## Density is starch file, or text.
bedmap --delim ";" --echo-map --max $tmpdom $dens \
| awk 'BEGIN{FS=";"}{max=$NF; i=1; go=1; while(i<NF && go==1){split($i, a, "\t"); if(a[5] == max){print $i; go=0}; i++}}' \
| awk -v sz=$halfHSS 'BEGIN {FS="\t";OFS=FS} {d=int(($2+$3)/2); e=d-sz; if ( e < 0 ) { e = 0; } print $1, e, d+sz, $4, int($5)}' \
| sort-bed - \
| bedops -u - $tout \
> $combbed
fi
bedmap --delim ";" --echo-map --max $tmpdom $dens \
| awk 'BEGIN{FS=";"}{max=$NF; i=1; go=1; while(i<NF && go==1){split($i, a, "\t"); if(a[5] == max){print $i; go=0}; i++}}' \
| awk -v sz=$halfHSS 'BEGIN {FS="\t";OFS=FS} {d=int(($2+$3)/2); e=d-sz; if ( e < 0 ) { e = 0; } print $1, e, d+sz, $4, int($5)}' \
| sort-bed - \
| bedops -u - $tout \
> $combbed
fi

echo "track name=$name" > $combwig
Expand Down

0 comments on commit b5b2401

Please sign in to comment.