| 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 December 6, 2018 |
| 7 | |
| 8 | Description: Gathers statistics on Kapa spike-in rates. |
| 9 | |
| 10 | Usage: kapastats.sh in=<input file> out=<output file> |
| 11 | |
| 12 | Parameters: |
| 13 | in=<file> TSV file of plate IDs, one ID per line. |
| 14 | out=<file> Primary output, or read 1 output. |
| 15 | overwrite=f (ow) Set to false to force the program to abort rather than |
| 16 | overwrite an existing file. |
| 17 | raw=f Output raw observations rather than statistics. |
| 18 | |
| 19 | Java Parameters: |
| 20 | -Xmx This will set Java's memory usage, overriding autodetection. |
| 21 | -Xmx20g will specify 20 gigs of RAM, and -Xmx200m will |
| 22 | specify 200 megs. The max is typically 85% of physical memory. |
| 23 | -eoom This flag will cause the process to exit if an out-of-memory |
| 24 | exception occurs. Requires Java 8u92+. |
| 25 | -da Disable assertions. |
| 26 | |
| 27 | Please contact Brian Bushnell at [email protected] if you encounter any problems. |
| 28 | " |
| 29 | } |
| 30 | |
| 31 | #This block allows symlinked shellscripts to correctly set classpath. |
| 32 | pushd . > /dev/nullscip-shell filesystem . . `/dev/null`. |
| 33 | DIR="${BASH_SOURCE[0]}" |
| 34 | while [scip-shell system . . `[`. -h "$DIR" ]; do |
| 35 | cd "$(dirnamescip-shell system . . dirname. "$DIR")" |
| 36 | DIR="$(readlinkscip-shell system . . readlink. "$(basenamescip-shell system . . basename. "$DIR")")" |
| 37 | done |
| 38 | cd "$(dirnamescip-shell system . . dirname. "$DIR")" |
| 39 | DIR="$(pwdscip-shell system . . pwd.)/" |
| 40 | popd > /dev/nullscip-shell filesystem . . `/dev/null`. |
| 41 | |
| 42 | #DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )/" |
| 43 | CP="$DIR""current/" |
| 44 | |
| 45 | z="-Xmx200m" |
| 46 | z2="-Xms200m" |
| 47 | set=0 |
| 48 | |
| 49 | if [scip-shell system . . `[`. -z "$1" ] || [[ $1 == -h ]] || [[ $1 == --help ]]; then |
| 50 | usagescip-shell shell bbmap 39.20+dfsg-3 usage(). |
| 51 | exit |
| 52 | fi |
| 53 | |
| 54 | calcXmxscip-shell shell bbmap 39.20+dfsg-3 calcXmx(). () { |
| 55 | source "$DIR""/calcmem.sh" |
| 56 | setEnvironment |
| 57 | parseXmx "$@" |
| 58 | } |
| 59 | calcXmxscip-shell shell bbmap 39.20+dfsg-3 calcXmx(). "$@" |
| 60 | |
| 61 | kapastatsscip-shell shell bbmap 39.20+dfsg-3 kapastats().() { |
| 62 | local CMD="java $EA $EOOM $z -cp $CP jgi.GatherKapaStats $@" |
| 63 | echoscip-shell system . . echo. $CMD >&2 |
| 64 | eval $CMD |
| 65 | } |
| 66 | |
| 67 | kapastatsscip-shell shell bbmap 39.20+dfsg-3 kapastats(). "$@" |