Fix syntax for extra containers for ensemblvep and snpeff (#1105)

* fix: correct syntax for task.ext.use_cache

* Apply suggestions from code review

* fix: simplify logic

* fix: update to new syntax
This commit is contained in:
Maxime U. Garcia 2021-12-06 12:59:49 +01:00 committed by GitHub
parent e0aa89141f
commit 98b024c0e4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 14 additions and 20 deletions

View file

@ -2,13 +2,11 @@ process ENSEMBLVEP {
label 'process_medium'
conda (params.enable_conda ? "bioconda::ensembl-vep=104.3" : null)
if (task.ext.use_cache) {
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
!task.ext.container_tag ?
'https://depot.galaxyproject.org/singularity/ensembl-vep:104.3--pl5262h4a94de4_0' :
'quay.io/biocontainers/ensembl-vep:104.3--pl5262h4a94de4_0' }"
} else {
container "nfcore/vep:${task.ext.vep_tag}"
}
'quay.io/biocontainers/ensembl-vep:104.3--pl5262h4a94de4_0' :
"nfcore/vep:${task.ext.container_tag}" }"
input:
tuple val(meta), path(vcf)
@ -25,7 +23,7 @@ process ENSEMBLVEP {
script:
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"
def dir_cache = task.ext.use_cache ? "\${PWD}/${cache}" : "/.vep"
def dir_cache = cache ? "\${PWD}/${cache}" : "/.vep"
"""
mkdir $prefix
@ -39,7 +37,7 @@ process ENSEMBLVEP {
--cache_version $cache_version \\
--dir_cache $dir_cache \\
--fork $task.cpus \\
--format vcf \\
--vcf \\
--stats_file ${prefix}.summary.html
rm -rf $prefix

View file

@ -2,13 +2,11 @@ process SNPEFF {
label 'process_medium'
conda (params.enable_conda ? "bioconda::snpeff=5.0" : null)
if (task.ext.use_cache) {
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
!task.ext.container_tag ?
'https://depot.galaxyproject.org/singularity/snpeff:5.0--hdfd78af_1' :
'quay.io/biocontainers/snpeff:5.0--hdfd78af_1' }"
} else {
container "nfcore/snpeff:${task.ext.snpeff_tag}"
}
'quay.io/biocontainers/snpeff:5.0--hdfd78af_1' :
"nfcore/snpeff:${task.ext.container_tag}" }"
input:
tuple val(meta), path(vcf)
@ -29,14 +27,14 @@ process SNPEFF {
avail_mem = task.memory.giga
}
def prefix = task.ext.prefix ?: "${meta.id}"
def dir_cache = task.ext.use_cache ? "-dataDir \${PWD}/${cache}" : ""
def cache_command = cache ? "-dataDir \${PWD}/${cache}" : ""
"""
snpEff \\
-Xmx${avail_mem}g \\
$db \\
$args \\
-csvStats ${prefix}.csv \\
$dir_cache \\
$cache_command \\
$vcf \\
> ${prefix}.ann.vcf

View file

@ -3,8 +3,7 @@ process {
publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" }
withName: ENSEMBLVEP {
ext.vep_tag = '104.3.WBcel235'
ext.use_cache = false
ext.container_tag = '104.3.WBcel235'
}
}

View file

@ -3,8 +3,7 @@ process {
publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" }
withName: SNPEFF {
ext.snpeff_tag = '5.0.WBcel235'
ext.use_cache = false
ext.container_tag = '5.0.WBcel235'
}
}