| 1 | #!/bin/bash |
| 2 | |
| 3 | usage(){ |
| 4 | echo " |
| 5 | Written by Brian Bushnell |
| 6 | Last modified September 9, 2019 |
| 7 | |
| 8 | Description: Looks at accessions to see how to compress them. |
| 9 | |
| 10 | Usage: analyzeaccession.sh *accession2taxid.gz out=<output file> |
| 11 | |
| 12 | Parameters: |
| 13 | perfile=t Use multiple threads per file and multiple files at a time. |
| 14 | |
| 15 | Java Parameters: |
| 16 | -Xmx This will set Java's memory usage, overriding autodetection. |
| 17 | -Xmx20g will specify 20 gigs of RAM, and -Xmx200m will |
| 18 | specify 200 megs. The max is typically 85% of physical memory. |
| 19 | -eoom This flag will cause the process to exit if an out-of-memory |
| 20 | exception occurs. Requires Java 8u92+. |
| 21 | -da Disable assertions. |
| 22 | |
| 23 | Please contact Brian Bushnell at [email protected] if you encounter any problems. |
| 24 | " |
| 25 | } |
| 26 | |
| 27 | #This block allows symlinked shellscripts to correctly set classpath. |
| 28 | pushd . > /dev/null |
| 29 | DIR="${BASH_SOURCE[0]}" |
| 30 | while [ -h "$DIR" ]; do |
| 31 | cd "$(dirname "$DIR")" |
| 32 | DIR="$(readlink "$(basename "$DIR")")" |
| 33 | done |
| 34 | cd "$(dirname "$DIR")" |
| 35 | DIR="$(pwd)/" |
| 36 | popd > /dev/null |
| 37 | |
| 38 | #DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )/" |
| 39 | CP="$DIR""current/" |
| 40 | |
| 41 | z="-Xmx400m" |
| 42 | z2="-Xms400m" |
| 43 | set=0 |
| 44 | |
| 45 | if [ -z "$1" ] || [[ $1 == -h ]] || [[ $1 == --help ]]; then |
| 46 | usage |
| 47 | exit |
| 48 | fi |
| 49 | |
| 50 | calcXmx () { |
| 51 | source "$DIR""/calcmem.sh" |
| 52 | setEnvironment |
| 53 | parseXmx "$@" |
| 54 | } |
| 55 | calcXmx "$@" |
| 56 | |
| 57 | a_sample_mt() { |
| 58 | local CMD="java $EA $EOOM $z -cp $CP tax.AnalyzeAccession $@" |
| 59 | echo $CMD >&2 |
| 60 | eval $CMD |
| 61 | } |
| 62 | |
| 63 | a_sample_mt "$@" |