-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathcallpeaks.sh
More file actions
executable file
·77 lines (65 loc) · 2.45 KB
/
callpeaks.sh
File metadata and controls
executable file
·77 lines (65 loc) · 2.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#!/bin/bash
usage(){
echo "
Written by Brian Bushnell
Last modified December 19, 2018
Description: Calls peaks from a 2-column (x, y) tab-delimited histogram.
Usage: callpeaks.sh in=<histogram file> out=<output file>
Peak-calling parameters:
in=<file> 'in=stdin.fq' will pipe from standard in.
out=<file> Write the peaks to this file. Default is stdout.
minHeight=2 (h) Ignore peaks shorter than this.
minVolume=5 (v) Ignore peaks with less area than this.
minWidth=3 (w) Ignore peaks narrower than this.
minPeak=2 (minp) Ignore peaks with an X-value below this.
Useful when low-count kmers are filtered).
maxPeak=BIG (maxp) Ignore peaks with an X-value above this.
maxPeakCount=10 (maxpc) Print up to this many peaks (prioritizing height).
countColumn=1 (col) For multi-column input, this column, zero-based,
contains the counts.
ploidy=-1 Specify ploidy; otherwise it will be autodetected.
logscale=f Transform to log-scale prior to peak-calling. Useful
for kmer-frequency histograms.
Smoothing parameters:
smoothradius=0 Integer radius of triangle filter. Set above zero to
smooth data prior to peak-calling. Higher values are
smoother.
smoothprogressive=f Set to true to widen the filter as the x-coordinate
increases. Useful for kmer-frequency histograms.
maxradius=10 Maximum radius of progressive smoothing function.
progressivemult=2 Increment radius each time depth increases by this factor.
Please contact Brian Bushnell at bbushnell@lbl.gov if you encounter any problems.
For documentation and the latest version, visit: https://bbmap.org
"
}
if [ -z "$1" ] || [ "$1" = "-h" ] || [ "$1" = "--help" ]; then
usage
exit
fi
resolveSymlinks(){
SCRIPT="$(cd "$(dirname "$0")" && pwd)/$(basename "$0")"
while [ -h "$SCRIPT" ]; do
DIR="$(dirname "$SCRIPT")"
SCRIPT="$(readlink "$SCRIPT")"
[ "${SCRIPT#/}" = "$SCRIPT" ] && SCRIPT="$DIR/$SCRIPT"
done
DIR="$(cd "$(dirname "$SCRIPT")" && pwd)"
if [ -f "$DIR/bbtools.jar" ]; then
CP="$DIR/bbtools.jar"
else
CP="$DIR/current/"
fi
}
setEnv(){
. "$DIR/javasetup.sh"
. "$DIR/memdetect.sh"
parseJavaArgs "--xmx=120m" "--xms=120m" "--mode=fixed" "$@"
setEnvironment
}
launch() {
CMD="java $EA $EOOM $SIMD $XMX $XMS -cp $CP jgi.CallPeaks $@"
eval $CMD
}
resolveSymlinks
setEnv "$@"
launch "$@"