Debian Codegraph @

mergesam.sh

raw symbols SCIP
1 #!/bin/bash
2
3 usage(){
4 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/null
21 DIR="${BASH_SOURCE[0]}"
22 while [ -h "$DIR" ]; do
23 cd "$(dirname "$DIR")"
24 DIR="$(readlink "$(basename "$DIR")")"
25 done
26 cd "$(dirname "$DIR")"
27 DIR="$(pwd)/"
28 popd > /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 [ -z "$1" ] || [[ $1 == -h ]] || [[ $1 == --help ]]; then
37 usage
38 exit
39 fi
40
41 calcXmx () {
42 source "$DIR""/calcmem.sh"
43 setEnvironment
44 parseXmx "$@"
45 }
46 calcXmx "$@"
47
48 function mergesam() {
49 local CMD="java $EA $EOOM $z -cp $CP jgi.MergeSam $@"
50 echo $CMD >&2
51 eval $CMD
52 }
53
54 mergesam "$@"