-
Notifications
You must be signed in to change notification settings - Fork 2
/
goby
executable file
·59 lines (54 loc) · 2.3 KB
/
goby
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#!/bin/bash
# This script runs Goby with the specified amount of memory.
# The script will find the Goby jar if it is located in the same directory as this script
# Usage: goby mem-requirement mode-name [param]+
# Where mem-requirement indicates how much memory Goby should be given (e.g., 1g, 500m).
# Mode-name should specify a Goby mode.
# For instance, the following command will display the Goby version number:
# goby 40m version
if [ $# -lt 1 ]; then
echo "The first argument must be memory (i.e., goby 4g)"
exit 1
fi
memory_requirement=$1
shift
other_parameters=$*
set +x
WORKING_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
if [[ $OSTYPE == "cygwin" ]]; then
WORKING_DIR=`cygpath -m "${WORKING_DIR}"`
fi
export GOBY_HOME=${WORKING_DIR}
GOBY_JAR=${GOBY_HOME}/goby.jar
SLF4J_CONFIG=${GOBY_HOME}/config/goby-logback.xml
if [ ! -z ${GOBY_USE_RJAVA} ]; then
if [ "${RJAVA_HOME:-notset}" == "notset" ]; then
#echo "Trying to set RJAVA_HOME environment variable"
cat >/tmp/r-cmd.txt <<EOT
system.file("jri",package="rJava")
EOT
tmpWithQuotes=`R --no-save </tmp/r-cmd.txt|grep [1]|tail -1 |awk '{print $2}'`
temp="${tmpWithQuotes%\"}"
temp="${temp#\"}"
# echo "$temp"
export RJAVA_HOME=${temp}
rm -f /tmp/r-cmd.txt
fi
fi
DL_SOMATIC_CLASSPATH=${GOBY_HOME}/somatic.jar
if [ ! -e "${DL_SOMATIC_CLASSPATH}" ]; then
echo "Model somatic.jar not found. It must be installed at ${GOBY_HOME}/somatic.jar"
fi
DL_GENOTYPE_CLASSPATH=${GOBY_HOME}/genotype.jar
if [ ! -e "${DL_SOMATIC_CLASSPATH}" ]; then
echo "Model genotype.jar not found. It must be installed at ${GOBY_HOME}/genotype.jar"
fi
DL_FRAMEWORK_CLASSPATH=${GOBY_HOME}/framework.jar
if [ ! -e "${DL_FRAMEWORK_CLASSPATH}" ]; then
echo "Model framework.jar not found. It must be installed at ${GOBY_HOME}/framework.jar"
fi
#echo java -ea -Xmx${memory_requirement} -Dlog4j.configuration=${LOG4J_PROPS} -Djava.library.path=${RJAVA_HOME} -jar ${GOBY_JAR} --mode ${other_parameters}
java -ea -Djava.ext.dirs=${GOBY_HOME}/ -Xmx${memory_requirement} -Dlogback.configurationFile=${SLF4J_CONFIG} -Djava.library.path=${RJAVA_HOME} -jar ${GOBY_JAR} --mode ${other_parameters}
if [ $# -lt 2 ]; then
echo "The second argument must be the goby mode you want to run (i.e., goby 1g version). See list of modes in help above."
fi