jpayne@69: #!/bin/bash jpayne@69: jpayne@69: usage(){ jpayne@69: echo " jpayne@69: Written by Brian Bushnell jpayne@69: Last modified August 9, 2018 jpayne@69: jpayne@69: Description: Generates statistics about flowcell positions. jpayne@69: jpayne@69: Usage: plotflowcell.sh in= out= jpayne@69: jpayne@69: Input parameters: jpayne@69: in= Primary input file. jpayne@69: in2= Second input file for paired reads in two files. jpayne@69: indump= Specify an already-made dump file to use instead of jpayne@69: analyzing the input reads. jpayne@69: reads=-1 Process this number of reads, then quit (-1 means all). jpayne@69: interleaved=auto Set true/false to override autodetection of the jpayne@69: input file as paired interleaved. jpayne@69: jpayne@69: Output parameters: jpayne@69: out= Output file for filtered reads. jpayne@69: dump= Write a summary of quality information by coordinates. jpayne@69: jpayne@69: Tile parameters: jpayne@69: xsize=500 Initial width of micro-tiles. jpayne@69: ysize=500 Initial height of micro-tiles. jpayne@69: size= Allows setting xsize and ysize tot he same value. jpayne@69: target=800 Iteratively increase the size of micro-tiles until they jpayne@69: contain an average of at least this number of reads. jpayne@69: jpayne@69: Other parameters: jpayne@69: trimq=-1 If set to a positive number, trim reads to that quality jpayne@69: level instead of filtering them. jpayne@69: qtrim=r If trimq is positive, to quality trimming on this end jpayne@69: of the reads. Values are r, l, and rl for right, jpayne@69: left, and both ends. jpayne@69: jpayne@69: Java Parameters: jpayne@69: -Xmx This will set Java's memory usage, overriding autodetection. jpayne@69: -Xmx20g will specify 20 GB of RAM; -Xmx200m will specify jpayne@69: 200 MB. The max is typically 85% of physical memory. jpayne@69: -eoom This flag will cause the process to exit if an jpayne@69: out-of-memory exception occurs. Requires Java 8u92+. jpayne@69: -da Disable assertions. jpayne@69: jpayne@69: Please contact Brian Bushnell at bbushnell@lbl.gov if you encounter any problems. jpayne@69: " jpayne@69: } jpayne@69: jpayne@69: #This block allows symlinked shellscripts to correctly set classpath. jpayne@69: pushd . > /dev/null jpayne@69: DIR="${BASH_SOURCE[0]}" jpayne@69: while [ -h "$DIR" ]; do jpayne@69: cd "$(dirname "$DIR")" jpayne@69: DIR="$(readlink "$(basename "$DIR")")" jpayne@69: done jpayne@69: cd "$(dirname "$DIR")" jpayne@69: DIR="$(pwd)/" jpayne@69: popd > /dev/null jpayne@69: jpayne@69: #DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )/" jpayne@69: CP="$DIR""current/" jpayne@69: jpayne@69: z="-Xmx8g" jpayne@69: z2="-Xms8g" jpayne@69: set=0 jpayne@69: jpayne@69: if [ -z "$1" ] || [[ $1 == -h ]] || [[ $1 == --help ]]; then jpayne@69: usage jpayne@69: exit jpayne@69: fi jpayne@69: jpayne@69: calcXmx () { jpayne@69: source "$DIR""/calcmem.sh" jpayne@69: setEnvironment jpayne@69: parseXmx "$@" jpayne@69: if [[ $set == 1 ]]; then jpayne@69: return jpayne@69: fi jpayne@69: freeRam 3200m 84 jpayne@69: z="-Xmx${RAM}m" jpayne@69: z2="-Xms${RAM}m" jpayne@69: } jpayne@69: calcXmx "$@" jpayne@69: jpayne@69: plotflowcell() { jpayne@69: local CMD="java $EA $EOOM $z $z2 -cp $CP hiseq.PlotFlowCell $@" jpayne@69: echo $CMD >&2 jpayne@69: eval $CMD jpayne@69: } jpayne@69: jpayne@69: plotflowcell "$@"