| 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 March 8, 2017 |
| 7 | |
| 8 | Description: Concatenates sam files, keeping only the header from the first. |
| 9 | |
| 10 | Usage: mergesam.sh <files> out=<file> |
| 11 | |
| 12 | Java Parameters: |
| 13 | -da Disable assertions. |
| 14 | |
| 15 | Please contact Brian Bushnell at [email protected] if you encounter any problems. |
| 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 | |
| 33 | z="-Xmx400m" |
| 34 | set=0 |
| 35 | |
| 36 | if [scip-shell system . . `[`. -z "$1" ] || [[ $1 == -h ]] || [[ $1 == --help ]]; then |
| 37 | usagescip-shell shell bbmap 39.20+dfsg-3 usage(). |
| 38 | exit |
| 39 | fi |
| 40 | |
| 41 | calcXmxscip-shell shell bbmap 39.20+dfsg-3 calcXmx(). () { |
| 42 | source "$DIR""/calcmem.sh" |
| 43 | setEnvironment |
| 44 | parseXmx "$@" |
| 45 | } |
| 46 | calcXmxscip-shell shell bbmap 39.20+dfsg-3 calcXmx(). "$@" |
| 47 | |
| 48 | function mergesamscip-shell shell bbmap 39.20+dfsg-3 mergesam().() { |
| 49 | local CMD="java $EA $EOOM $z -cp $CP jgi.MergeSam $@" |
| 50 | echoscip-shell system . . echo. $CMD >&2 |
| 51 | eval $CMD |
| 52 | } |
| 53 | |
| 54 | mergesamscip-shell shell bbmap 39.20+dfsg-3 mergesam(). "$@" |