| 1 | #!/bin/bash |
| 2 | |
| 3 | usage(){ |
| 4 | echo " |
| 5 | Written by Brian Bushnell |
| 6 | Last modified January 21, 2025 |
| 7 | |
| 8 | Description: In progress. |
| 9 | Generates some assembly stats for multiple files. |
| 10 | |
| 11 | Usage: stats3.sh in=file |
| 12 | Or: stats3.sh in=file,file |
| 13 | Or: stats3.sh file file file |
| 14 | |
| 15 | Parameters: |
| 16 | in=file Specify the input fasta file(s), or stdin. |
| 17 | Multiple files can be lested without a 'in=' flag. |
| 18 | out=stdout Destination of primary output; may be directed to a file. |
| 19 | |
| 20 | Please contact Brian Bushnell at [email protected] if you encounter any problems. |
| 21 | " |
| 22 | } |
| 23 | |
| 24 | #This block allows symlinked shellscripts to correctly set classpath. |
| 25 | pushd . > /dev/null |
| 26 | DIR="${BASH_SOURCE[0]}" |
| 27 | while [ -h "$DIR" ]; do |
| 28 | cd "$(dirname "$DIR")" |
| 29 | DIR="$(readlink "$(basename "$DIR")")" |
| 30 | done |
| 31 | cd "$(dirname "$DIR")" |
| 32 | DIR="$(pwd)/" |
| 33 | popd > /dev/null |
| 34 | |
| 35 | #DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )/" |
| 36 | CP="$DIR""current/" |
| 37 | |
| 38 | z="-Xmx120m" |
| 39 | set=0 |
| 40 | |
| 41 | if [ -z "$1" ] || [[ $1 == -h ]] || [[ $1 == --help ]]; then |
| 42 | usage |
| 43 | exit |
| 44 | fi |
| 45 | |
| 46 | calcXmx () { |
| 47 | source "$DIR""/calcmem.sh" |
| 48 | setEnvironment |
| 49 | parseXmx "$@" |
| 50 | } |
| 51 | calcXmx "$@" |
| 52 | |
| 53 | stats() { |
| 54 | local CMD="java $EA $EOOM $z -cp $CP jgi.AssemblyStats3 $@" |
| 55 | # echo $CMD >&2 |
| 56 | eval $CMD |
| 57 | } |
| 58 | |
| 59 | stats "$@" |