Skip to content
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

Update bcftools query #3605

Merged
merged 13 commits into from
Jul 6, 2023
10 changes: 6 additions & 4 deletions modules/nf-core/bcftools/query/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,16 @@ process BCFTOOLS_QUERY {
path samples

output:
tuple val(meta), path("*.txt"), emit: txt
path "versions.yml" , emit: versions
tuple val(meta), path("*.${suffix}"), emit: output
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}"
suffix = task.ext.suffix ?: "txt"
def regions_file = regions ? "--regions-file ${regions}" : ""
def targets_file = targets ? "--targets-file ${targets}" : ""
def samples_file = samples ? "--samples-file ${samples}" : ""
Expand All @@ -33,7 +34,7 @@ process BCFTOOLS_QUERY {
$samples_file \\
$args \\
$vcf \\
> ${prefix}.txt
> ${prefix}.${suffix}

cat <<-END_VERSIONS > versions.yml
"${task.process}":
Expand All @@ -43,8 +44,9 @@ process BCFTOOLS_QUERY {

stub:
def prefix = task.ext.prefix ?: "${meta.id}"
suffix = task.ext.suffix ?: "txt"
"""
touch ${prefix}.txt \\
touch ${prefix}.${suffix} \\

cat <<-END_VERSIONS > versions.yml
"${task.process}":
Expand Down
3 changes: 1 addition & 2 deletions modules/nf-core/bcftools/query/meta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,9 @@ output:
description: |
Groovy Map containing sample information
e.g. [ id:'test', single_end:false ]
- txt:
- output:
type: file
description: BCFTools query output file
pattern: "*.txt"
- versions:
type: file
description: File containing software versions
Expand Down
4 changes: 2 additions & 2 deletions tests/modules/nf-core/bcftools/query/test.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
- name: bcftools query test_bcftools_query
command: nextflow run ./tests/modules/nf-core/bcftools/query -entry test_bcftools_query -c ./tests/config/nextflow.config -c ./tests/modules/nf-core/bcftools/query/nextflow.config
tags:
- bcftools
- bcftools/query
- bcftools
files:
- path: output/bcftools/out.txt
md5sum: 51d135de052f3bcef50dcd6b74806094
Expand All @@ -11,8 +11,8 @@
- name: bcftools query test_bcftools_query_with_optional_files
command: nextflow run ./tests/modules/nf-core/bcftools/query -entry test_bcftools_query_with_optional_files -c ./tests/config/nextflow.config -c ./tests/modules/nf-core/bcftools/query/nextflow.config
tags:
- bcftools
- bcftools/query
- bcftools
files:
- path: output/bcftools/out.txt
md5sum: 1785d1957ba7206df852d0689b91753f
Expand Down