Skip to content

Commit 0ab9ac3

Browse files
feat: update samtools sort module with version topic support (#9275)
* feat: update samtools sort module with version topic support * feat: update samtools sort module with version topic support * feat: update samtools sort module with version topic support * feat: update samtools sort module with version topic support * feat: update samtools sort module with version topic support * feat: update samtools sort module with version topic support * feat: update samtools sort module with version topic support * Update meta.yml and test snapshot * remove .devcontainer * Revert "remove .devcontainer" This reverts commit a97a7a2. --------- Co-authored-by: Marcel Ribeiro-Dantas <[email protected]> Co-authored-by: Marcel Ribeiro-Dantas <[email protected]>
1 parent e81fbf7 commit 0ab9ac3

File tree

5 files changed

+237
-360
lines changed

5 files changed

+237
-360
lines changed

modules/nf-core/samtools/sort/main.nf

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ process SAMTOOLS_SORT {
1919
tuple val(meta), path("${prefix}.${extension}.crai"), emit: crai, optional: true
2020
tuple val(meta), path("${prefix}.${extension}.csi"), emit: csi, optional: true
2121
tuple val(meta), path("${prefix}.${extension}.bai"), emit: bai, optional: true
22-
path "versions.yml", emit: versions
23-
22+
tuple val("${task.process}"), val('samtools'), eval("samtools version | sed '1!d;s/.* //'"), topic: versions, emit: versions_samtools
23+
2424
when:
2525
task.ext.when == null || task.ext.when
2626

@@ -53,10 +53,6 @@ process SAMTOOLS_SORT {
5353
-o ${output_file} \\
5454
-
5555
56-
cat <<-END_VERSIONS > versions.yml
57-
"${task.process}":
58-
samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//')
59-
END_VERSIONS
6056
"""
6157

6258
stub:
@@ -77,10 +73,6 @@ process SAMTOOLS_SORT {
7773
"""
7874
touch ${prefix}.${extension}
7975
${index}
80-
81-
cat <<-END_VERSIONS > versions.yml
82-
"${task.process}":
83-
samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//')
84-
END_VERSIONS
76+
8577
"""
8678
}

modules/nf-core/samtools/sort/meta.yml

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@ output:
7676
description: Sorted SAM file
7777
pattern: "*.{sam}"
7878
ontologies: []
79-
8079
crai:
8180
- - meta:
8281
type: map
@@ -110,13 +109,28 @@ output:
110109
description: BAM index file (optional)
111110
pattern: "*.bai"
112111
ontologies: []
113-
versions:
114-
- versions.yml:
115-
type: file
116-
description: File containing software versions
117-
pattern: "versions.yml"
118-
ontologies:
119-
- edam: http://edamontology.org/format_3750 # YAML
112+
versions_samtools:
113+
- - ${task.process}:
114+
type: string
115+
description: The process the versions were collected from
116+
- samtools:
117+
type: string
118+
description: The tool name
119+
- samtools version | sed '1!d;s/.* //':
120+
type: string
121+
description: The command used to generate the version of the tool
122+
123+
topics:
124+
- versions:
125+
- - process:
126+
type: string
127+
description: The process the versions were collected from
128+
- tool:
129+
type: string
130+
description: The tool name
131+
- version:
132+
type: string
133+
description: The version of the tool
120134
authors:
121135
- "@drpatelh"
122136
- "@ewels"

modules/nf-core/samtools/sort/tests/main.nf.test

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ nextflow_process {
3434
{ assert snapshot(
3535
process.out.bam,
3636
process.out.bai,
37-
process.out.versions
37+
process.out.findAll { key, val -> key.startsWith("versions") }
3838
).match()}
3939
)
4040
}
@@ -66,7 +66,7 @@ nextflow_process {
6666
{ assert snapshot(
6767
process.out.bam,
6868
process.out.bai,
69-
process.out.versions
69+
process.out.findAll { key, val -> key.startsWith("versions") }
7070
).match()}
7171
)
7272
}
@@ -98,7 +98,7 @@ nextflow_process {
9898
{ assert snapshot(
9999
process.out.bam,
100100
process.out.csi,
101-
process.out.versions
101+
process.out.findAll { key, val -> key.startsWith("versions") }
102102
).match()}
103103
)
104104
}
@@ -133,7 +133,7 @@ nextflow_process {
133133
{ assert snapshot(
134134
process.out.bam,
135135
process.out.csi.collect { it.collect { it instanceof Map ? it : file(it).name } },
136-
process.out.versions
136+
process.out.findAll { key, val -> key.startsWith("versions") }
137137
).match()}
138138
)
139139
}
@@ -168,7 +168,7 @@ nextflow_process {
168168
{ assert snapshot(
169169
process.out.bam,
170170
process.out.bai.collect { it.collect { it instanceof Map ? it : file(it).name } },
171-
process.out.versions
171+
process.out.findAll { key, val -> key.startsWith("versions") }
172172
).match()}
173173
)
174174
}
@@ -203,7 +203,7 @@ nextflow_process {
203203
{ assert snapshot(
204204
process.out.bam,
205205
process.out.csi.collect { it.collect { it instanceof Map ? it : file(it).name } },
206-
process.out.versions
206+
process.out.findAll { key, val -> key.startsWith("versions") }
207207
).match()}
208208
)
209209
}
@@ -235,7 +235,7 @@ nextflow_process {
235235
{ assert snapshot(
236236
process.out.cram.collect { it.collect { it instanceof Map ? it : file(it).name } },
237237
process.out.crai.collect { it.collect { it instanceof Map ? it : file(it).name } },
238-
process.out.versions
238+
process.out.findAll { key, val -> key.startsWith("versions") }
239239
).match()}
240240
)
241241
}
@@ -265,7 +265,7 @@ nextflow_process {
265265
then {
266266
assertAll (
267267
{ assert process.success },
268-
{ assert snapshot(process.out).match() }
268+
{ assert snapshot(process.out.findAll { key, val -> key.startsWith("versions") }).match() }
269269
)
270270
}
271271
}
@@ -296,7 +296,7 @@ nextflow_process {
296296
then {
297297
assertAll (
298298
{ assert process.success },
299-
{ assert snapshot(process.out).match() }
299+
{ assert snapshot(process.out.findAll { key, val -> key.startsWith("versions") }).match() }
300300
)
301301
}
302302
}
@@ -325,7 +325,7 @@ nextflow_process {
325325
then {
326326
assertAll (
327327
{ assert process.success },
328-
{ assert snapshot(process.out).match() }
328+
{ assert snapshot(process.out.findAll { key, val -> key.startsWith("versions") }).match() }
329329
)
330330
}
331331
}

0 commit comments

Comments
 (0)