| 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 August 9, 2018 |
| 7 | |
| 8 | Description: Generates statistics about flowcell positions. |
| 9 | Seems entirely superceded by filterbytile now; to be removed after 39.12. |
| 10 | |
| 11 | Usage: plotflowcell.sh in=<input> out=<output> |
| 12 | |
| 13 | Input parameters: |
| 14 | in=<file> Primary input file. |
| 15 | in2=<file> Second input file for paired reads in two files. |
| 16 | indump=<file> Specify an already-made dump file to use instead of |
| 17 | analyzing the input reads. |
| 18 | reads=-1 Process this number of reads, then quit (-1 means all). |
| 19 | interleaved=auto Set true/false to override autodetection of the |
| 20 | input file as paired interleaved. |
| 21 | |
| 22 | Output parameters: |
| 23 | out=<file> Output file for filtered reads. |
| 24 | dump=<file> Write a summary of quality information by coordinates. |
| 25 | |
| 26 | Tile parameters: |
| 27 | xsize=500 Initial width of micro-tiles. |
| 28 | ysize=500 Initial height of micro-tiles. |
| 29 | size= Allows setting xsize and ysize tot he same value. |
| 30 | target=800 Iteratively increase the size of micro-tiles until they |
| 31 | contain an average of at least this number of reads. |
| 32 | |
| 33 | Other parameters: |
| 34 | trimq=-1 If set to a positive number, trim reads to that quality |
| 35 | level instead of filtering them. |
| 36 | qtrim=r If trimq is positive, to quality trimming on this end |
| 37 | of the reads. Values are r, l, and rl for right, |
| 38 | left, and both ends. |
| 39 | |
| 40 | Java Parameters: |
| 41 | -Xmx This will set Java's memory usage, overriding autodetection. |
| 42 | -Xmx20g will specify 20 GB of RAM; -Xmx200m will specify |
| 43 | 200 MB. The max is typically 85% of physical memory. |
| 44 | -eoom This flag will cause the process to exit if an |
| 45 | out-of-memory exception occurs. Requires Java 8u92+. |
| 46 | -da Disable assertions. |
| 47 | |
| 48 | Please contact Brian Bushnell at [email protected] if you encounter any problems. |
| 49 | " |
| 50 | } |
| 51 | |
| 52 | #This block allows symlinked shellscripts to correctly set classpath. |
| 53 | pushd . > /dev/nullscip-shell filesystem . . `/dev/null`. |
| 54 | DIR="${BASH_SOURCE[0]}" |
| 55 | while [scip-shell system . . `[`. -h "$DIR" ]; do |
| 56 | cd "$(dirnamescip-shell system . . dirname. "$DIR")" |
| 57 | DIR="$(readlinkscip-shell system . . readlink. "$(basenamescip-shell system . . basename. "$DIR")")" |
| 58 | done |
| 59 | cd "$(dirnamescip-shell system . . dirname. "$DIR")" |
| 60 | DIR="$(pwdscip-shell system . . pwd.)/" |
| 61 | popd > /dev/nullscip-shell filesystem . . `/dev/null`. |
| 62 | |
| 63 | #DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )/" |
| 64 | CP="$DIR""current/" |
| 65 | |
| 66 | z="-Xmx8g" |
| 67 | z2="-Xms8g" |
| 68 | set=0 |
| 69 | |
| 70 | if [scip-shell system . . `[`. -z "$1" ] || [[ $1 == -h ]] || [[ $1 == --help ]]; then |
| 71 | usagescip-shell shell bbmap 39.20+dfsg-3 usage(). |
| 72 | exit |
| 73 | fi |
| 74 | |
| 75 | calcXmxscip-shell shell bbmap 39.20+dfsg-3 calcXmx(). () { |
| 76 | source "$DIR""/calcmem.sh" |
| 77 | setEnvironment |
| 78 | parseXmx "$@" |
| 79 | if [[ $set == 1 ]]; then |
| 80 | return |
| 81 | fi |
| 82 | freeRam 3200m 84 |
| 83 | z="-Xmx${RAM}m" |
| 84 | z2="-Xms${RAM}m" |
| 85 | } |
| 86 | calcXmxscip-shell shell bbmap 39.20+dfsg-3 calcXmx(). "$@" |
| 87 | |
| 88 | plotflowcellscip-shell shell bbmap 39.20+dfsg-3 plotflowcell().() { |
| 89 | local CMD="java $EA $EOOM $z $z2 -cp $CP hiseq.PlotFlowCell $@" |
| 90 | echoscip-shell system . . echo. $CMD >&2 |
| 91 | eval $CMD |
| 92 | } |
| 93 | |
| 94 | plotflowcellscip-shell shell bbmap 39.20+dfsg-3 plotflowcell(). "$@" |