Skip to content

POC: declare ext variable defaults as directives #8808

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
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
12 changes: 6 additions & 6 deletions modules/nf-core/samtools/sort/main.nf
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
process SAMTOOLS_SORT {
tag "$meta.id"
label 'process_medium'
ext prefix: "${meta.id}", args: '', when: true

conda "${moduleDir}/environment.yml"
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
Expand All @@ -18,12 +19,11 @@ process SAMTOOLS_SORT {
tuple val(meta), path("*.csi"), emit: csi, optional: true
path "versions.yml", emit: versions

when:
task.ext.when == null || task.ext.when
when: task.ext.when

script:
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"
def args = task.ext.args
def prefix = task.ext.prefix
def extension = args.contains("--output-fmt sam") ? "sam" :
args.contains("--output-fmt cram") ? "cram" :
"bam"
Expand All @@ -49,8 +49,8 @@ process SAMTOOLS_SORT {
"""

stub:
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"
def args = task.ext.args
def prefix = task.ext.prefix
def extension = args.contains("--output-fmt sam") ? "sam" :
args.contains("--output-fmt cram") ? "cram" :
"bam"
Expand Down
10 changes: 5 additions & 5 deletions modules/nf-core/smoove/call/main.nf
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
process SMOOVE_CALL {
tag "$meta.id"
label 'process_high'
ext prefix: "${meta.id}", args: '', when: true

conda "${moduleDir}/environment.yml"
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
Expand All @@ -16,12 +17,11 @@ process SMOOVE_CALL {
tuple val(meta), path("*.vcf.gz"), emit: vcf
path "versions.yml" , emit: versions

when:
task.ext.when == null || task.ext.when
when: task.ext.when

script:
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"
def args = task.ext.args
def prefix = task.ext.prefix

def exclude = exclude_beds ? "--exclude ${exclude_beds}" : ""
"""
Expand All @@ -41,7 +41,7 @@ process SMOOVE_CALL {
"""

stub:
def prefix = task.ext.prefix ?: "${meta.id}"
def prefix = task.ext.prefix
"""
echo "" | gzip > ${prefix}.vcf.gz

Expand Down
Loading