annotate result_analyser.sh @ 5:795f289b64db draft

First complete upload, containing the datatype TAR.
author da-intersect
date Wed, 10 Apr 2013 02:41:02 -0400
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
5
795f289b64db First complete upload, containing the datatype TAR.
da-intersect
parents:
diff changeset
1 #!/bin/bash
795f289b64db First complete upload, containing the datatype TAR.
da-intersect
parents:
diff changeset
2
795f289b64db First complete upload, containing the datatype TAR.
da-intersect
parents:
diff changeset
3 if (type -p java >> /dev/null); then
795f289b64db First complete upload, containing the datatype TAR.
da-intersect
parents:
diff changeset
4 _java=java
795f289b64db First complete upload, containing the datatype TAR.
da-intersect
parents:
diff changeset
5 elif [[ -n "$JAVA_HOME" ]] && [[ -x "$JAVA_HOME/bin/java" ]]; then
795f289b64db First complete upload, containing the datatype TAR.
da-intersect
parents:
diff changeset
6 _java="$JAVA_HOME/bin/java"
795f289b64db First complete upload, containing the datatype TAR.
da-intersect
parents:
diff changeset
7 else
795f289b64db First complete upload, containing the datatype TAR.
da-intersect
parents:
diff changeset
8 echo "You must install java before runing this tool"
795f289b64db First complete upload, containing the datatype TAR.
da-intersect
parents:
diff changeset
9 exit 1
795f289b64db First complete upload, containing the datatype TAR.
da-intersect
parents:
diff changeset
10 fi
795f289b64db First complete upload, containing the datatype TAR.
da-intersect
parents:
diff changeset
11
795f289b64db First complete upload, containing the datatype TAR.
da-intersect
parents:
diff changeset
12 if [[ "$_java" ]]; then
795f289b64db First complete upload, containing the datatype TAR.
da-intersect
parents:
diff changeset
13 version=$("$_java" -version 2>&1 | awk -F '"' '/version/ {print $2}')
795f289b64db First complete upload, containing the datatype TAR.
da-intersect
parents:
diff changeset
14 if ! [[ "$version" > "1.6" ]]; then
795f289b64db First complete upload, containing the datatype TAR.
da-intersect
parents:
diff changeset
15 echo "Java version should be > 1.6"
795f289b64db First complete upload, containing the datatype TAR.
da-intersect
parents:
diff changeset
16 exit 1
795f289b64db First complete upload, containing the datatype TAR.
da-intersect
parents:
diff changeset
17 fi
795f289b64db First complete upload, containing the datatype TAR.
da-intersect
parents:
diff changeset
18 fi
795f289b64db First complete upload, containing the datatype TAR.
da-intersect
parents:
diff changeset
19
795f289b64db First complete upload, containing the datatype TAR.
da-intersect
parents:
diff changeset
20 if [ $# -eq 0 ]
795f289b64db First complete upload, containing the datatype TAR.
da-intersect
parents:
diff changeset
21 then
795f289b64db First complete upload, containing the datatype TAR.
da-intersect
parents:
diff changeset
22 echo "USAGE ap11Runner.sh APPNAME [ARGS]";
795f289b64db First complete upload, containing the datatype TAR.
da-intersect
parents:
diff changeset
23 exit;
795f289b64db First complete upload, containing the datatype TAR.
da-intersect
parents:
diff changeset
24 fi
795f289b64db First complete upload, containing the datatype TAR.
da-intersect
parents:
diff changeset
25
795f289b64db First complete upload, containing the datatype TAR.
da-intersect
parents:
diff changeset
26 DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
795f289b64db First complete upload, containing the datatype TAR.
da-intersect
parents:
diff changeset
27
795f289b64db First complete upload, containing the datatype TAR.
da-intersect
parents:
diff changeset
28 jar_path="${DIR}/jars/${1}"
795f289b64db First complete upload, containing the datatype TAR.
da-intersect
parents:
diff changeset
29 chr_path="${DIR}/chromosome"
795f289b64db First complete upload, containing the datatype TAR.
da-intersect
parents:
diff changeset
30 shift
795f289b64db First complete upload, containing the datatype TAR.
da-intersect
parents:
diff changeset
31 tar_file="$1"
795f289b64db First complete upload, containing the datatype TAR.
da-intersect
parents:
diff changeset
32 shift
795f289b64db First complete upload, containing the datatype TAR.
da-intersect
parents:
diff changeset
33 temp_dir=$(basename "$tar_file")
795f289b64db First complete upload, containing the datatype TAR.
da-intersect
parents:
diff changeset
34
795f289b64db First complete upload, containing the datatype TAR.
da-intersect
parents:
diff changeset
35 mkdir -p /tmp/$temp_dir
795f289b64db First complete upload, containing the datatype TAR.
da-intersect
parents:
diff changeset
36
795f289b64db First complete upload, containing the datatype TAR.
da-intersect
parents:
diff changeset
37 tar -C /tmp/$temp_dir -xvf $tar_file
795f289b64db First complete upload, containing the datatype TAR.
da-intersect
parents:
diff changeset
38 java -jar $jar_path $@ -c "/tmp/$temp_dir"
795f289b64db First complete upload, containing the datatype TAR.
da-intersect
parents:
diff changeset
39 rm -rf "/tmp/$temp_dir"