-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.sh
79 lines (57 loc) · 2.68 KB
/
main.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
#!/bin/bash
function parse_yaml {
local prefix=$2
local s='[[:space:]]*' w='[a-zA-Z0-9_]*' fs=$(echo @|tr @ '\034')
sed -ne "s|^\($s\):|\1|" \
-e "s|^\($s\)\($w\)$s:$s[\"']\(.*\)[\"']$s\$|\1$fs\2$fs\3|p" \
-e "s|^\($s\)\($w\)$s:$s\(.*\)$s\$|\1$fs\2$fs\3|p" $1 |
awk -F$fs '{
indent = length($1)/2;
vname[indent] = $2;
for (i in vname) {if (i > indent) {delete vname[i]}}
if (length($3) > 0) {
vn=""; for (i=0; i<indent; i++) {vn=(vn)(vname[i])("_")}
printf("%s%s%s=\"%s\"\n", "'$prefix'",vn, $2, $3);
}
}'
}
eval $(parse_yaml Config.yaml)
export PATH=$( dirname $( dirname $( /usr/bin/which conda ) ) )/bin:$PATH
export PYTHONPATH=$PWD
export AMR_HOME=$( dirname $( realpath ${BASH_SOURCE[0]} ) )
export PATH=$AMR_HOME:$AMR_HOME/main:$PATH
echo 'AMR_HOME is '$AMR_HOME
#echo "Software: ${Software} "
source activate ${main_env}
if [[ ${dryrun} == "Y" ]]; then
########################################################################################################################
if [[ ${Software} == *"PhenotypeSeeker"* ]]; then
snakemake --cores ${n_jobs} -s ./workflow/phenotypeseeker.smk --directory $AMR_HOME --use-conda --dry-run
fi
if [[ ${Software} == *"Kover"* ]]; then
snakemake --cores ${n_jobs} -s ./workflow/kover.smk --directory $AMR_HOME --use-conda --dry-run
fi
if [[ ${Software} == *"ResFinder"* ]]; then
snakemake --cores ${n_jobs} -s ./workflow/resfinder.smk --directory $AMR_HOME --use-conda --dry-run
fi
########################################################################################################################
else
########################################################################################################################
if [[ ${Software} == *"PhenotypeSeeker"* ]]; then
echo "Software: PhenotypeSeeker "
snakemake --cores ${n_jobs} -s ./workflow/phenotypeseeker.smk --directory $AMR_HOME --use-conda
fi
if [[ ${Software} == *"Kover"* ]]; then
echo "Software: Kover "
snakemake --cores ${n_jobs} -s ./workflow/kover.smk --directory $AMR_HOME --use-conda
fi
if [[ ${Software} == *"ResFinder"* ]]; then
echo "Software: ResFinder "
snakemake --cores ${n_jobs} -s ./workflow/resfinder.smk --directory $AMR_HOME --use-conda
fi
if [[ ${Software} == *"voting"* ]]; then
echo "Software: voting "
snakemake --cores ${n_jobs} -s ./workflow/voting.smk --directory $AMR_HOME --use-conda
fi
########################################################################################################################
fi