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