nf-core_modules/modules/vcf2maf/main.nf
Adam Talbot f19ec865aa
vcf2maf module with built in VEP (#1768)
vcf2maf module created

Additions:
 - vcf2maf module created
 - If VEP is present in PATH, it is added to command
 - If VEP is missing, it is ignored (recommended to skip with --inhibit-vep)
 - VEP version automatically added to versions.yml
 - Uses VEP cache during testing which is added to test-datasets in https://github.com/nf-core/test-datasets/pull/563
 - Default Docker image includes VEP and vcf2maf
 - Test includes without VEP.

Relates to #490
2022-06-20 18:27:12 +02:00

55 lines
1.8 KiB
Text

def VERSION = '1.6.21'
process VCF2MAF {
tag "$meta.id"
label 'process_low'
conda (params.enable_conda ? "bioconda::vcf2maf=1.6.21 bioconda::ensembl-vep=106.1" : null)
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/mulled-v2-b6fc09bed47d0dc4d8384ce9e04af5806f2cc91b:305092c6f8420acd17377d2cc8b96e1c3ccb7d26-0':
'quay.io/biocontainers/mulled-v2-b6fc09bed47d0dc4d8384ce9e04af5806f2cc91b:305092c6f8420acd17377d2cc8b96e1c3ccb7d26-0' }"
input:
tuple val(meta), path(vcf) // Use an uncompressed VCF file!
path fasta // Required
path vep_cache // Required for VEP running. A default of /.vep is supplied.
output:
tuple val(meta), path("*.maf"), emit: maf
path "versions.yml" , emit: versions
when:
task.ext.when == null || task.ext.when
script:
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"
def vep_cache_cmd = vep_cache ? "--vep-data $vep_cache" : ""
// If VEP is present, it will find it and add it to commands.
// If VEP is not present they will be blank
"""
if command -v vep &> /dev/null
then
VEP_CMD="--vep-path \$(dirname \$(type -p vep))"
VEP_VERSION=\$(echo -e "\\n ensemblvep: \$( echo \$(vep --help 2>&1) | sed 's/^.*Versions:.*ensembl-vep : //;s/ .*\$//')")
else
VEP_CMD=""
VEP_VERSION=""
fi
vcf2maf.pl \\
$args \\
\$VEP_CMD \\
$vep_cache_cmd \\
--ref-fasta $fasta \\
--input-vcf $vcf \\
--output-maf ${prefix}.maf
cat <<-END_VERSIONS > versions.yml
"${task.process}":
vcf2maf: $VERSION\$VEP_VERSION
END_VERSIONS
"""
}