Debian Codegraph @

splitsam.sh

raw symbols SCIP
1 #!/bin/bashscip-shell filesystem . . `/bin/bash`.
2
3 usagescip-shell shell bbmap 39.20+dfsg-3 usage().(){
4 echoscip-shell system . . echo. "
5 Written by Brian Bushnell
6 Last modified February 9, 2015
7
8 Description: Splits a sam file into three files:
9 Plus-mapped reads, Minus-mapped reads, and Unmapped.
10 If 'header' is the 5th argument, header lines will be included.
11
12 Usage: splitsam <input> <plus output> <minus output> <unmapped output>
13
14 Input may be stdin or a sam file, raw or gzipped.
15 Outputs must be sam files, and may be gzipped.
16 "
17 }
18
19 #This block allows symlinked shellscripts to correctly set classpath.
20 pushd . > /dev/nullscip-shell filesystem . . `/dev/null`.
21 DIR="${BASH_SOURCE[0]}"
22 while [scip-shell system . . `[`. -h "$DIR" ]; do
23 cd "$(dirnamescip-shell system . . dirname. "$DIR")"
24 DIR="$(readlinkscip-shell system . . readlink. "$(basenamescip-shell system . . basename. "$DIR")")"
25 done
26 cd "$(dirnamescip-shell system . . dirname. "$DIR")"
27 DIR="$(pwdscip-shell system . . pwd.)/"
28 popd > /dev/nullscip-shell filesystem . . `/dev/null`.
29
30 #DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )/"
31 CP="$DIR""current/"
32 set=0
33
34 if [scip-shell system . . `[`. -z "$1" ] || [[ $1 == -h ]] || [[ $1 == --help ]]; then
35 usagescip-shell shell bbmap 39.20+dfsg-3 usage().
36 exit
37 fi
38
39 calcXmxscip-shell shell bbmap 39.20+dfsg-3 calcXmx(). () {
40 source "$DIR""/calcmem.sh"
41 setEnvironment
42 parseXmx "$@"
43 }
44 calcXmxscip-shell shell bbmap 39.20+dfsg-3 calcXmx(). "$@"
45
46 function splitsamscip-shell shell bbmap 39.20+dfsg-3 splitsam().() {
47 local CMD="java $EA $EOOM -Xmx128m -cp $CP jgi.SplitSamFile $@"
48 echoscip-shell system . . echo. $CMD
49 eval $CMD
50 }
51
52 splitsamscip-shell shell bbmap 39.20+dfsg-3 splitsam(). "$@"