-
Notifications
You must be signed in to change notification settings - Fork 77
/
bamview
executable file
·88 lines (72 loc) · 2.17 KB
/
bamview
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
#!/bin/bash -
#
# This script will start Bam View on a UNIX system.
#
QUIET=no
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 script path (inc symlinks)
#
SOURCE="${BASH_SOURCE[0]}"
while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
SOURCE="$(readlink "$SOURCE")"
[[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located
done
APPLICATION_HOME="$( cd -P "$( dirname "$SOURCE" )" && pwd )"; # get final path of this script
APPLICATION_PROPERTIES="-Djdbc.drivers=org.postgresql.Driver -Dartemis.environment=UNIX $SANGER_ARTEMIS_OPTIONS"
JAR_NAME=bamview.jar
JAR_FILE_DEFAULT=$APPLICATION_HOME/target/jars/$JAR_NAME
JAR_FILE_INSTALLED=$APPLICATION_HOME/dist/$JAR_NAME
ARTEMIS_CP=$APPLICATION_HOME:$JAR_FILE_DEFAULT:$JAR_FILE_INSTALLED
#
# Use a custom Java version if necessary
#
if [[ "$ARTEMIS_JAVA_JRE" = "" ]]
then
JAVA=`which java`
else
JAVA_HOME=$ARTEMIS_JAVA_JRE
JAVA=$ARTEMIS_JAVA_JRE/bin/java
fi
#
# Allow URLs to work from behind firewalls.
#
add_proxy_properties
#
# "-mx2g" sets the maximum amount of memory to use.
# This may need to be increased when dealing with large files
#
if [[ "$ARTEMIS_JVM_FLAGS" = "" ]]
then
FLAGS="-mx2g -ms100m -noverify"
else
FLAGS="$ARTEMIS_JVM_FLAGS -noverify"
fi
PLATTMP=`uname`
if [[ "$PLATTMP" = "Darwin" ]]
then
APPLICATION_PROPERTIES="$APPLICATION_PROPERTIES -Xdock:name=BamView"
JAR_FILE_MACAPP=$APPLICATION_HOME/Java/$JAR_NAME
ARTEMIS_CP="$JAR_FILE_MACAPP:$ARTEMIS_CP"
fi
if [[ "$QUIET" = "no" ]]
then
echo "Starting BamView with arguments: $FLAGS $APPLICATION_PROPERTIES $*"
fi
$JAVA $FLAGS $APPLICATION_PROPERTIES -cp "$ARTEMIS_CP" uk.ac.sanger.artemis.components.alignment.BamView $*
result=$?
exit $result