Skip to content
This repository was archived by the owner on Jan 27, 2020. It is now read-only.

Commit d912b01

Browse files
authored
Merge pull request #555 from szilvajuhos/master
Running SnpEff an VEP at once, also fixing CLI for annotators
2 parents 82a043b + dfd1898 commit d912b01

2 files changed

Lines changed: 327 additions & 18 deletions

File tree

annotate.nf

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -141,20 +141,21 @@ process RunSnpeff {
141141

142142
output:
143143
set file("${vcf.baseName}.snpEff.ann.vcf"), file("${vcf.baseName}.snpEff.genes.txt"), file("${vcf.baseName}.snpEff.csv"), file("${vcf.baseName}.snpEff.summary.html") into snpeffReport
144+
set variantCaller,file("${vcf.baseName}.snpEff.ann.vcf") into snpEffOutputVCFs
144145

145-
when: 'snpeff' in tools
146+
when: 'snpeff' in tools || 'merge' in tools
146147

147148
script:
148149
"""
149150
java -Xmx${task.memory.toGiga()}g \
150-
-jar \$SNPEFF_HOME/snpEff.jar \
151-
${snpeffDb} \
152-
-csvStats ${vcf.baseName}.snpEff.csv \
153-
-nodownload \
154-
-cancer \
155-
-v \
156-
${vcf} \
157-
> ${vcf.baseName}.snpEff.ann.vcf
151+
-jar \$SNPEFF_HOME/snpEff.jar \
152+
${snpeffDb} \
153+
-csvStats ${vcf.baseName}.snpEff.csv \
154+
-nodownload \
155+
-canon \
156+
-v \
157+
${vcf} \
158+
> ${vcf.baseName}.snpEff.ann.vcf
158159
159160
mv snpEff_summary.html ${vcf.baseName}.snpEff.summary.html
160161
"""
@@ -165,6 +166,13 @@ if (params.verbose) snpeffReport = snpeffReport.view {
165166
File : ${it.fileName}"
166167
}
167168

169+
// When we are running in the 'merge' mode (first snpEff, then VEP)
170+
// we have to exchange the channels
171+
172+
if('merge' in tools) {
173+
vcfForVep = snpEffOutputVCFs
174+
}
175+
168176
process RunVEP {
169177
tag {vcf}
170178

@@ -176,7 +184,7 @@ process RunVEP {
176184
output:
177185
set file("${vcf.baseName}.vep.ann.vcf"), file("${vcf.baseName}.vep.summary.html") into vepReport
178186

179-
when: 'vep' in tools
187+
when: 'vep' in tools || 'merge' in tools
180188

181189
script:
182190
genome = params.genome == 'smallGRCh37' ? 'GRCh37' : params.genome
@@ -230,7 +238,8 @@ def defineDirectoryMap() {
230238
def defineToolList() {
231239
return [
232240
'snpeff',
233-
'vep'
241+
'vep',
242+
'merge'
234243
]
235244
}
236245

@@ -252,6 +261,7 @@ def helpMessage() {
252261
log.info " Possible values are:"
253262
log.info " snpeff (use snpEff for Annotation of Variants)"
254263
log.info " vep (use VEP for Annotation of Variants)"
264+
log.info " merge (first snpEff, then feed its output VCFs to VEP)"
255265
log.info " --annotateTools"
256266
log.info " Option to configure which tools to annotate."
257267
log.info " Different tools to be separated by commas."

0 commit comments

Comments
 (0)