Skip to content
Merged
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: 1 addition & 11 deletions modules/nf-core/samtools/view/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ process SAMTOOLS_VIEW {
tuple val(meta), path("${prefix}.${file_type}.crai"), emit: crai, optional: true
tuple val(meta), path("${prefix}.unselected.${file_type}"), emit: unselected, optional: true
tuple val(meta), path("${prefix}.unselected.${file_type}.{csi,crai}"), emit: unselected_index, optional: true
path "versions.yml", emit: versions
tuple val("${task.process}"), val('samtools'), eval('samtools --version | head -1 | sed -e "s/samtools //"'), emit: versions_samtools, topic: versions

when:
task.ext.when == null || task.ext.when
Expand Down Expand Up @@ -60,11 +60,6 @@ process SAMTOOLS_VIEW {
-o ${output_file} \\
$input \\
$args2

cat <<-END_VERSIONS > versions.yml
"${task.process}":
samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//')
END_VERSIONS
"""

stub:
Expand Down Expand Up @@ -95,10 +90,5 @@ process SAMTOOLS_VIEW {
${index}
${unselected}
${unselected_index}

cat <<-END_VERSIONS > versions.yml
"${task.process}":
samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//')
END_VERSIONS
"""
}
30 changes: 23 additions & 7 deletions modules/nf-core/samtools/view/meta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -140,13 +140,29 @@ output:
description: index for the "unselected" file
pattern: "*.unselected.{csi,crai}"
ontologies: []
versions:
- versions.yml:
type: file
description: File containing software versions
pattern: "versions.yml"
ontologies:
- edam: http://edamontology.org/format_3750 # YAML
versions_samtools:
- - ${task.process}:
type: string
description: Name of the process
- samtools:
type: string
description: Name of the tool
- samtools --version | head -1 | sed -e "s/samtools //:
type: string
description: Version of samtools used

topics:
- versions:
- - process:
type: string
description: The process the versions were collected from
- tool:
type: string
description: The tool name
- version:
type: string
description: The version of the tool

authors:
- "@drpatelh"
- "@joseespinosa"
Expand Down
77 changes: 10 additions & 67 deletions modules/nf-core/samtools/view/tests/main.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,7 @@ nextflow_process {
then {
assertAll(
{ assert process.success },
{ assert snapshot(file(process.out.bam[0][1]).name).match("bam_bam") },
{ assert snapshot(process.out.bai).match("bam_bai") },
{ assert snapshot(process.out.crai).match("bam_crai") },
{ assert snapshot(process.out.cram).match("bam_cram") },
{ assert snapshot(process.out.csi).match("bam_csi") },
{ assert snapshot(process.out.sam).match("bam_sam") },
{ assert snapshot(process.out.versions).match("bam_versions") }
{ assert snapshot(sanitizeOutput(process.out, unstableKeys: ["bam"])).match()}
)
}
}
Expand All @@ -62,11 +56,7 @@ nextflow_process {
then {
assertAll(
{ assert process.success },
{ assert snapshot(
file(process.out.bam[0][1]).name,
file(process.out.csi[0][1]).name,
process.out.versions).match()
}
{ assert snapshot(sanitizeOutput(process.out, unstableKeys: ["bam", "csi"])).match()}
)
}
}
Expand All @@ -93,10 +83,7 @@ nextflow_process {
then {
assertAll(
{ assert process.success },
{ assert snapshot(
file(process.out.bam[0][1]).name,
file(process.out.bai[0][1]).name,
process.out.versions).match() }
{ assert snapshot(sanitizeOutput(process.out, unstableKeys: ["bam", "bai"])).match()}
)
}
}
Expand Down Expand Up @@ -124,13 +111,7 @@ nextflow_process {
then {
assertAll(
{ assert process.success },
{ assert snapshot(
file(process.out.bam[0][1]).name,
file(process.out.bai[0][1]).name,
file(process.out.unselected[0][1]).name,
file(process.out.unselected_index[0][1]).name,
process.out.versions).match()
}
{ assert snapshot(sanitizeOutput(process.out, unstableKeys: ["bam", "bai", "unselected", "unselected_index"])).match()}
)
}
}
Expand Down Expand Up @@ -158,13 +139,7 @@ nextflow_process {
then {
assertAll(
{ assert process.success },
{ assert snapshot(
file(process.out.cram[0][1]).name,
file(process.out.crai[0][1]).name,
file(process.out.unselected[0][1]).name,
file(process.out.unselected_index[0][1]).name,
process.out.versions).match()
}
{ assert snapshot(sanitizeOutput(process.out, unstableKeys: ["bam", "bai", "unselected", "unselected_index", "crai"])).match()}
)
}
}
Expand Down Expand Up @@ -192,13 +167,7 @@ nextflow_process {
then {
assertAll(
{ assert process.success },
{ assert snapshot(file(process.out.cram[0][1]).name).match("cram_cram") },
{ assert snapshot(process.out.bai).match("cram_bai") },
{ assert snapshot(process.out.bam).match("cram_bam") },
{ assert snapshot(process.out.crai).match("cram_crai") },
{ assert snapshot(process.out.csi).match("cram_csi") },
{ assert snapshot(process.out.sam).match("cram_sam") },
{ assert snapshot(process.out.versions).match("cram_versions") }
{ assert snapshot(sanitizeOutput(process.out, unstableKeys: ["cram"])).match()}
)
}
}
Expand Down Expand Up @@ -228,13 +197,7 @@ nextflow_process {
then {
assertAll(
{ assert process.success },
{ assert snapshot(file(process.out.bam[0][1]).name).match("cram_to_bam_bam") },
{ assert snapshot(process.out.bai).match("cram_to_bam_bai") },
{ assert snapshot(process.out.crai).match("cram_to_bam_crai") },
{ assert snapshot(process.out.cram).match("cram_to_bam_cram") },
{ assert snapshot(process.out.csi).match("cram_to_bam_csi") },
{ assert snapshot(process.out.sam).match("cram_to_bam_sam") },
{ assert snapshot(process.out.versions).match("cram_to_bam_versions") }
{ assert snapshot(sanitizeOutput(process.out, unstableKeys: ["bam"])).match()}
)
}
}
Expand Down Expand Up @@ -264,13 +227,7 @@ nextflow_process {
then {
assertAll(
{ assert process.success },
{ assert snapshot(file(process.out.bam[0][1]).name).match("cram_to_bam_index_bam") },
{ assert snapshot(file(process.out.csi[0][1]).name).match("cram_to_bam_index_csi") },
{ assert snapshot(process.out.bai).match("cram_to_bam_index_bai") },
{ assert snapshot(process.out.crai).match("cram_to_bam_index_crai") },
{ assert snapshot(process.out.cram).match("cram_to_bam_index_cram") },
{ assert snapshot(process.out.sam).match("cram_to_bam_index_sam") },
{ assert snapshot(process.out.versions).match("cram_to_bam_index_versions") }
{ assert snapshot(sanitizeOutput(process.out, unstableKeys: ["bam", "csi"])).match()}
)
}
}
Expand Down Expand Up @@ -300,15 +257,7 @@ nextflow_process {
then {
assertAll(
{ assert process.success },
{ assert snapshot(file(process.out.bam[0][1]).name).match("cram_to_bam_index_qname_bam") },
{ assert snapshot(file(process.out.csi[0][1]).name).match("cram_to_bam_index_qname_csi") },
{ assert snapshot(process.out.bai).match("cram_to_bam_index_qname_bai") },
{ assert snapshot(process.out.crai).match("cram_to_bam_index_qname_crai") },
{ assert snapshot(process.out.cram).match("cram_to_bam_index_qname_cram") },
{ assert snapshot(process.out.sam).match("cram_to_bam_index_qname_sam") },
{ assert snapshot(file(process.out.unselected[0][1]).name).match("cram_to_bam_index_qname_unselected") },
{ assert snapshot(file(process.out.unselected_index[0][1]).name).match("cram_to_bam_index_qname_unselected_csi") },
{ assert snapshot(process.out.versions).match("cram_to_bam_index_qname_versions") }
{ assert snapshot(sanitizeOutput(process.out, unstableKeys: ["bam", "bai", "unselected", "unselected_index"])).match()}
)
}
}
Expand Down Expand Up @@ -336,13 +285,7 @@ nextflow_process {
then {
assertAll(
{ assert process.success },
{ assert snapshot(file(process.out.bam[0][1]).name).match("bam_stub_bam") },
{ assert snapshot(file(process.out.csi[0][1]).name).match("bam_stub_csi") },
{ assert snapshot(process.out.bai).match("bam_stub_bai") },
{ assert snapshot(process.out.crai).match("bam_stub_crai") },
{ assert snapshot(process.out.cram).match("bam_stub_cram") },
{ assert snapshot(process.out.sam).match("bam_stub_sam") },
{ assert snapshot(process.out.versions).match("bam_stub_versions") }
{ assert snapshot(sanitizeOutput(process.out, unstableKeys: ["bam", "csi"])).match()}
)
}
}
Expand Down
Loading