forked from hurrell-y-mottesi/phylogeneticTree
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathphylogeneticTree.sh
executable file
·68 lines (58 loc) · 1.2 KB
/
phylogeneticTree.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
usage() {
printf "Help:\n[-f] file (fasta file only name and extention)\n[-b] iqtree Boostrap\n[-h] Help\n"
}
FILENAME=
BOOSTRAP=~/sysinfo_page.html
if (($# == 0)); then
usage
exit 2
fi
while getopts ":f:b:" opt; do
case $opt in
f)
FILENAME=$OPTARG
;;
b)
BOOSTRAP=$OPTARG
;;
\?)
usage
exit 1
;;
:)
usage
exit 1
;;
esac
done
# Check if docker is installed
if [[ $(which docker) ]]
then
echo "Initial docker steps"
else
echo "You most need Docker"
exit 0
fi
# Check if volume is created
if [[ -n $(docker volume ls | grep phylogeneticTreeMapData) ]]
then
echo "Using existing volume"
else
echo "Create volume"
docker volume create --driver local \
--opt type=none \
--opt device=$(pwd)/data \
--opt o=bind \
phylogeneticTreeMapData
echo "Success create volume"
fi
# Check if image is created
if [[ -n $(docker images -q phylogenetic-tree-map) ]]
then
echo "Using existing image"
else
echo "Create image"
docker build --tag phylogenetic-tree-map .
echo "Success create image"
fi
docker run -v phylogeneticTreeMapData:/data phylogenetic-tree-map $FILENAME $BOOSTRAP