Debian Codegraph @

tiledump.sh

raw symbols SCIP
1 #!/bin/bash
2
3 usage(){
4 echo "
5 Written by Brian Bushnell
6 Last modified November 14, 2024
7
8 Description: Processes a tile dump from FilterByTile.
9
10 Usage: tiledump.sh in=<input file> out=<output file>
11
12 Standard parameters:
13 in=<file> Input dump file.
14 out=<file> Output dump file.
15 overwrite=t (ow) Set to false to force the program to abort rather than
16 overwrite an existing file.
17
18 Processing parameters:
19 x=-1 Widen tiles to at least this X width.
20 y=-1 Widen tiles to at least this Y width.
21 reads=-1 Widen tiles to at least this average number of reads.
22 alignedreads=250 Average aligned reads per tile for error rate calibration.
23
24 Java Parameters:
25 -Xmx This will set Java's memory usage, overriding autodetection.
26 -Xmx20g will specify 20 gigs of RAM, and -Xmx200m will
27 specify 200 megs. The max is typically 85% of physical memory.
28 -eoom This flag will cause the process to exit if an out-of-memory
29 exception occurs. Requires Java 8u92+.
30 -da Disable assertions.
31
32 Please contact Brian Bushnell at [email protected] if you encounter any problems.
33 "
34 }
35
36 #This block allows symlinked shellscripts to correctly set classpath.
37 pushd . > /dev/null
38 DIR="${BASH_SOURCE[0]}"
39 while [ -h "$DIR" ]; do
40 cd "$(dirname "$DIR")"
41 DIR="$(readlink "$(basename "$DIR")")"
42 done
43 cd "$(dirname "$DIR")"
44 DIR="$(pwd)/"
45 popd > /dev/null
46
47 #DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )/"
48 CP="$DIR""current/"
49
50 z="-Xmx4g"
51 z2="-Xms4g"
52 set=0
53
54 if [ -z "$1" ] || [[ $1 == -h ]] || [[ $1 == --help ]]; then
55 usage
56 exit
57 fi
58
59 calcXmx () {
60 source "$DIR""/calcmem.sh"
61 setEnvironment
62 parseXmx "$@"
63 if [[ $set == 1 ]]; then
64 return
65 fi
66 freeRam 4000m 48
67 z="-Xmx${RAM}m"
68 z2="-Xms${RAM}m"
69 }
70 calcXmx "$@"
71
72 tiledump() {
73 local CMD="java $EA $EOOM $z -cp $CP hiseq.TileDump $@"
74 echo $CMD >&2
75 eval $CMD
76 }
77
78 tiledump "$@"