Optional output from the VEP-moduel (#1775)

* Making the output from the VEP-moduel (ENSEMBLVEP) optionally vcf, json or tab. #1774

* Trying to fix tests

* Still trying to fix tests

* Fetching the vep-output-file-extension from the args.

* Update meta.yml

* WIP: Adding tests for vep-output json and tab

* updated the test.yml

Co-authored-by: nvnieuwk <101190534+nvnieuwk@users.noreply.github.com>
Co-authored-by: nvnieuwk <nicolas.vannieuwkerke@ugent.be>
This commit is contained in:
Anders Sune Pedersen 2022-06-15 13:52:12 +02:00 committed by GitHub
parent 9dbaffff88
commit 30f72e2482
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 97 additions and 13 deletions

View file

@ -17,25 +17,26 @@ process ENSEMBLVEP {
path extra_files
output:
tuple val(meta), path("*.ann.vcf"), emit: vcf
path "*.summary.html" , emit: report
path "versions.yml" , emit: versions
tuple val(meta), path("*.ann.vcf") , optional:true, emit: vcf
tuple val(meta), path("*.ann.tab") , optional:true, emit: tab
tuple val(meta), path("*.ann.json") , optional:true, emit: json
path "*.summary.html" , emit: report
path "versions.yml" , emit: versions
when:
task.ext.when == null || task.ext.when
script:
def args = task.ext.args ?: ''
def file_extension = args.contains("--vcf") ? 'vcf' : args.contains("--json")? 'json' : args.contains("--tab")? 'tab' : 'vcf'
def prefix = task.ext.prefix ?: "${meta.id}"
def dir_cache = cache ? "\${PWD}/${cache}" : "/.vep"
def reference = fasta ? "--fasta $fasta" : ""
"""
mkdir $prefix
vep \\
-i $vcf \\
-o ${prefix}.ann.vcf \\
-o ${prefix}.ann.${file_extension} \\
$args \\
$reference \\
--assembly $genome \\
@ -44,10 +45,8 @@ process ENSEMBLVEP {
--cache_version $cache_version \\
--dir_cache $dir_cache \\
--fork $task.cpus \\
--vcf \\
--stats_file ${prefix}.summary.html
--stats_file ${prefix}.summary.html \\
rm -rf $prefix
cat <<-END_VERSIONS > versions.yml
"${task.process}":

View file

@ -1,5 +1,5 @@
name: ENSEMBLVEP
description: Ensembl Variant Effect Predictor (VEP)
description: Ensembl Variant Effect Predictor (VEP). The output-file-format is controlled through `task.ext.args`.
keywords:
- annotation
tools:
@ -49,8 +49,18 @@ output:
- vcf:
type: file
description: |
annotated vcf
annotated vcf (optional)
pattern: "*.ann.vcf"
- tab:
type: file
description: |
tab file with annotated variants (optional)
pattern: "*.ann.tab"
- json:
type: file
description: |
json file with annotated variants (optional)
pattern: "*.ann.json"
- report:
type: file
description: VEP report file

View file

@ -4,6 +4,43 @@ nextflow.enable.dsl = 2
include { ENSEMBLVEP } from '../../../modules/ensemblvep/main.nf'
include { ENSEMBLVEP as ENSEMBLVEP_JSON } from '../../../modules/ensemblvep/main.nf'
include { ENSEMBLVEP as ENSEMBLVEP_TAB } from '../../../modules/ensemblvep/main.nf'
include { ENSEMBLVEP as ENSEMBLVEP_VCF } from '../../../modules/ensemblvep/main.nf'
workflow test_ensemblvep_fasta_json {
input = [
[ id:'test' ], // meta map
file(params.test_data['sarscov2']['illumina']['test_vcf'], checkIfExists: true)
]
fasta = file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true)
ENSEMBLVEP_JSON ( input, "WBcel235", "caenorhabditis_elegans", "104", [], fasta, [] )
}
workflow test_ensemblvep_fasta_tab {
input = [
[ id:'test' ], // meta map
file(params.test_data['sarscov2']['illumina']['test_vcf'], checkIfExists: true)
]
fasta = file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true)
ENSEMBLVEP_TAB ( input, "WBcel235", "caenorhabditis_elegans", "104", [], fasta, [] )
}
workflow test_ensemblvep_fasta_vcf {
input = [
[ id:'test' ], // meta map
file(params.test_data['sarscov2']['illumina']['test_vcf'], checkIfExists: true)
]
fasta = file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true)
ENSEMBLVEP_VCF ( input, "WBcel235", "caenorhabditis_elegans", "104", [], fasta, [] )
}
workflow test_ensemblvep_fasta {
input = [
[ id:'test' ], // meta map

View file

@ -6,4 +6,18 @@ process {
container = 'nfcore/vep:104.3.WBcel235'
}
withName: ENSEMBLVEP_JSON {
container = 'nfcore/vep:104.3.WBcel235'
ext.args = '--json'
}
withName: ENSEMBLVEP_TAB {
container = 'nfcore/vep:104.3.WBcel235'
ext.args = '--tab'
}
withName: ENSEMBLVEP_VCF {
container = 'nfcore/vep:104.3.WBcel235'
ext.args = '--vcf'
}
}

View file

@ -1,5 +1,29 @@
- name: ensemblvep test_ensemblvep_fasta_json
command: nextflow run ./tests/modules/ensemblvep -entry test_ensemblvep_fasta_json -c ./tests/config/nextflow.config -c ./tests/modules/ensemblvep/nextflow.config
tags:
- ensemblvep
files:
- path: output/ensemblvep/test.ann.json
- path: output/ensemblvep/test.summary.html
- name: ensemblvep test_ensemblvep_fasta_tab
command: nextflow run ./tests/modules/ensemblvep -entry test_ensemblvep_fasta_tab -c ./tests/config/nextflow.config -c ./tests/modules/ensemblvep/nextflow.config
tags:
- ensemblvep
files:
- path: output/ensemblvep/test.ann.tab
- path: output/ensemblvep/test.summary.html
- name: ensemblvep test_ensemblvep_fasta_vcf
command: nextflow run ./tests/modules/ensemblvep -entry test_ensemblvep_fasta_vcf -c ./tests/config/nextflow.config -c ./tests/modules/ensemblvep/nextflow.config
tags:
- ensemblvep
files:
- path: output/ensemblvep/test.ann.vcf
- path: output/ensemblvep/test.summary.html
- name: ensemblvep test_ensemblvep_fasta
command: nextflow run ./tests/modules/ensemblvep -entry test_ensemblvep_fasta -c ./tests/config/nextflow.config -c ./tests/modules/ensemblvep/nextflow.config
command: nextflow run ./tests/modules/ensemblvep -entry test_ensemblvep_fasta -c ./tests/config/nextflow.config -c ./tests/modules/ensemblvep/nextflow.config
tags:
- ensemblvep
files:
@ -7,7 +31,7 @@
- path: output/ensemblvep/test.summary.html
- name: ensemblvep test_ensemblvep_no_fasta
command: nextflow run ./tests/modules/ensemblvep -entry test_ensemblvep_no_fasta -c ./tests/config/nextflow.config -c ./tests/modules/ensemblvep/nextflow.config
command: nextflow run ./tests/modules/ensemblvep -entry test_ensemblvep_no_fasta -c ./tests/config/nextflow.config -c ./tests/modules/ensemblvep/nextflow.config
tags:
- ensemblvep
files: