forked from KHP-Informatics/ngseasy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
executable file
·318 lines (254 loc) · 12.1 KB
/
Makefile
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
## ngseasy Makefile
## Version 1.0
## Author: Stephen Newhouse ([email protected])
## MEM Min 32GB
## Edit this to reflect version if ya need
VERSION=1.0
GENOMEBUILD="b37"
WHOAMI=$(shell whoami)
## This is where we will make ngs_projects and download metadata to etc etc
## Edit this if you want to install all somewhere else
# eg:
# make INSTALLDIR="/medida/scratch" all
#
INSTALLDIR=$(HOME)
## Current working dir
DIR=$(shell pwd)
## Install bin path - edit at will
TARGET_BIN=/usr/local/bin
## relative path to ngseasy scripts
SRC=./bin
all:
scripts ngsprojectdir dockerimages genomes annotations contaminants resources testdata vep snpeff
indexgenomes: dockerimages
bwaindex bowtie2index stampyindex snapindex
scripts:
chmod 777 $(SRC)/*
cp -v $(SRC)/* $(TARGET_BIN)/
rmscripts:
rm -fv $(TARGET_BIN)/ngseasy* && rm -fv $(TARGET_BIN)/ngseasy
updatescripts:
git pull && rm -fv $(TARGET_BIN)/ngseasy* && rm -fv $(TARGET_BIN)/ngseasy && chmod 777 $(SRC)/ && cp -v $(SRC)/* $(TARGET_BIN)/
ngsprojectdir:
mkdir -v -p $(INSTALLDIR)/ngs_projects && \
mkdir -v -p $(INSTALLDIR)/ngs_projects/raw_fastq && \
mkdir -v -p $(INSTALLDIR)/ngs_projects/config_files && \
mkdir -v -p $(INSTALLDIR)/ngs_projects/annovardb && \
mkdir -v -p $(INSTALLDIR)/ngs_projects/run_logs && \
mkdir -v -p $(HOME)/ngseasy_logs && \
mkdir -v -p $(HOME)/ngseasy_tmp
purgengsprojectsdir:
rm -rfv $(INSTALLDIR)/ngs_projects
dockerimages:
docker pull compbio/ngseasy-base:$(VERSION) && \
docker pull compbio/ngseasy-fastqc:$(VERSION) && \
docker pull compbio/ngseasy-trimmomatic:$(VERSION) && \
docker pull compbio/ngseasy-snap:$(VERSION) && \
docker pull compbio/ngseasy-bwa:$(VERSION) && \
docker pull compbio/ngseasy-bowtie2:$(VERSION) && \
docker pull compbio/ngseasy-stampy:$(VERSION) && \
docker pull compbio/ngseasy-picardtools:$(VERSION) && \
docker pull compbio/ngseasy-freebayes:$(VERSION) && \
docker pull compbio/ngseasy-platypus:$(VERSION) && \
docker pull compbio/ngseasy-delly:$(VERSION) && \
docker pull compbio/ngseasy-lumpy:$(VERSION) && \
docker pull compbio/ngseasy-bcbiovar:$(VERSION) && \
docker pull compbio/ngseasy-cnmops:$(VERSION) && \
docker pull compbio/ngseasy-mhmm:$(VERSION) && \
docker pull compbio/ngseasy-exomedepth:$(VERSION) && \
docker pull compbio/ngseasy-slope:$(VERSION)
baseimage:
docker pull compbio/ngseasy-base:$(VERSION)
fastqc:
docker pull compbio/ngseasy-fastqc:$(VERSION)
trimmomatic:
docker pull compbio/ngseasy-trimmomatic:$(VERSION)
bwa:
docker pull compbio/ngseasy-bwa:$(VERSION)
bowtie2:
docker pull compbio/ngseasy-bowtie2:$(VERSION)
snap:
docker pull compbio/ngseasy-snap:$(VERSION)
stampy:
docker pull compbio/ngseasy-stampy:$(VERSION)
picardtools:
docker pull compbio/ngseasy-picardtools:$(VERSION)
freebayes:
docker pull compbio/ngseasy-freebayes:$(VERSION)
platypus:
docker pull compbio/ngseasy-platypus:$(VERSION)
delly:
docker pull compbio/ngseasy-delly:$(VERSION)
lumpy:
docker pull compbio/ngseasy-lumpy:$(VERSION)
bcbiovar:
docker pull compbio/ngseasy-bcbiovar:$(VERSION)
cnmops:
docker pull compbio/ngseasy-cnmops:$(VERSION)
mhmm:
docker pull compbio/ngseasy-mhmm:$(VERSION)
exomedepth:
docker pull compbio/ngseasy-exomedepth:$(VERSION)
slope:
docker pull compbio/ngseasy-slope:$(VERSION)
genomes:
cd $(INSTALLDIR)/ngs_projects && \
mkdir reference_genomes_$(GENOMEBUILD) && \
cd reference_genomes_$(GENOMEBUILD) && \
wget https://s3-eu-west-1.amazonaws.com/ngseasy.data/reference_genomes_$(GENOMEBUILD)/human_g1k_v$(GENOMEBUILD).fasta.fai.tar.gz && \
wget https://s3-eu-west-1.amazonaws.com/ngseasy.data/reference_genomes_$(GENOMEBUILD)/human_g1k_v$(GENOMEBUILD).fasta.tar.gz && \
chmod -R 777 $(INSTALLDIR)/ngs_projects/ && \
tar -xvf $(INSTALLDIR)/ngs_projects/reference_genomes_$(GENOMEBUILD)/human_g1k_v$(GENOMEBUILD).fasta.tar.gz && \
tar -xvf $(INSTALLDIR)/ngs_projects/reference_genomes_$(GENOMEBUILD)/human_g1k_v$(GENOMEBUILD).fasta.fai.tar.gz && \
rm -v $(INSTALLDIR)/ngs_projects/reference_genomes_$(GENOMEBUILD)/human_g1k_v$(GENOMEBUILD).fasta.tar.gz && \
rm -v $(INSTALLDIR)/ngs_projects/reference_genomes_$(GENOMEBUILD)/human_g1k_v$(GENOMEBUILD).fasta.fai.tar.gz
contaminants:
cd $(INSTALLDIR)/ngs_projects/reference_genomes_$(GENOMEBUILD) && \
wget https://s3-eu-west-1.amazonaws.com/ngseasy.data/reference_genomes_b37/contaminant_list.fa
annotations:
cd $(INSTALLDIR)/ngs_projects/reference_genomes_$(GENOMEBUILD) && \
wget https://s3-eu-west-1.amazonaws.com/ngseasy.data/reference_genomes_b37_annotations/LCR_hg19_rmsk.bed.gz && \
wget https://s3-eu-west-1.amazonaws.com/ngseasy.data/reference_genomes_b37_annotations/SeqCap_EZ_Exome_v3_capture.bed.gz && \
wget https://s3-eu-west-1.amazonaws.com/ngseasy.data/reference_genomes_b37_annotations/SeqCap_EZ_Exome_v3_primary.bed.gz && \
wget https://s3-eu-west-1.amazonaws.com/ngseasy.data/reference_genomes_b37_annotations/dbsnp_138.b37.recab.gz && \
wget https://s3-eu-west-1.amazonaws.com/ngseasy.data/reference_genomes_b37_annotations/human_g1k_v37.chrom_lengths.gz && \
wget https://s3-eu-west-1.amazonaws.com/ngseasy.data/reference_genomes_b37_annotations/human_g1k_v37_0.5Kwindows.bed.gz && \
wget https://s3-eu-west-1.amazonaws.com/ngseasy.data/reference_genomes_b37_annotations/human_g1k_v37_1Kwindows.bed.gz && \
wget https://s3-eu-west-1.amazonaws.com/ngseasy.data/reference_genomes_b37_annotations/nexterarapidcapture_exome_targetedregions_v1.2.bed.gz && \
wget https://s3-eu-west-1.amazonaws.com/ngseasy.data/reference_genomes_b37_annotations/nexterarapidcapture_expandedexome_targetedregions.bed.gz
chromosomes:
cd $(INSTALLDIR)/ngs_projects/reference_genomes_$(GENOMEBUILD) && \
mkdir chroms && \
cd chroms && \
awk 'BEGIN { CHROM="" } { if ($$1~"^>") CHROM=substr($$1,2); print $$0 > CHROM".fasta" }' ${INSTALLDIR}/ngs_projects/reference_genomes_b${GENOMEBUILD}/human_g1k_v${GENOMEBUILD}.fasta
purgegenomes:
rm -rfv $(INSTALLDIR)/ngs_projects/reference_genomes_$(GENOMEBUILD)
bwaindex:
cd $(INSTALLDIR)/ngs_projects/reference_genomes_$(GENOMEBUILD) && \
docker run \
--volume $(INSTALLDIR)/ngs_projects/reference_genomes_$(GENOMEBUILD)/:/home/pipeman/ngs_projects/reference_genomes_$(GENOMEBUILD) \
--name bwa_indexing \
--rm=true \
-e USER=pipeman \
--user=pipeman \
-i -t compbio/ngseasy-bwa:$(VERSION) \
/bin/bash -c \
"/usr/local/pipeline/bwa-0.7.12/bwa index \
-a bwtsw \
/home/pipeman/ngs_projects/reference_genomes_$(GENOMEBUILD)/human_g1k_v$(GENOMEBUILD).fasta" && \
chmod -R 777 $(INSTALLDIR)/ngs_projects/reference_genomes_$(GENOMEBUILD)/*
stampyindex:
cd $(INSTALLDIR)/ngs_projects/reference_genomes_$(GENOMEBUILD) && \
docker run \
--volume $(INSTALLDIR)/ngs_projects/reference_genomes_$(GENOMEBUILD)/:/home/pipeman/ngs_projects/reference_genomes_$(GENOMEBUILD) \
--name stampy_indexing \
--rm=true \
-e USER=pipeman \
--user=pipeman \
-i -t compbio/ngseasy-stampy:$(VERSION) \
/bin/bash -c \
"python \
/usr/local/pipeline/stampy-1.0.23/stampy.py \
-G /home/pipeman/ngs_projects/reference_genomes_$(GENOMEBUILD)/human_g1k_v$(GENOMEBUILD) \
/home/pipeman/ngs_projects/reference_genomes_$(GENOMEBUILD)/human_g1k_v$(GENOMEBUILD).fasta && \
chmod -R 777 /home/pipeman/ngs_projects/reference_genomes_$(GENOMEBUILD)/* && \
python \
/usr/local/pipeline/stampy-1.0.23/stampy.py \
-g /home/pipeman/ngs_projects/reference_genomes_$(GENOMEBUILD)/human_g1k_v$(GENOMEBUILD) \
-H /home/pipeman/ngs_projects/reference_genomes_$(GENOMEBUILD)/human_g1k_v$(GENOMEBUILD) && \
chmod -R 777 /home/pipeman/ngs_projects/reference_genomes_$(GENOMEBUILD)/*" && \
chmod -R 777 $(INSTALLDIR)/ngs_projects/reference_genomes_$(GENOMEBUILD)/*
bowtie2index:
cd $(INSTALLDIR)/ngs_projects/reference_genomes_$(GENOMEBUILD) && \
docker run \
--volume $(INSTALLDIR)/ngs_projects/reference_genomes_$(GENOMEBUILD)/:/home/pipeman/ngs_projects/reference_genomes_$(GENOMEBUILD) \
--name bowtie2_indexing \
--rm=true \
-e USER=pipeman \
--user=pipeman \
-i -t compbio/ngseasy-bowtie2:$(VERSION) \
/bin/bash -c \
"/usr/local/pipeline/bowtie2-2.2.4/bowtie2-build \
/home/pipeman/ngs_projects/reference_genomes_$(GENOMEBUILD)/human_g1k_v$(GENOMEBUILD).fasta \
/home/pipeman/ngs_projects/reference_genomes_$(GENOMEBUILD)/human_g1k_v$(GENOMEBUILD)" && \
chmod -R 777 $(INSTALLDIR)/ngs_projects/reference_genomes_$(GENOMEBUILD)/*
snapindex:
cd $(INSTALLDIR)/ngs_projects/reference_genomes_$(GENOMEBUILD) && \
docker run \
--volume $(INSTALLDIR)/ngs_projects/reference_genomes_$(GENOMEBUILD)/:/home/pipeman/ngs_projects/reference_genomes_$(GENOMEBUILD) \
--name snap_indexing \
--rm=true \
-e USER=pipeman \
--user=pipeman \
-i -t compbio/ngseasy-snap:$(VERSION) \
/bin/bash -c \
"/usr/local/bin/snap index \
/home/pipeman/ngs_projects/reference_genomes_$(GENOMEBUILD)/human_g1k_v$(GENOMEBUILD).fasta \
/home/pipeman/ngs_projects/reference_genomes_$(GENOMEBUILD)/ -hg19" && \
chmod -R 777 $(INSTALLDIR)/ngs_projects/reference_genomes_$(GENOMEBUILD)/*
resources: ngsprojectdir
cd $(INSTALLDIR)/ngs_projects && \
wget https://s3-eu-west-1.amazonaws.com/ngseasy.data/gatk_resources.tar.gz && \
tar -xvf gatk_resources.tar.gz && \
chmod -R 766 gatk_resources && \
rm gatk_resources.tar.gz
testdata: ngsprojectdir
cd $(INSTALLDIR)/ngs_projects && \
mkdir $(INSTALLDIR)/ngs_projects/fastq_test_data && \
cd $(INSTALLDIR)/ngs_projects/fastq_test_data && \
wget https://s3-eu-west-1.amazonaws.com/ngseasy.data/fastq_test_data/NA12878s.WEX_1.fq.gz && \
wget https://s3-eu-west-1.amazonaws.com/ngseasy.data/fastq_test_data/NA12878s.WEX_2.fq.gz && \
wget https://dnanexus-rnd.s3.amazonaws.com/NA12878-xten/reads/NA12878D_HiSeqX_R1.fastq.gz && \
wget https://dnanexus-rnd.s3.amazonaws.com/NA12878-xten/reads/NA12878D_HiSeqX_R1.fastq.gz && \
wget ftp://ftp.sra.ebi.ac.uk/vol1/fastq/SRR292/SRR292250/SRR292250_1.fastq.gz && \
wget ftp://ftp.sra.ebi.ac.uk/vol1/fastq/SRR292/SRR292250/SRR292250_2.fastq.gz
gatk:
cd $(DIR)/containerized/ngs_docker_debian/ngs_variant_annotators/ngseasy_gatk && \
docker build --rm=true compbio/ngseasy-gatk:$(VERSION) .
novoalign:
cd $(DIR)/containerized/ngs_docker_debian/ngs_variant_annotators/ngseasy_novoalin && \
docker build --rm=true compbio/ngseasy-novoalign:$(VERSION) .
novoalignindex:
cd $(INSTALLDIR)/ngs_projects/reference_genomes_$(GENOMEBUILD) && \
docker run \
--volume $(INSTALLDIR)/ngs_projects/reference_genomes_$(GENOMEBUILD)/:/home/pipeman/ngs_projects/reference_genomes_$(GENOMEBUILD) \
--name novoalign_indexing \
--rm=true \
-e USER=pipeman \
--user=pipeman \
-i -t compbio/ngseasy-novoalign:$(VERSION) \
/bin/bash -c \
"/usr/local/pipeline/novocraft/novoindex \
-k 13 \
-s 4 \
/home/pipeman/ngs_projects/reference_genomes_$(GENOMEBUILD)/human_g1k_v$(GENOMEBUILD).novoindex \
/home/pipeman/ngs_projects/reference_genomes_$(GENOMEBUILD)/human_g1k_v$(GENOMEBUILD).fasta" && \
chmod -R 777 $(INSTALLDIR)/ngs_projects/reference_genomes_$(GENOMEBUILD)/*
vep:
cd $(DIR)/containerized/ngs_docker_debian/ngs_variant_annotators/ngseasy_vep && \
docker build --rm=true compbio/ngseasy-vep:$(VERSION) .
snpeff:
cd $(DIR)/containerized/ngs_docker_debian/ngs_variant_annotators/ngseasy_snpeff && \
docker build --rm=true compbio/ngseasy-snpeff:$(VERSION) .
annovar:
cd $(DIR)/containerized/ngs_docker_debian/ngs_variant_annotators/ngseasy_annovar && \
docker build --rm=true compbio/ngseasy-annovar:$(VERSION) .
annovardb:
docker run \
--volume $(INSTALLDIR)/ngs_projects/annovardb/:/home/annovardb \
--name get_annovardb \
--rm=true \
-i -t compbio/ngseasy-annovar:$(VERSION) \
/bin/bash -c \
"/bin/bash /usr/local/pipeline/annovar/get_annovar_gene_databases.sh && /bin/bash /usr/local/pipeline/annovar/get_annovar_databases.sh"
clean:
rm -f -v $(TARGET_BIN)/ngseas* && \
rm -f -v $(TARGET_BIN)/ensembl****yaml
purgeall:
rm -f -v $(TARGET_BIN)/ngseas* && \
rm -f -v $(TARGET_BIN)/ensembl****yaml && \
docker kill $(shell docker ps -a | awk '(print $$1)') && \
docker rm -f $(shell docker ps -a | awk '(print $$1)') && \
docker rmi -f $(shell docker images -a | grep ngseasy | awk '(print $$3)')
## to do: add options to download and build reference genome builds
## indexing of genome