Skip to content

Commit 8a013d3

Browse files
LouisLeNezetLouisLeNezet
andauthored
Update SAMTOOLS/COLLATEFASTQ to topics (#9886)
* Update to topics * Change snapshot * Update snapshot --------- Co-authored-by: LouisLeNezet <louislenezet@gmaio.com>
1 parent a77125b commit 8a013d3

4 files changed

Lines changed: 301 additions & 209 deletions

File tree

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

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ process SAMTOOLS_COLLATEFASTQ {
1313
val(interleave)
1414

1515
output:
16-
tuple val(meta), path("*_{1,2}.fq.gz") , optional:true, emit: fastq
17-
tuple val(meta), path("*_interleaved.fq") , optional:true, emit: fastq_interleaved
16+
tuple val(meta), path("*_{1,2}.fq.gz") , emit: fastq , optional:true
17+
tuple val(meta), path("*_interleaved.fq") , emit: fastq_interleaved, optional:true
1818
tuple val(meta), path("*_other.fq.gz") , emit: fastq_other
19-
tuple val(meta), path("*_singleton.fq.gz") , optional:true, emit: fastq_singleton
20-
path "versions.yml" , emit: versions
19+
tuple val(meta), path("*_singleton.fq.gz") , emit: fastq_singleton , optional:true
20+
tuple val("${task.process}"), val('samtools'), eval("samtools version | sed '1!d;s/.* //'"), topic: versions, emit: versions_samtools
2121

2222
when:
2323
task.ext.when == null || task.ext.when
@@ -46,11 +46,6 @@ process SAMTOOLS_COLLATEFASTQ {
4646
${reference} \\
4747
-0 ${prefix}_other.fq.gz \\
4848
$output
49-
50-
cat <<-END_VERSIONS > versions.yml
51-
"${task.process}":
52-
samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//')
53-
END_VERSIONS
5449
"""
5550

5651
stub:
@@ -67,10 +62,5 @@ process SAMTOOLS_COLLATEFASTQ {
6762
${interleavecommand}
6863
${singletoncommand}
6964
${empty}> ${prefix}_other.fq.gz
70-
71-
cat <<-END_VERSIONS > versions.yml
72-
"${task.process}":
73-
samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//')
74-
END_VERSIONS
7565
"""
7666
}

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

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -95,14 +95,27 @@ output:
9595
pattern: "*_singleton.fq.gz"
9696
ontologies:
9797
- edam: http://edamontology.org/format_3989 # GZIP format
98+
versions_samtools:
99+
- - ${task.process}:
100+
type: string
101+
description: The name of the process
102+
- samtools:
103+
type: string
104+
description: The name of the tool
105+
- samtools version | sed '1!d;s/.* //':
106+
type: eval
107+
description: The expression to obtain the version of the tool
108+
topics:
98109
versions:
99-
- versions.yml:
100-
type: file
101-
description: File containing software versions
102-
pattern: "versions.yml"
103-
104-
ontologies:
105-
- edam: http://edamontology.org/format_3750 # YAML
110+
- - ${task.process}:
111+
type: string
112+
description: The name of the process
113+
- samtools:
114+
type: string
115+
description: The name of the tool
116+
- samtools version | sed '1!d;s/.* //':
117+
type: eval
118+
description: The expression to obtain the version of the tool
106119
authors:
107120
- "@lescai"
108121
- "@maxulysse"

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

Lines changed: 74 additions & 94 deletions
Original file line numberDiff line numberDiff line change
@@ -15,24 +15,24 @@ nextflow_process {
1515
process {
1616
"""
1717
input[0] = [
18-
[ id:'test', single_end:false ], // meta map
19-
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/test.paired_end.sorted.bam', checkIfExists: true)
20-
]
18+
[ id:'test' ],
19+
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/test.paired_end.sorted.bam', checkIfExists: true)
20+
]
2121
input[1] = [
22-
[ id:'test' ], // meta map
23-
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta', checkIfExists: true)
24-
]
22+
[ id:'test' ],
23+
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta', checkIfExists: true)
24+
]
2525
input[2] = false
2626
"""
2727
}
2828
}
2929

3030
then {
31-
assertAll(
32-
{ assert process.success },
33-
{ assert snapshot(process.out.fastq,
34-
process.out.versions).match() }
35-
)
31+
assert process.success
32+
assert snapshot(
33+
process.out.fastq,
34+
["versions_samtools": process.out.versions_samtools]
35+
).match()
3636
}
3737

3838
}
@@ -43,24 +43,24 @@ nextflow_process {
4343
process {
4444
"""
4545
input[0] = [
46-
[ id:'test', single_end:true ], // meta map
47-
file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.single_end.bam', checkIfExists: true)
48-
]
46+
[ id:'test', single_end:true ],
47+
file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.single_end.bam', checkIfExists: true)
48+
]
4949
input[1] = [
50-
[ id:'test' ], // meta map
51-
file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true)
52-
]
50+
[ id:'test' ],
51+
file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true)
52+
]
5353
input[2] = false
5454
"""
5555
}
5656
}
5757

5858
then {
59-
assertAll(
60-
{ assert process.success },
61-
{ assert snapshot(process.out.fastq_other,
62-
process.out.versions).match() }
63-
)
59+
assert process.success
60+
assert snapshot(
61+
process.out.fastq_other,
62+
["versions_samtools": process.out.versions_samtools]
63+
).match()
6464
}
6565

6666
}
@@ -71,24 +71,24 @@ nextflow_process {
7171
process {
7272
"""
7373
input[0] = [
74-
[ id:'test', single_end:false ], // meta map
75-
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/cram/test.paired_end.sorted.cram', checkIfExists: true)
76-
]
74+
[ id:'test' ],
75+
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/cram/test.paired_end.sorted.cram', checkIfExists: true)
76+
]
7777
input[1] = [
78-
[ id:'test' ], // meta map
79-
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta', checkIfExists: true)
80-
]
78+
[ id:'test' ],
79+
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta', checkIfExists: true)
80+
]
8181
input[2] = false
8282
"""
8383
}
8484
}
8585

8686
then {
87-
assertAll(
88-
{ assert process.success },
89-
{ assert snapshot(process.out.fastq,
90-
process.out.versions).match() }
91-
)
87+
assert process.success
88+
assert snapshot(
89+
process.out.fastq,
90+
["versions_samtools": process.out.versions_samtools]
91+
).match()
9292
}
9393

9494
}
@@ -99,26 +99,26 @@ nextflow_process {
9999
process {
100100
"""
101101
input[0] = [
102-
[ id:'test', single_end:false ], // meta map
103-
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/test.paired_end.sorted.bam', checkIfExists: true)
104-
]
102+
[ id:'test' ],
103+
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/test.paired_end.sorted.bam', checkIfExists: true)
104+
]
105105
input[1] = [
106-
[ id:'test' ], // meta map
107-
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta', checkIfExists: true)
108-
]
106+
[ id:'test' ],
107+
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta', checkIfExists: true)
108+
]
109109
input[2] = true
110110
"""
111111
}
112112
}
113113

114114
then {
115-
assertAll(
116-
{ assert process.success },
117-
{ assert snapshot(process.out.fastq_interleaved,
118-
process.out.fastq_singleton,
119-
process.out.fastq,
120-
process.out.versions).match() }
121-
)
115+
assert process.success
116+
assert snapshot(
117+
process.out.fastq_interleaved,
118+
process.out.fastq_singleton,
119+
process.out.fastq,
120+
["versions_samtools": process.out.versions_samtools]
121+
).match()
122122
}
123123

124124
}
@@ -129,24 +129,20 @@ nextflow_process {
129129
process {
130130
"""
131131
input[0] = [
132-
[ id:'test', single_end:false ], // meta map
133-
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/test.paired_end.sorted.bam', checkIfExists: true)
134-
]
132+
[ id:'test' ],
133+
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/test.paired_end.sorted.bam', checkIfExists: true)
134+
]
135135
input[1] = [
136-
[ id:'test' ], // meta map
137-
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta', checkIfExists: true)
138-
]
136+
[ id:'test' ],
137+
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta', checkIfExists: true)
138+
]
139139
input[2] = false
140140
"""
141141
}
142142
}
143143

144144
then {
145-
assertAll(
146-
{ assert process.success },
147-
{ assert snapshot(process.out.fastq,
148-
process.out.versions).match() }
149-
)
145+
assert snapshot(sanitizeOutput(process.out)).match()
150146
}
151147

152148
}
@@ -157,24 +153,20 @@ nextflow_process {
157153
process {
158154
"""
159155
input[0] = [
160-
[ id:'test', single_end:true ], // meta map
161-
file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.single_end.bam', checkIfExists: true)
162-
]
156+
[ id:'test', single_end:true ],
157+
file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.single_end.bam', checkIfExists: true)
158+
]
163159
input[1] = [
164-
[ id:'test' ], // meta map
165-
file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true)
166-
]
160+
[ id:'test' ],
161+
file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true)
162+
]
167163
input[2] = false
168164
"""
169165
}
170166
}
171167

172168
then {
173-
assertAll(
174-
{ assert process.success },
175-
{ assert snapshot(process.out.fastq_other,
176-
process.out.versions).match() }
177-
)
169+
assert snapshot(sanitizeOutput(process.out)).match()
178170
}
179171

180172
}
@@ -185,24 +177,20 @@ nextflow_process {
185177
process {
186178
"""
187179
input[0] = [
188-
[ id:'test', single_end:false ], // meta map
189-
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/cram/test.paired_end.sorted.cram', checkIfExists: true)
190-
]
180+
[ id:'test' ],
181+
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/cram/test.paired_end.sorted.cram', checkIfExists: true)
182+
]
191183
input[1] = [
192-
[ id:'test' ], // meta map
193-
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta', checkIfExists: true)
194-
]
184+
[ id:'test' ],
185+
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta', checkIfExists: true)
186+
]
195187
input[2] = false
196188
"""
197189
}
198190
}
199191

200192
then {
201-
assertAll(
202-
{ assert process.success },
203-
{ assert snapshot(process.out.fastq,
204-
process.out.versions).match() }
205-
)
193+
assert snapshot(sanitizeOutput(process.out)).match()
206194
}
207195

208196
}
@@ -213,30 +201,22 @@ nextflow_process {
213201
process {
214202
"""
215203
input[0] = [
216-
[ id:'test', single_end:false ], // meta map
217-
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/test.paired_end.sorted.bam', checkIfExists: true)
218-
]
204+
[ id:'test' ],
205+
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/bam/test.paired_end.sorted.bam', checkIfExists: true)
206+
]
219207
input[1] = [
220-
[ id:'test' ], // meta map
221-
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta', checkIfExists: true)
222-
]
208+
[ id:'test' ],
209+
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta', checkIfExists: true)
210+
]
223211
input[2] = true
224212
"""
225213
}
226214
}
227215

228216
then {
229-
assertAll(
230-
{ assert process.success },
231-
{ assert snapshot(process.out.fastq_interleaved,
232-
process.out.fastq_singleton,
233-
process.out.fastq,
234-
process.out.versions).match() }
235-
)
217+
assert snapshot(sanitizeOutput(process.out)).match()
236218
}
237219

238220
}
239221

240-
241-
242222
}

0 commit comments

Comments
 (0)