2021-07-06 12:11:11 +00:00
|
|
|
process ENSEMBLVEP {
|
2021-12-07 09:30:35 +00:00
|
|
|
tag "$meta.id"
|
2021-07-06 12:11:11 +00:00
|
|
|
label 'process_medium'
|
|
|
|
|
|
|
|
conda (params.enable_conda ? "bioconda::ensembl-vep=104.3" : null)
|
2021-12-07 10:18:12 +00:00
|
|
|
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
|
|
|
|
'https://depot.galaxyproject.org/singularity/ensembl-vep:104.3--pl5262h4a94de4_0' :
|
|
|
|
'quay.io/biocontainers/ensembl-vep:104.3--pl5262h4a94de4_0' }"
|
2021-07-06 12:11:11 +00:00
|
|
|
|
|
|
|
input:
|
|
|
|
tuple val(meta), path(vcf)
|
|
|
|
val genome
|
|
|
|
val species
|
|
|
|
val cache_version
|
|
|
|
path cache
|
2022-06-09 09:45:27 +00:00
|
|
|
path fasta
|
2022-05-05 10:57:14 +00:00
|
|
|
path extra_files
|
2021-07-06 12:11:11 +00:00
|
|
|
|
|
|
|
output:
|
2022-06-15 11:52:12 +00:00
|
|
|
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
|
2021-07-06 12:11:11 +00:00
|
|
|
|
2022-02-04 08:53:32 +00:00
|
|
|
when:
|
|
|
|
task.ext.when == null || task.ext.when
|
|
|
|
|
2021-07-06 12:11:11 +00:00
|
|
|
script:
|
2021-11-26 07:58:40 +00:00
|
|
|
def args = task.ext.args ?: ''
|
2022-06-15 11:52:12 +00:00
|
|
|
def file_extension = args.contains("--vcf") ? 'vcf' : args.contains("--json")? 'json' : args.contains("--tab")? 'tab' : 'vcf'
|
2021-12-02 12:39:55 +00:00
|
|
|
def prefix = task.ext.prefix ?: "${meta.id}"
|
2021-12-06 11:59:49 +00:00
|
|
|
def dir_cache = cache ? "\${PWD}/${cache}" : "/.vep"
|
2022-06-09 09:45:27 +00:00
|
|
|
def reference = fasta ? "--fasta $fasta" : ""
|
|
|
|
|
2021-07-06 12:11:11 +00:00
|
|
|
"""
|
|
|
|
vep \\
|
|
|
|
-i $vcf \\
|
2022-06-15 11:52:12 +00:00
|
|
|
-o ${prefix}.ann.${file_extension} \\
|
2021-11-26 07:58:40 +00:00
|
|
|
$args \\
|
2022-06-09 09:45:27 +00:00
|
|
|
$reference \\
|
2021-07-06 12:11:11 +00:00
|
|
|
--assembly $genome \\
|
|
|
|
--species $species \\
|
|
|
|
--cache \\
|
|
|
|
--cache_version $cache_version \\
|
|
|
|
--dir_cache $dir_cache \\
|
|
|
|
--fork $task.cpus \\
|
2022-06-15 11:52:12 +00:00
|
|
|
--stats_file ${prefix}.summary.html \\
|
2021-07-06 12:11:11 +00:00
|
|
|
|
|
|
|
|
2021-09-27 08:41:24 +00:00
|
|
|
cat <<-END_VERSIONS > versions.yml
|
2021-11-26 07:58:40 +00:00
|
|
|
"${task.process}":
|
|
|
|
ensemblvep: \$( echo \$(vep --help 2>&1) | sed 's/^.*Versions:.*ensembl-vep : //;s/ .*\$//')
|
2021-09-27 08:41:24 +00:00
|
|
|
END_VERSIONS
|
2021-07-06 12:11:11 +00:00
|
|
|
"""
|
|
|
|
}
|