Newer
Older
“kpepper”
committed
#!/bin/bash -
“kpepper”
committed
#
# This script will start the Artemis circular plot on a UNIX system.
#
“kpepper”
committed
QUIET=no
“kpepper”
committed
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
usage () {
echo "SYNOPSIS"
echo " DNA Plotter: DNA Image Generation Tool"
echo "USAGE"
echo " $0 [options]"
echo "OPTIONS"
echo " -t FILE Read a template file"
echo
echo "EXAMPLES"
echo " % dnaplotter"
echo " % dnaplotter -t <template file>"
echo
echo "HOMEPAGE"
echo " http://www.sanger.ac.uk/science/tools/dnaplotter/"
echo
exit 1
}
add_proxy_properties() {
if [[ "$http_proxy" = "" ]]
then
http_proxy=$HTTP_PROXY
fi
if [[ "$http_proxy" = "" ]]
then
http_proxy=$HTTP_proxy
fi
if [[ "$http_proxy" != "" ]]
then
APPLICATION_PROPERTIES="$APPLICATION_PROPERTIES -DproxySet=true "`echo $http_proxy | sed 's/http:\/\/\(.*\):\(.*\)/ -Dhttp.proxyHost=\1 -Dhttp.proxyPort=\2/'`
fi
}
#
# Resolve links - $0 may be a link
#
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '.*/.*' > /dev/null; then
PRG="$link"
else
PRG="`dirname $PRG`/$link"
fi
done
#
# Parse arguments.
#
TEMPLATE_FILE_ARG=
APPLICATION_PROPERTIES="-Djdbc.drivers=org.postgresql.Driver -Dartemis.environment=UNIX $SANGER_ARTEMIS_OPTIONS"
while test $# != 0
do
case $1 in
-t) TEMPLATE_FILE_ARG="$1 $2"; shift ;;
-D*) APPLICATION_PROPERTIES="$APPLICATION_PROPERTIES $1" ;;
-quiet) QUIET=yes ; APPLICATION_PROPERTIES="$APPLICATION_PROPERTIES -Drun_quietly=true" ;;
-help) usage ;;
--help) usage ;;
-h) usage ;;
*) usage ;;
esac
shift
done
APPLICATION_HOME=`dirname "$PRG"`
JAR_FILE_DEFAULT=$APPLICATION_HOME/target/unix-jars/$JAR_NAME
JAR_FILE_INSTALLED=$APPLICATION_HOME/$JAR_NAME
“kpepper”
committed
#
# Use a custom Java version if necessary
#
if [[ "$ARTEMIS_JAVA_JRE" = "" ]]
“kpepper”
committed
JAVA=`which java`
else
JAVA_HOME=$ARTEMIS_JAVA_JRE
JAVA=$ARTEMIS_JAVA_JRE/bin/java
“kpepper”
committed
#
# Allow URLs to work from behind firewalls.
#
add_proxy_properties
“kpepper”
committed
#
# "-mx1g" sets the maximum amount of memory to use.
# This may need to be increased when dealing with large files
#
if [[ "$ARTEMIS_JVM_FLAGS" = "" ]]
“kpepper”
committed
FLAGS="$ARTEMIS_JVM_FLAGS -noverify"
“kpepper”
committed
PLATTMP=`uname`
if [[ "$PLATTMP" = "Darwin" ]]
APPLICATION_PROPERTIES="$APPLICATION_PROPERTIES -Dapple.laf.useScreenMenuBar=true -Xdock:name=Circular-Plot"
“kpepper”
committed
if [[ "$QUIET" = "no" ]]
“kpepper”
committed
echo "Starting DNA Plotter with arguments: $FLAGS $APPLICATION_PROPERTIES $TEMPLATE_FILE_ARG"
$JAVA $FLAGS $APPLICATION_PROPERTIES -cp "$APPLICATION_HOME:$JAR_FILE_DEFAULT:$JAR_FILE_INSTALLED" uk.ac.sanger.artemis.circular.DNADraw $TEMPLATE_FILE_ARG