-
Notifications
You must be signed in to change notification settings - Fork 2
/
runMe.sh
executable file
·143 lines (117 loc) · 4.04 KB
/
runMe.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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
#!/bin/bash
FDA_PATH=$(pwd)
APP_PATH=${FDA_PATH}/app
COOCCUR_DOCKER_IMAGE_NAME=brcachallenge/federated-analysis:cooccurrence
PATHOLOGY_DOCKER_IMAGE_NAME=brcachallenge/federated-analysis:pathology
if [ $# -eq 0 ]
then
echo "example: $0 -c 13 -p True -dd $(pwd)/examples/BRCA2/data -cd $(pwd)/examples/BRCA2/config -vf brca2.vcf -vpf clinvar_brca2.tsv -gf gnomad_chr13_brca2.vcf -rc brca2-report-config.json -g BRCA2 -spf brca2-pathology.tsv -hg 38"
exit 1
else
for arg in "$@"
do
case $arg in
-gf |--gnomadFile)
GNOMAD_FILE="$2"
shift # Remove argument name from processing
shift # Remove argument value from processing
;;
-rc |--reportConfig)
CONFIG_FILE="$2"
shift # Remove argument name from processing
shift # Remove argument value from processing
;;
-vf|--vcfFile)
VCF_FILE="$2"
shift # Remove argument name from processing
shift # Remove argument value from processing
;;
-hg|--hgVersion)
HG_VERSION="$2"
shift # Remove argument name from processing
shift # Remove argument value from processing
;;
-er|--ensemblRelease)
ENSEMBL_RELEASE="$2"
shift # Remove argument name from processing
shift # Remove argument value from processing
;;
-c|--chromosome)
CHROM="$2"
shift # Remove argument name from processing
shift # Remove argument value from processing
;;
-p|--phased)
PHASED="$2"
shift # Remove argument name from processing
shift # Remove argument value from processing
;;
-p2|--p2)
P2="$2"
shift # Remove argument name from processing
shift # Remove argument value from processing
;;
-g|--gene)
GENE="$2"
shift # Remove argument name from processing
shift # Remove argument value from processing
;;
-vpf|--variantPathogenicityFile)
PATHOGENICITY_FILE="$2"
shift # Remove argument name from processing
shift # Remove argument value from processing
;;
-dd|--dataDirectory)
DATA_PATH="$2"
shift # Remove argument name from processing
shift # Remove argument value from processing
;;
-cd|--confDirectory)
CONF_PATH="$2"
shift # Remove argument name from processing
shift # Remove argument value from processing
;;
-st|--saveTempfiles)
SAVE_FILES="$2"
shift # Remove argument name from processing
shift # Remove argument value from processing
;;
-spf|--samplePhenotypeFile)
PHENOTYPE_FILE="$2"
shift # Remove argument name from processing
shift # Remove argument value from processing
;;
*)
#echo "wrong usage: $0 $@"
#exit 1
;;
esac
done
if [ -n "$CONFIG_FILE" ]
then
docker build -t ${PATHOLOGY_DOCKER_IMAGE_NAME} - < docker/pathology/Dockerfile
docker run --rm -e PYTHONPATH=/ -e PYTHONIOENCODING=UTF-8 -w / --user=`id -u`:`id -g` -v ${APP_PATH}/pathology:/app:ro -v ${CONF_PATH}:/config -v "${DATA_PATH}":/data ${PATHOLOGY_DOCKER_IMAGE_NAME} /usr/bin/python3 /app/dataAnalyzer.py -c /config/$CONFIG_FILE
fi
docker build -t ${COOCCUR_DOCKER_IMAGE_NAME} - < docker/cooccurrence/Dockerfile
if [ -z "$HG_VERSION" ]
then
HG_VERSION=38
fi
if [ -z "$ENSEMBL_RELEASE" ]
then
ENSEMBL_RELEASE=99
fi
if [ -z "$SAVE_FILES" ]
then
SAVE_FILES=False
fi
if [ -z "$P2" ]
then
P2=0.001
fi
if [ -z "PHENOTYPE_FILE" ]
then
PHENOTYPE_FILE=""
fi
docker run --rm -e PYTHONPATH=/ -e PYTHONIOENCODING=UTF-8 --user=`id -u`:`id -g` -v ${APP_PATH}/cooccurrence:/app:ro -v ${CONF_PATH}:/config -v "${DATA_PATH}":/data:rw ${COOCCUR_DOCKER_IMAGE_NAME} /usr/bin/python3 /app/cooccurrenceFinder.py --vcf $VCF_FILE --h $HG_VERSION --e $ENSEMBL_RELEASE --c $CHROM --p $PHASED --p2 $P2 --g $GENE --vpf $PATHOGENICITY_FILE --d /var/tmp/pyensembl-cache --data /data --save $SAVE_FILES --spf "$PHENOTYPE_FILE" --gf "$GNOMAD_FILE"
fi