| 1 | #!/bin/bash |
| 2 | |
| 3 | usage(){ |
| 4 | echo " |
| 5 | Written by Brian Bushnell |
| 6 | Last modified October 10, 2018 |
| 7 | |
| 8 | Description: Merges .pgm files. |
| 9 | |
| 10 | Usage: mergepgm.sh in=x.pgm,y.pgm out=z.pgm |
| 11 | |
| 12 | File parameters: |
| 13 | in=<file,file> A pgm file or comma-delimited list of pgm files. |
| 14 | out=<file> Output filename. |
| 15 | normalize=f Merge proportionally to base counts, so small models |
| 16 | have equal weight to large models. Normalization happens |
| 17 | before applying the @ multiplier. |
| 18 | @ symbol Input filenames in the form of '[email protected]' will have |
| 19 | a multiplier applied to that model prior to merging. |
| 20 | |
| 21 | Please contact Brian Bushnell at [email protected] if you encounter any problems. |
| 22 | " |
| 23 | } |
| 24 | |
| 25 | #This block allows symlinked shellscripts to correctly set classpath. |
| 26 | pushd . > /dev/null |
| 27 | DIR="${BASH_SOURCE[0]}" |
| 28 | while [ -h "$DIR" ]; do |
| 29 | cd "$(dirname "$DIR")" |
| 30 | DIR="$(readlink "$(basename "$DIR")")" |
| 31 | done |
| 32 | cd "$(dirname "$DIR")" |
| 33 | DIR="$(pwd)/" |
| 34 | popd > /dev/null |
| 35 | |
| 36 | #DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )/" |
| 37 | CP="$DIR""current/" |
| 38 | |
| 39 | z="-Xmx200m" |
| 40 | z2="-Xms200m" |
| 41 | set=0 |
| 42 | |
| 43 | if [ -z "$1" ] || [[ $1 == -h ]] || [[ $1 == --help ]]; then |
| 44 | usage |
| 45 | exit |
| 46 | fi |
| 47 | |
| 48 | calcXmx () { |
| 49 | source "$DIR""/calcmem.sh" |
| 50 | setEnvironment |
| 51 | parseXmx "$@" |
| 52 | } |
| 53 | calcXmx "$@" |
| 54 | |
| 55 | function mergepgm() { |
| 56 | local CMD="java $EA $EOOM $z -cp $CP prok.PGMTools $@" |
| 57 | echo $CMD >&2 |
| 58 | eval $CMD |
| 59 | } |
| 60 | |
| 61 | mergepgm "$@" |