forked from kircherlab/CADD-scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.sh
executable file
·392 lines (347 loc) · 13.5 KB
/
install.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
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
#!/bin/bash
set -e
echo "CADD-v1.5 (c) University of Washington, Hudson-Alpha Institute for Biotechnology and Berlin Institute of Health 2013-2019. All rights reserved."
echo ""
SCRIPT=$(readlink -f "$0")
BASEDIR=$(dirname "$SCRIPT")
cd $BASEDIR
# check whether conda and snakemake are available
if [ "$(type conda)" == '' ]
then
echo 'Conda seems not to be available. Are you sure conda is installed and available in the current $PATH ?';
exit 1;
fi
echo "The following questions will quide you through selecting the files and dependencies needed for CADD."
echo "After this, you will see an overview of the selected files before the download and installation starts."
echo "Please note, that for successfully running CADD locally, you will need the conda environment and at least one set of annotations."
echo ""
# ask which parts of CADD the user wants to install
read -p "Do you want to install the virtual environment with all CADD dependencies via conda? (y)/n " CHOICE
case "$CHOICE" in
y|Y ) ENV=true;;
n|N ) ENV=false;;
* ) ENV=true; echo "Assuming Yes.";;
esac
read -p "Do you want to install CADD v1.5 for GRCh38/hg38? (y)/n " CHOICE
case "$CHOICE" in
y|Y ) GRCh38v15=true;;
n|N ) GRCh38v15=false;;
* ) GRCh38v15=true; echo "Assuming Yes.";;
esac
read -p "Do you want to install CADD v1.4 for GRCh37/hg19? (y)/n " CHOICE
case "$CHOICE" in
y|Y ) GRCh37=true;;
n|N ) GRCh37=false;;
* ) GRCh37=true; echo "Assuming Yes.";;
esac
read -p "Do you want to install CADD v1.4 for GRCh38/hg38? Note that this version has been replaced by CADD v1.5 y/(n) " CHOICE
case "$CHOICE" in
y|Y ) GRCh38=true;;
n|N ) GRCh38=false;;
* ) GRCh38=false; echo "Assuming No.";;
esac
if [ "$GRCh37" = false ] && [ "$GRCh38" = false ] && [ "$GRCh38v15" = false ]
then
echo "You have choosen to not install any of the available CADD models. Discontinuing installation.";
exit 0;
fi
read -p "Do you want to load annotations (Annotations can also be downloaded manually from the website)? (y)/n " CHOICE
case "$CHOICE" in
y|Y ) ANNOTATIONS=true;;
n|N ) ANNOTATIONS=false;;
* ) ANNOTATIONS=true; echo "Assuming Yes.";;
esac
read -p "Do you want to load prescored variants (Makes SNV calling faster. Can also be loaded/installed later.)? y/(n) " CHOICE
case "$CHOICE" in
y|Y ) PRESCORE=true;;
n|N ) PRESCORE=false;;
* ) PRESCORE=false; echo "Assuming No.";;
esac
if [ "$PRESCORE" = true ]
then
read -p "Do you want to load prescored variants for scoring with annotations (Warning: These files are very big)? y/(n) " CHOICE
case "$CHOICE" in
y|Y ) INCANNO=true;;
n|N ) INCANNO=false;;
* ) INCANNO=false; echo "Assuming No.";;
esac
read -p "Do you want to load prescored variants for scoring without annotations? y/(n) " CHOICE
case "$CHOICE" in
y|Y ) NOANNO=true;;
n|N ) NOCANNO=false;;
* ) NOANNO=false; echo "Assuming No.";;
esac
read -p "Do you also want to load prescored InDels? We provide scores for well known InDels from sources like ClinVar, gnomAD/TOPMed etc. y/(n) " CHOICE
case "$CHOICE" in
y|Y ) INDELS=true;;
n|N ) INDELS=false;;
* ) INDELS=false; echo "Assuming No.";;
esac
fi
### FILE CONFIGURATION
ANNOTATION_GRCh37="http://krishna.gs.washington.edu/download/CADD/v1.4/GRCh37/annotationsGRCh37.tar.gz"
ANNOTATION_GRCh38="http://krishna.gs.washington.edu/download/CADD/v1.4/GRCh38/annotationsGRCh38.tar.gz"
ANNOTATION_GRCh38v15="http://krishna.gs.washington.edu/download/CADD/v1.5/GRCh38/annotationsGRCh38.tar.gz"
PRESCORE_GRCh37="http://krishna.gs.washington.edu/download/CADD/v1.4/GRCh37/whole_genome_SNVs.tsv.gz"
PRESCORE_GRCh38="http://krishna.gs.washington.edu/download/CADD/v1.4/GRCh38/whole_genome_SNVs.tsv.gz"
PRESCORE_GRCh38v15="http://krishna.gs.washington.edu/download/CADD/v1.5/GRCh38/whole_genome_SNVs.tsv.gz"
PRESCORE_INCANNO_GRCh37="http://krishna.gs.washington.edu/download/CADD/v1.4/GRCh37/whole_genome_SNVs_inclAnno.tsv.gz"
PRESCORE_INCANNO_GRCh38="http://krishna.gs.washington.edu/download/CADD/v1.4/GRCh38/whole_genome_SNVs_inclAnno.tsv.gz"
PRESCORE_INCANNO_GRCh38v15="http://krishna.gs.washington.edu/download/CADD/v1.5/GRCh38/whole_genome_SNVs_inclAnno.tsv.gz"
PRESCORE_GRCh37_INDEL="http://krishna.gs.washington.edu/download/CADD/v1.4/GRCh37/InDels.tsv.gz"
PRESCORE_GRCh38_INDEL="http://krishna.gs.washington.edu/download/CADD/v1.4/GRCh38/InDels.tsv.gz"
PRESCORE_GRCh38v15_INDEL="http://krishna.gs.washington.edu/download/CADD/v1.5/GRCh38/InDels.tsv.gz"
PRESCORE_INCANNO_GRCh37_INDEL="http://krishna.gs.washington.edu/download/CADD/v1.4/GRCh37/InDels_inclAnno.tsv.gz"
PRESCORE_INCANNO_GRCh38_INDEL="http://krishna.gs.washington.edu/download/CADD/v1.4/GRCh38/InDels_inclAnno.tsv.gz"
PRESCORE_INCANNO_GRCh38v15_INDEL="http://krishna.gs.washington.edu/download/CADD/v1.5/GRCh38/InDels_inclAnno.tsv.gz"
### OVERVIEW SELECTION
echo ""
echo "The following will be loaded: (disk space occupied)"
if [ "$ENV" = true ]
then
if [ "$GRCh38v15" = 'true' ]
then
echo " - Setup of the virtual environment including all dependencies for CADD v1.5 (3 GB)."
fi
if [ "$GRCh38" = 'true' ] || [ "$GRCh37" = 'true' ]
then
echo " - Setup of the virtual environment including all dependencies for CADD v1.4 (3 GB)."
fi
fi
if [ "$GRCh37" = true ]
then
if [ "$ANNOTATIONS" = true ]
then
echo " - Download CADD annotations for GRCh37-v1.4 (98 GB)"
fi
if [ "$PRESCORE" = true ]
then
if [ "$INCANNO" = true ]
then
echo " - Download prescored SNV inclusive annotations for GRCh37-v1.4 (231 GB)"
if [ "$INDELS" = true ]
then
echo " - Download prescored InDels inclusive annotations for GRCh37-v1.4 (3 GB)"
fi
fi
if [ "$NOANNO" = true ]
then
echo " - Download prescored SNV (without annotations) for GRCh37-v1.4 (78 GB)"
if [ "$INDELS" = true ]
then
echo " - Download prescored InDels (without annotations) for GRCh37-v1.4 (0.6 GB)"
fi
fi
fi
fi
if [ "$GRCh38" = true ]
then
if [ "$ANNOTATIONS" = true ]
then
echo " - Download CADD annotations for GRCh38-v1.4 (194 GB)"
fi
if [ "$PRESCORE" = true ]
then
if [ "$INCANNO" = true ]
then
echo " - Download prescored SNV inclusive annotations for GRCh38-v1.4 (323 GB)"
if [ "$INDELS" = true ]
then
echo " - Download prescored InDels inclusive annotations for GRCh38-v1.4 (9 GB)"
fi
fi
if [ "$NOANNO" = true ]
then
echo " - Download prescored SNV (without annotations) for GRCh38-v1.4 (79 GB)"
if [ "$INDELS" = true ]
then
echo " - Download prescored InDels (without annotations) for GRCh38-v1.4 (1 GB)"
fi
fi
fi
fi
if [ "$GRCh38v15" = true ]
then
if [ "$ANNOTATIONS" = true ]
then
echo " - Download CADD annotations for GRCh38-v1.5 (168 GB)"
fi
if [ "$PRESCORE" = true ]
then
if [ "$INCANNO" = true ]
then
echo " - Download prescored SNV inclusive annotations for GRCh38-v1.5 (292 GB)"
if [ "$INDELS" = true ]
then
echo " - Download prescored InDels inclusive annotations for GRCh38-v1.5 (7 GB)"
fi
fi
if [ "$NOANNO" = true ]
then
echo " - Download prescored SNV (without annotations) for GRCh38-v1.5 (80 GB)"
if [ "$INDELS" = true ]
then
echo " - Download prescored InDels (without annotations) for GRCh38-v1.5 (1 GB)"
fi
fi
fi
fi
echo "Please make sure you have enough disk space available."
read -p "Ready to continue? (y)/n " CHOICE
case "$CHOICE" in
n|N ) echo "You canceled the installation."; exit 0;;
* ) echo "Starting installation. This will take some time.";;
esac
### INSTALLATION
if [ "$ENV" = true ]
then
if [ "$GRCh38v15" = 'true' ]
then
echo "Setting up virtual environment for CADD v1.5"
conda env create -f src/environment_v1.5.yml
fi
if [ "$GRCh38" = 'true' ] || [ "$GRCh37" = 'true' ]
then
echo "Setting up virtual environment for CADD v1.4"
conda env create -f src/environment.yml
fi
fi
# download a file and it index and check both md5 sums
function download_variantfile()
{
echo $1
wget -c $2
wget -c $2.tbi
wget $2.md5
wget $2.tbi.md5
md5sum -c *.md5
rm *.md5
}
if [ "$GRCh37" = true ]
then
if [ "$ANNOTATIONS" = true ]
then
echo "Downloading CADD annotations for GRCh37-v1.4 (98 GB)"
mkdir -p data/annotations/
cd data/annotations/
wget -c ${ANNOTATION_GRCh37} -O annotationsGRCh37.tar.gz
wget ${ANNOTATION_GRCh37}.md5 -O annotationsGRCh37.tar.gz.md5
md5sum -c annotationsGRCh37.tar.gz.md5
echo "Unpacking CADD annotations for GRCh37-v1.4"
tar -zxf annotationsGRCh37.tar.gz
rm annotationsGRCh37.tar.gz
rm annotationsGRCh37.tar.gz.md5
mv GRCh37 GRCh37_v1.4
cd $OLDPWD
fi
if [ "$PRESCORE" = true ]
then
if [ "$NOANNO" = true ]
then
mkdir -p data/prescored/GRCh37_v1.4/no_anno/
cd data/prescored/GRCh37_v1.4/no_anno/
download_variantfile "Downloading prescored SNV without annotations for GRCh37-v1.4 (78 GB)" ${PRESCORE_GRCh37}
if [ "$INDELS" = true ]
then
download_variantfile "Downloading prescored InDels without annotations for GRCh37-v1.4 (1 GB)" ${PRESCORE_GRCh37_INDEL}
fi
cd $OLDPWD
fi
if [ "$INCANNO" = true ]
then
mkdir -p data/prescored/GRCh37_v1.4/incl_anno/
cd data/prescored/GRCh37_v1.4/incl_anno/
download_variantfile "Downloading prescored SNV inclusive annotations for GRCh37-v1.4 (231 GB)" ${PRESCORE_INCANNO_GRCh37}
if [ "$INDELS" = true ]
then
download_variantfile "Downloading prescored InDels inclusive annotations for GRCh37-v1.4 (3 GB)" ${PRESCORE_INCANNO_GRCh37_INDEL}
fi
cd $OLDPWD
fi
fi
fi
if [ "$GRCh38" = true ]
then
if [ "$ANNOTATIONS" = true ]
then
echo "Downloading CADD annotations for GRCh38-v1.4 (194 GB)"
mkdir -p data/annotations/
cd data/annotations/
wget -c $ANNOTATION_GRCh38 -O annotationsGRCh38.tar.gz
wget $ANNOTATION_GRCh38.md5 -O annotationsGRCh38.tar.gz.md5
md5sum -c annotationsGRCh38.tar.gz.md5
echo "Unpacking CADD annotations for GRCh38-v1.4"
tar -zxf annotationsGRCh38.tar.gz
rm annotationsGRCh38.tar.gz
rm annotationsGRCh38.tar.gz.md5
mv GRCh38 GRCh38_v1.4
cd $OLDPWD
fi
if [ "$PRESCORE" = true ]
then
if [ "$NOANNO" = true ]
then
mkdir -p data/prescored/GRCh38_v1.4/no_anno/
cd data/prescored/GRCh38_v1.4/no_anno/
download_variantfile "Downloading prescored SNV without annotations for GRCh38-v1.4 (79 GB)" ${PRESCORE_GRCh38}
if [ "$INDELS" = true ]
then
download_variantfile "Downloading prescored InDels without annotations for GRCh38-v1.4 (1 GB)" ${PRESCORE_GRCh38_INDEL}
fi
cd $OLDPWD
fi
if [ "$INCANNO" = true ]
then
mkdir -p data/prescored/GRCh38_v1.4/incl_anno/
cd data/prescored/GRCh38_v1.4/incl_anno/
download_variantfile "Downloading prescored SNV inclusive annotations for GRCh38-v1.4 (323 GB)" ${PRESCORE_INCANNO_GRCh38}
if [ "$INDELS" = true ]
then
download_variantfile "Downloading prescored InDels inclusive annotations for GRCh38-v1.4 (9 GB)" ${PRESCORE_INCANNO_GRCh38_INDEL}
fi
cd $OLDPWD
fi
fi
fi
if [ "$GRCh38v15" = true ]
then
if [ "$ANNOTATIONS" = true ]
then
echo "Downloading CADD annotations for GRCh38-v1.5 (168 GB)"
mkdir -p data/annotations/
cd data/annotations/
wget -c ${ANNOTATION_GRCh38v15} -O annotationsGRCh38.tar.gz
wget ${ANNOTATION_GRCh38v15}.md5 -O annotationsGRCh38.tar.gz.md5
md5sum -c annotationsGRCh38.tar.gz.md5
echo "Unpacking CADD annotations for GRCh38-v1.5"
tar -zxf annotationsGRCh38.tar.gz
rm annotationsGRCh38.tar.gz
rm annotationsGRCh38.tar.gz.md5
cd $OLDPWD
fi
if [ "$PRESCORE" = true ]
then
if [ "$NOANNO" = true ]
then
mkdir -p data/prescored/GRCh38_v1.5/no_anno/
cd data/prescored/GRCh38_v1.5/no_anno/
download_variantfile "Downloading prescored SNV without annotations for GRCh38-v1.5 (80 GB)" ${PRESCORE_GRCh38v15}
if [ "$INDELS" = true ]
then
download_variantfile "Downloading prescored InDels without annotations for GRCh38-v1.5 (1 GB)" ${PRESCORE_GRCh38v15_INDEL}
fi
cd $OLDPWD
fi
if [ "$INCANNO" = true ]
then
mkdir -p data/prescored/GRCh38_v1.5/incl_anno/
cd data/prescored/GRCh38_v1.5/incl_anno/
download_variantfile "Downloading prescored SNV inclusive annotations for GRCh38-v1.5 (292 GB)" ${PRESCORE_INCANNO_GRCh38v15}
if [ "$INDELS" = true ]
then
download_variantfile "Downloading prescored InDels inclusive annotations for GRCh38-v1.5 (9 GB)" ${PRESCORE_INCANNO_GRCh38v15_INDEL}
fi
cd $OLDPWD
fi
fi
fi