Skip to content

Commit

Permalink
make samtools/convert follow output guidelines (nf-core#5060)
Browse files Browse the repository at this point in the history
  • Loading branch information
matthdsm authored Mar 7, 2024
1 parent 14ba464 commit 1b93e06
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 38 deletions.
7 changes: 5 additions & 2 deletions modules/nf-core/samtools/convert/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,11 @@ process SAMTOOLS_CONVERT {
tuple val(meta3), path(fai)

output:
tuple val(meta), path("*.{cram,bam}"), path("*.{crai,bai}") , emit: alignment_index
path "versions.yml" , emit: versions
tuple val(meta), path("*.bam") , emit: bam , optional: true
tuple val(meta), path("*.cram") , emit: cram, optional: true
tuple val(meta), path("*.bai") , emit: bai , optional: true
tuple val(meta), path("*.crai") , emit: crai, optional: true
path "versions.yml" , emit: versions

when:
task.ext.when == null || task.ext.when
Expand Down
19 changes: 16 additions & 3 deletions modules/nf-core/samtools/convert/meta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,22 @@ output:
description: |
Groovy Map containing sample information
e.g. [ id:'test', single_end:false ]
- alignment_index:
- bam:
type: file
description: filtered/converted BAM/CRAM file + index
pattern: "*{.bam/cram,.bai/crai}"
description: filtered/converted BAM file
pattern: "*{.bam}"
- cram:
type: file
description: filtered/converted CRAM file
pattern: "*{cram}"
- bai:
type: file
description: filtered/converted BAM index
pattern: "*{.bai}"
- crai:
type: file
description: filtered/converted CRAM index
pattern: "*{.crai}"
- version:
type: file
description: File containing software version
Expand All @@ -53,3 +65,4 @@ authors:
maintainers:
- "@FriederikeHanssen"
- "@maxulysse"
- "@matthdsm"
12 changes: 6 additions & 6 deletions modules/nf-core/samtools/convert/tests/main.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ nextflow_process {
then {
assertAll(
{ assert process.success },
{ assert snapshot(file(process.out.alignment_index[0][1]).name).match("bam_alignment_index_1") },
{ assert snapshot(file(process.out.alignment_index[0][2]).name).match("bam_alignment_index_2") },
{ assert snapshot(process.out.versions).match("bam_versions") }
{ assert snapshot(file(process.out.cram[0][1]).name).match("bam_to_cram_alignment") },
{ assert snapshot(file(process.out.crai[0][1]).name).match("bam_to_cram_index") },
{ assert snapshot(process.out.versions).match("bam_to_cram_versions") }
)
}
}
Expand Down Expand Up @@ -66,9 +66,9 @@ nextflow_process {
then {
assertAll(
{ assert process.success },
{ assert snapshot(file(process.out.alignment_index[0][1]).name).match("cram_alignment_index_1") },
{ assert snapshot(file(process.out.alignment_index[0][2]).name).match("cram_alignment_index_2") },
{ assert snapshot(process.out.versions).match("cram_versions") }
{ assert snapshot(file(process.out.bam[0][1]).name).match("cram_to_bam_alignment") },
{ assert snapshot(file(process.out.bai[0][1]).name).match("cram_to_bam_alignment_index") },
{ assert snapshot(process.out.versions).match("cram_to_bam_versions") }
)
}
}
Expand Down
54 changes: 27 additions & 27 deletions modules/nf-core/samtools/convert/tests/main.nf.test.snap

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 1b93e06

Please sign in to comment.