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

Running SnpEff and VEP at once, also fixing CLI for annotators #555

Merged
merged 11 commits into from
Apr 4, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 21 additions & 11 deletions annotate.nf
Original file line number Diff line number Diff line change
Expand Up @@ -141,20 +141,21 @@ process RunSnpeff {

output:
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
set variantCaller,file("${vcf.baseName}.snpEff.ann.vcf") into snpEffOutputVCFs

when: 'snpeff' in tools
when: 'snpeff' in tools || 'merge' in tools

script:
"""
java -Xmx${task.memory.toGiga()}g \
-jar \$SNPEFF_HOME/snpEff.jar \
${snpeffDb} \
-csvStats ${vcf.baseName}.snpEff.csv \
-nodownload \
-cancer \
-v \
${vcf} \
> ${vcf.baseName}.snpEff.ann.vcf
-jar \$SNPEFF_HOME/snpEff.jar \
${snpeffDb} \
-csvStats ${vcf.baseName}.snpEff.csv \
-nodownload \
-canon \
-v \
${vcf} \
> ${vcf.baseName}.snpEff.ann.vcf

mv snpEff_summary.html ${vcf.baseName}.snpEff.summary.html
"""
Expand All @@ -165,6 +166,13 @@ if (params.verbose) snpeffReport = snpeffReport.view {
File : ${it.fileName}"
}

// When we are running in the 'merge' mode (first snpEff, then VEP)
// we have to exchange the channels

if('merge' in tools) {
vcfForVep = snpEffOutputVCFs
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So if I want to have snpEFF, VEP and merged VCF it's not possible?
Can't we use that?

vcfForVep = vcfForVep.mix(snpEffOutputVCFs)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That will be a new feature if it is going to be needed at all. Testing takes time and I do not want to add stuff that is never going to be used or relatively easy to do with some scripting.

}

process RunVEP {
tag {vcf}

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

when: 'vep' in tools
when: 'vep' in tools || 'merge' in tools

script:
genome = params.genome == 'smallGRCh37' ? 'GRCh37' : params.genome
Expand Down Expand Up @@ -230,7 +238,8 @@ def defineDirectoryMap() {
def defineToolList() {
return [
'snpeff',
'vep'
'vep',
'merge'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I prefer lists to be sorted, but that's not really important here ;-)

]
}

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