Skip to content

Commit 33423ee

Browse files
Update fq/generate to using the versions topic channel (#11460)
* Update fq/generate to using the versions topic channel * Fix Harshil alignment * Apply suggestions from code review Co-authored-by: Louis Le Nézet <58640615+LouisLeNezet@users.noreply.github.com> * Update meta.yml based on linting fixes --------- Co-authored-by: Louis Le Nézet <58640615+LouisLeNezet@users.noreply.github.com>
1 parent 36cd6ae commit 33423ee

3 files changed

Lines changed: 57 additions & 36 deletions

File tree

modules/nf-core/fq/generate/main.nf

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ process FQ_GENERATE {
1111
val meta
1212

1313
output:
14-
tuple val(meta), path("*.fastq.gz"), emit: fastq
15-
path "versions.yml" , emit: versions
14+
tuple val(meta), path("*.fastq.gz") , emit: fastq
15+
tuple val("${task.process}"), val('fq'), eval("fq generate --version | sed 's/fq-generate //;s/ .*//'"), emit: versions_fq, topic: versions
1616

1717
when:
1818
task.ext.when == null || task.ext.when
@@ -24,22 +24,12 @@ process FQ_GENERATE {
2424
fq generate \\
2525
$args \\
2626
${prefix}_R1.fastq.gz ${prefix}_R2.fastq.gz
27-
28-
cat <<-END_VERSIONS > versions.yml
29-
"${task.process}":
30-
fq: \$(echo \$(fq generate --version | sed 's/fq-generate //g'))
31-
END_VERSIONS
3227
"""
3328

3429
stub:
3530
def prefix = task.ext.prefix ?: "${meta.id}"
3631
"""
37-
echo | gzip > ${prefix}_R1.fastq.gz
38-
echo | gzip > ${prefix}_R2.fastq.gz
39-
40-
cat <<-END_VERSIONS > versions.yml
41-
"${task.process}":
42-
fq: \$(echo \$(fq generate --version | sed 's/fq-generate //g'))
43-
END_VERSIONS
32+
echo "" | gzip > ${prefix}_R1.fastq.gz
33+
echo "" | gzip > ${prefix}_R2.fastq.gz
4434
"""
4535
}

modules/nf-core/fq/generate/meta.yml

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ tools:
1212
homepage: "https://github.com/stjude-rust-labs/fq"
1313
documentation: "https://github.com/stjude-rust-labs/fq"
1414
tool_dev_url: "https://github.com/stjude-rust-labs/fq"
15-
licence: ["MIT"]
15+
licence:
16+
- "MIT"
1617
identifier: ""
1718
input:
1819
- meta:
@@ -32,14 +33,28 @@ output:
3233
description: Random generated FASTQ files.
3334
pattern: "*_R[12].fastq.gz"
3435
ontologies:
35-
- edam: http://edamontology.org/format_3989 # GZIP format
36+
- edam: http://edamontology.org/format_3989 # GZIP
37+
versions_fq:
38+
- - ${task.process}:
39+
type: string
40+
description: The name of the process
41+
- fq:
42+
type: string
43+
description: The name of the tool
44+
- fq generate --version | sed 's/fq-generate //;s/ .*//':
45+
type: eval
46+
description: The expression to obtain the version of the tool
47+
topics:
3648
versions:
37-
- versions.yml:
38-
type: file
39-
description: File containing software versions
40-
pattern: "versions.yml"
41-
ontologies:
42-
- edam: http://edamontology.org/format_3750 # YAML
49+
- - ${task.process}:
50+
type: string
51+
description: The name of the process
52+
- fq:
53+
type: string
54+
description: The name of the tool
55+
- fq generate --version | sed 's/fq-generate //;s/ .*//':
56+
type: eval
57+
description: The expression to obtain the version of the tool
4358
authors:
4459
- "@adamrtalbot"
4560
maintainers:

modules/nf-core/fq/generate/tests/main.nf.test.snap

Lines changed: 30 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,11 @@
1515
]
1616
],
1717
"1": [
18-
"versions.yml:md5,cacd942133fef4aada49329843f0a582"
18+
[
19+
"FQ_GENERATE",
20+
"fq",
21+
"0.12.0"
22+
]
1923
],
2024
"fastq": [
2125
[
@@ -29,16 +33,20 @@
2933
]
3034
]
3135
],
32-
"versions": [
33-
"versions.yml:md5,cacd942133fef4aada49329843f0a582"
36+
"versions_fq": [
37+
[
38+
"FQ_GENERATE",
39+
"fq",
40+
"0.12.0"
41+
]
3442
]
3543
}
3644
],
45+
"timestamp": "2026-05-01T12:15:33.190349",
3746
"meta": {
38-
"nf-test": "0.9.0",
39-
"nextflow": "24.04.4"
40-
},
41-
"timestamp": "2024-10-19T16:38:52.818166434"
47+
"nf-test": "0.9.4",
48+
"nextflow": "26.04.0"
49+
}
4250
},
4351
"test fq": {
4452
"content": [
@@ -56,7 +64,11 @@
5664
]
5765
],
5866
"1": [
59-
"versions.yml:md5,cacd942133fef4aada49329843f0a582"
67+
[
68+
"FQ_GENERATE",
69+
"fq",
70+
"0.12.0"
71+
]
6072
],
6173
"fastq": [
6274
[
@@ -70,15 +82,19 @@
7082
]
7183
]
7284
],
73-
"versions": [
74-
"versions.yml:md5,cacd942133fef4aada49329843f0a582"
85+
"versions_fq": [
86+
[
87+
"FQ_GENERATE",
88+
"fq",
89+
"0.12.0"
90+
]
7591
]
7692
}
7793
],
94+
"timestamp": "2026-05-01T12:15:29.873962",
7895
"meta": {
79-
"nf-test": "0.9.0",
80-
"nextflow": "24.04.4"
81-
},
82-
"timestamp": "2024-10-19T16:38:39.365406108"
96+
"nf-test": "0.9.4",
97+
"nextflow": "26.04.0"
98+
}
8399
}
84100
}

0 commit comments

Comments
 (0)