-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathentrypoint.sh
executable file
·82 lines (73 loc) · 1.89 KB
/
entrypoint.sh
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
#!/bin/bash
# import logging functions
. /home/eden/src/lib.logging.sh
set -e
LOG_FILE="/home/eden/data/eden.log"
# initialize parameters
THREADS=2
GAP=0.7
ONLY='false'
SHINY='true'
SAMPLE=$(date +%Y-%m-%d-%T)
# generate output folder with right permissions
mkdir -p /home/eden/data/tar && chmod -R 777 /home/eden/data/tar
for i in "$@"
do
case $i in
-p=*|--processes=*)
THREADS="${i#*=}"
;;
-g=*|--gap=*)
GAP="${i#*=}"
;;
-s=*|--sample=*)
SAMPLE="${i#*=}"
;;
-t|--test)
TEST=true
;;
-n|--normal)
TEST=false
;;
-x|--noapp)
SHINY=false
;;
-z|--onlyapp)
ONLY=true
;;
*)
echo "Unknown option"
;;
esac
done
readonly THREADS
readonly TEST
readonly SAMPLE
readonly GAP
readonly ONLY
if [ "$ONLY" = true ]; then
echo "Test"
echo "Test" > /home/eden/testfile.txt
# # clean up input files
# echocolor "Started. Visit http://localhost:3838/eden-visualizer"
# nohup shiny-server > my.log 2>&1&
# echo $! > /home/eden/pid.txt
else
# check groups.txt
./check.sh --faa_folder data/faa --ffn_folder data/ffn --cpu "$THREADS" --hmmfile data/annotation/annotation.hmm --output data/ko --gfam data/groups.txt
# check if the test mode is enabled
if [ "$TEST" = true ]; then
./eden.sh --docker --cpu_number "$THREADS" --gap_threshold "$GAP" --test --name "$SAMPLE"
else
./eden.sh --docker --cpu_number "$THREADS" --gap_threshold "$GAP" --name "$SAMPLE"
fi
# start docker in background
echocolor "[Please cite: Münch P.C. et. al, EDEN: evolutionary dynamics within environments]"
if [ "$SHINY" = true ]; then
echocolor "Starting server, please visit http://localhost:3838/eden-visualizer"
nohup shiny-server > my.log 2>&1 &
echo $! > /home/eden/pid.txt
else
echocolor "No shiny server started due to the -x or --noapp mode"
fi
fi