| 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 January 21, 2015 |
| 7 | |
| 8 | Description: Splits sam reads into 4 output files depending on mapping. |
| 9 | |
| 10 | Usage: splitsam4way.sh <input> <outplus> <outminus> <outchimeric> <outunmapped> |
| 11 | |
| 12 | Please contact Brian Bushnell at [email protected] if you encounter any problems. |
| 13 | " |
| 14 | } |
| 15 | |
| 16 | #This block allows symlinked shellscripts to correctly set classpath. |
| 17 | pushd . > /dev/nullscip-shell filesystem . . `/dev/null`. |
| 18 | DIR="${BASH_SOURCE[0]}" |
| 19 | while [scip-shell system . . `[`. -h "$DIR" ]; do |
| 20 | cd "$(dirnamescip-shell system . . dirname. "$DIR")" |
| 21 | DIR="$(readlinkscip-shell system . . readlink. "$(basenamescip-shell system . . basename. "$DIR")")" |
| 22 | done |
| 23 | cd "$(dirnamescip-shell system . . dirname. "$DIR")" |
| 24 | DIR="$(pwdscip-shell system . . pwd.)/" |
| 25 | popd > /dev/nullscip-shell filesystem . . `/dev/null`. |
| 26 | |
| 27 | #DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )/" |
| 28 | CP="$DIR""current/" |
| 29 | set=0 |
| 30 | |
| 31 | if [scip-shell system . . `[`. -z "$1" ] || [[ $1 == -h ]] || [[ $1 == --help ]]; then |
| 32 | usagescip-shell shell bbmap 39.20+dfsg-3 usage(). |
| 33 | exit |
| 34 | fi |
| 35 | |
| 36 | calcXmxscip-shell shell bbmap 39.20+dfsg-3 calcXmx(). () { |
| 37 | source "$DIR""/calcmem.sh" |
| 38 | setEnvironment |
| 39 | parseXmx "$@" |
| 40 | } |
| 41 | calcXmxscip-shell shell bbmap 39.20+dfsg-3 calcXmx(). "$@" |
| 42 | |
| 43 | function splitscip-shell shell bbmap 39.20+dfsg-3 split().() { |
| 44 | local CMD="java $EA $EOOM -Xmx128m -Xms128m -cp $CP jgi.SplitSam4Way $@" |
| 45 | echoscip-shell system . . echo. $CMD >&2 |
| 46 | eval $CMD |
| 47 | } |
| 48 | |
| 49 | splitscip-shell shell bbmap 39.20+dfsg-3 split(). "$@" |