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
14 changes: 3 additions & 11 deletions modules/nf-core/samtools/sort/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ process SAMTOOLS_SORT {
tuple val(meta), path("${prefix}.${extension}.crai"), emit: crai, optional: true
tuple val(meta), path("${prefix}.${extension}.csi"), emit: csi, optional: true
tuple val(meta), path("${prefix}.${extension}.bai"), emit: bai, optional: true
path "versions.yml", emit: versions

tuple val("${task.process}"), val('samtools'), eval("samtools version | sed '1!d;s/.* //'"), topic: versions, emit: versions_samtools
when:
task.ext.when == null || task.ext.when

Expand Down Expand Up @@ -53,10 +53,6 @@ process SAMTOOLS_SORT {
-o ${output_file} \\
-

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

stub:
Expand All @@ -77,10 +73,6 @@ process SAMTOOLS_SORT {
"""
touch ${prefix}.${extension}
${index}

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

"""
}
30 changes: 22 additions & 8 deletions modules/nf-core/samtools/sort/meta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ output:
description: Sorted SAM file
pattern: "*.{sam}"
ontologies: []

crai:
- - meta:
type: map
Expand Down Expand Up @@ -110,13 +109,28 @@ output:
description: BAM index file (optional)
pattern: "*.bai"
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: The process the versions were collected from
- samtools:
type: string
description: The tool name
- samtools version | sed '1!d;s/.* //':
type: string
description: The command used to generate the version of the tool

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"
- "@ewels"
Expand Down
20 changes: 10 additions & 10 deletions modules/nf-core/samtools/sort/tests/main.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ nextflow_process {
{ assert snapshot(
process.out.bam,
process.out.bai,
process.out.versions
process.out.findAll { key, val -> key.startsWith("versions") }
).match()}
)
}
Expand Down Expand Up @@ -66,7 +66,7 @@ nextflow_process {
{ assert snapshot(
process.out.bam,
process.out.bai,
process.out.versions
process.out.findAll { key, val -> key.startsWith("versions") }
).match()}
)
}
Expand Down Expand Up @@ -98,7 +98,7 @@ nextflow_process {
{ assert snapshot(
process.out.bam,
process.out.csi,
process.out.versions
process.out.findAll { key, val -> key.startsWith("versions") }
).match()}
)
}
Expand Down Expand Up @@ -133,7 +133,7 @@ nextflow_process {
{ assert snapshot(
process.out.bam,
process.out.csi.collect { it.collect { it instanceof Map ? it : file(it).name } },
process.out.versions
process.out.findAll { key, val -> key.startsWith("versions") }
).match()}
)
}
Expand Down Expand Up @@ -168,7 +168,7 @@ nextflow_process {
{ assert snapshot(
process.out.bam,
process.out.bai.collect { it.collect { it instanceof Map ? it : file(it).name } },
process.out.versions
process.out.findAll { key, val -> key.startsWith("versions") }
).match()}
)
}
Expand Down Expand Up @@ -203,7 +203,7 @@ nextflow_process {
{ assert snapshot(
process.out.bam,
process.out.csi.collect { it.collect { it instanceof Map ? it : file(it).name } },
process.out.versions
process.out.findAll { key, val -> key.startsWith("versions") }
).match()}
)
}
Expand Down Expand Up @@ -235,7 +235,7 @@ nextflow_process {
{ assert snapshot(
process.out.cram.collect { it.collect { it instanceof Map ? it : file(it).name } },
process.out.crai.collect { it.collect { it instanceof Map ? it : file(it).name } },
process.out.versions
process.out.findAll { key, val -> key.startsWith("versions") }
).match()}
)
}
Expand Down Expand Up @@ -265,7 +265,7 @@ nextflow_process {
then {
assertAll (
{ assert process.success },
{ assert snapshot(process.out).match() }
{ assert snapshot(process.out.findAll { key, val -> key.startsWith("versions") }).match() }
)
}
}
Expand Down Expand Up @@ -296,7 +296,7 @@ nextflow_process {
then {
assertAll (
{ assert process.success },
{ assert snapshot(process.out).match() }
{ assert snapshot(process.out.findAll { key, val -> key.startsWith("versions") }).match() }
)
}
}
Expand Down Expand Up @@ -325,7 +325,7 @@ nextflow_process {
then {
assertAll (
{ assert process.success },
{ assert snapshot(process.out).match() }
{ assert snapshot(process.out.findAll { key, val -> key.startsWith("versions") }).match() }
)
}
}
Expand Down
Loading