Debian Codegraph @

plothist.sh

raw symbols SCIP
1 #!/bin/bash
2
3 usage(){
4 echo "
5 Written by Brian Bushnell
6 Last modified November 5, 2024
7
8 Description: Generates histograms from a tile dump.
9 Also works on other 2D numeric matrices with a header.
10 Output files are automatically named from the header columns.
11
12 Usage: plothist.sh in=<input file> bins=<number>
13
14 Parameters:
15 in=<file> Input dump file.
16 bins=1000 Bins per histogram.
17 overwrite=t (ow) Set to false to force the program to abort rather than
18 overwrite an existing file.
19
20 Java Parameters:
21 -Xmx This will set Java's memory usage, overriding autodetection.
22 -Xmx20g will specify 20 gigs of RAM, and -Xmx200m will
23 specify 200 megs. The max is typically 85% of physical memory.
24 -eoom This flag will cause the process to exit if an out-of-memory
25 exception occurs. Requires Java 8u92+.
26 -da Disable assertions.
27
28 Please contact Brian Bushnell at [email protected] if you encounter any problems.
29 "
30 }
31
32 #This block allows symlinked shellscripts to correctly set classpath.
33 pushd . > /dev/null
34 DIR="${BASH_SOURCE[0]}"
35 while [ -h "$DIR" ]; do
36 cd "$(dirname "$DIR")"
37 DIR="$(readlink "$(basename "$DIR")")"
38 done
39 cd "$(dirname "$DIR")"
40 DIR="$(pwd)/"
41 popd > /dev/null
42
43 #DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )/"
44 CP="$DIR""current/"
45
46 z="-Xmx300m"
47 z2="-Xms300m"
48 set=0
49
50 if [ -z "$1" ] || [[ $1 == -h ]] || [[ $1 == --help ]]; then
51 usage
52 exit
53 fi
54
55 calcXmx () {
56 source "$DIR""/calcmem.sh"
57 setEnvironment
58 parseXmx "$@"
59 }
60 calcXmx "$@"
61
62 plothist() {
63 local CMD="java $EA $EOOM $z $z2 -cp $CP hiseq.PlotHist $@"
64 echo $CMD >&2
65 eval $CMD
66 }
67
68 plothist "$@"