Skip to content

Commit 51cd38b

Browse files
Add Topic-based tool version capture to Trinity Module (#9273)
* add versions topic to trinity module * add missing test for main.nf.test * simplify string replacement for trinity version eval to remove use of colons - avoids potential yml clash * update meta.yml to capture new version topics change * add new test for aggregating versions via topic * update snapshot for new tests * Update modules/nf-core/trinity/meta.yml remove leading space Co-authored-by: Nicolas Vannieuwkerke <[email protected]> --------- Co-authored-by: Nicolas Vannieuwkerke <[email protected]>
1 parent e7def47 commit 51cd38b

File tree

4 files changed

+78
-85
lines changed

4 files changed

+78
-85
lines changed

modules/nf-core/trinity/main.nf

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ process TRINITY {
1414
output:
1515
tuple val(meta), path("*.fa.gz") , emit: transcript_fasta
1616
tuple val(meta), path("*.log") , emit: log
17-
path "versions.yml" , emit: versions
17+
tuple val("${task.process}"), val('trinity'), eval("Trinity --version | grep 'Trinity version' | sed 's/.*Trinity-v//'"), topic: versions, emit: versions_trinity
1818

1919
when:
2020
task.ext.when == null || task.ext.when
@@ -61,11 +61,6 @@ process TRINITY {
6161
> ${prefix}.fa.gz
6262
6363
rm ${prefix}_trinity.Trinity.fasta
64-
65-
cat <<-END_VERSIONS > versions.yml
66-
"${task.process}":
67-
trinity: \$(Trinity --version | grep 'Trinity version:' | sed 's/Trinity version: Trinity-//')
68-
END_VERSIONS
6964
"""
7065

7166
stub:
@@ -74,10 +69,5 @@ process TRINITY {
7469
touch ${prefix}.fa
7570
gzip ${prefix}.fa
7671
touch ${prefix}.log
77-
78-
cat <<-END_VERSIONS > versions.yml
79-
"${task.process}":
80-
trinity: \$(Trinity --version | grep 'Trinity version:' | sed 's/Trinity version: Trinity-//')
81-
END_VERSIONS
8272
"""
8373
}

modules/nf-core/trinity/meta.yml

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,27 @@ output:
5151
description: Log from trinity
5252
pattern: "*.log"
5353
ontologies: []
54-
versions:
55-
- versions.yml:
56-
type: file
57-
description: File containing software versions
58-
pattern: "versions.yml"
59-
ontologies:
60-
- edam: http://edamontology.org/format_3750 # YAML
54+
versions_trinity:
55+
- - ${task.process}:
56+
type: string
57+
description: The process the versions were collected from
58+
- trinity:
59+
type: string
60+
description: The tool name
61+
- Trinity --version | grep 'Trinity version' | sed 's/.*Trinity-v//':
62+
type: string
63+
description: The command used to generate the version of the tool
64+
topics:
65+
- versions:
66+
- - process:
67+
type: string
68+
description: The process the versions were collected from
69+
- tool:
70+
type: string
71+
description: The tool name
72+
- version:
73+
type: string
74+
description: The version of the tool
6175
authors:
6276
- "@timslittle"
6377
- "@gallvp"

modules/nf-core/trinity/tests/main.nf.test

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ nextflow_process {
3030
{ assert path(process.out.log[0][1]).text.contains("All commands completed successfully.") },
3131
{ assert path(process.out.transcript_fasta[0][1]).linesGzip.toString().contains(">TRINITY_DN7_c0_g1_i1 len=299 path=[0:0-151 2:152-298]") },
3232
{ assert snapshot(
33-
process.out.versions
33+
process.out.findAll { key, val -> key.startsWith("versions") }
3434
).match()
3535
}
3636
)
@@ -57,7 +57,7 @@ nextflow_process {
5757
{ assert path(process.out.log[0][1]).text.contains("All commands completed successfully.") },
5858
{ assert path(process.out.transcript_fasta[0][1]).linesGzip.toString().contains(">TRINITY_DN10_c0_g1_i1 len=534 path=[0:0-533]") },
5959
{ assert snapshot(
60-
process.out.versions
60+
process.out.findAll { key, val -> key.startsWith("versions") }
6161
).match()
6262
},
6363
)
@@ -87,7 +87,7 @@ nextflow_process {
8787
{ assert path(process.out.log[0][1]).text.contains("All commands completed successfully.") },
8888
{ assert path(process.out.transcript_fasta[0][1]).linesGzip.toString().contains(">TRINITY_DN12_c0_g1_i1 len=225 path=[0:0-224]") },
8989
{ assert snapshot(
90-
process.out.versions
90+
process.out.findAll { key, val -> key.startsWith("versions") }
9191
).match()
9292
}
9393

@@ -116,7 +116,7 @@ nextflow_process {
116116
{ assert path(process.out.log[0][1]).text.contains("All commands completed successfully.") },
117117
{ assert path(process.out.transcript_fasta[0][1]).linesGzip.toString().contains(">TRINITY_DN12_c0_g1_i1 len=268 path=[0:0-267]") },
118118
{ assert snapshot(
119-
process.out.versions
119+
process.out.findAll { key, val -> key.startsWith("versions") }
120120
).match()
121121
}
122122
)
@@ -144,7 +144,7 @@ nextflow_process {
144144
then {
145145
assertAll(
146146
{ assert process.success },
147-
{ assert snapshot(process.out).match() }
147+
{ assert snapshot(process.out.findAll { key, val -> key.startsWith("versions") }).match() }
148148
)
149149
}
150150
}
Lines changed: 51 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -1,103 +1,92 @@
11
{
22
"homo_sapiens-test_rnaseq-paired-multiple": {
33
"content": [
4-
[
5-
"versions.yml:md5,1c631aefa156e739b773679c471467c1"
6-
]
4+
{
5+
"versions_trinity": [
6+
[
7+
"TRINITY",
8+
"trinity",
9+
"2.15.2"
10+
]
11+
]
12+
}
713
],
814
"meta": {
915
"nf-test": "0.9.2",
10-
"nextflow": "24.10.2"
16+
"nextflow": "25.04.6"
1117
},
12-
"timestamp": "2024-11-28T14:08:11.163901364"
18+
"timestamp": "2025-10-28T13:22:02.72961086"
1319
},
1420
"homo_sapiens-test_rnaseq-single": {
1521
"content": [
16-
[
17-
"versions.yml:md5,1c631aefa156e739b773679c471467c1"
18-
]
22+
{
23+
"versions_trinity": [
24+
[
25+
"TRINITY",
26+
"trinity",
27+
"2.15.2"
28+
]
29+
]
30+
}
1931
],
2032
"meta": {
2133
"nf-test": "0.9.2",
22-
"nextflow": "24.10.2"
34+
"nextflow": "25.04.6"
2335
},
24-
"timestamp": "2024-11-28T14:07:10.975441404"
36+
"timestamp": "2025-10-28T13:21:13.836913087"
2537
},
2638
"homo_sapiens-test_rnaseq-paired": {
2739
"content": [
28-
[
29-
"versions.yml:md5,1c631aefa156e739b773679c471467c1"
30-
]
40+
{
41+
"versions_trinity": [
42+
[
43+
"TRINITY",
44+
"trinity",
45+
"2.15.2"
46+
]
47+
]
48+
}
3149
],
3250
"meta": {
3351
"nf-test": "0.9.2",
34-
"nextflow": "24.10.2"
52+
"nextflow": "25.04.6"
3553
},
36-
"timestamp": "2024-11-28T14:06:36.470824201"
54+
"timestamp": "2025-10-28T13:20:45.185841704"
3755
},
3856
"homo_sapiens-test_rnaseq-single-multiple": {
3957
"content": [
40-
[
41-
"versions.yml:md5,1c631aefa156e739b773679c471467c1"
42-
]
58+
{
59+
"versions_trinity": [
60+
[
61+
"TRINITY",
62+
"trinity",
63+
"2.15.2"
64+
]
65+
]
66+
}
4367
],
4468
"meta": {
4569
"nf-test": "0.9.2",
46-
"nextflow": "24.10.2"
70+
"nextflow": "25.04.6"
4771
},
48-
"timestamp": "2024-11-28T14:08:54.36318984"
72+
"timestamp": "2025-10-28T13:22:38.810477312"
4973
},
5074
"homo_sapiens-test_rnaseq-stub": {
5175
"content": [
5276
{
53-
"0": [
54-
[
55-
{
56-
"id": "test",
57-
"single_end": false
58-
},
59-
"test.fa.gz:md5,d41d8cd98f00b204e9800998ecf8427e"
60-
]
61-
],
62-
"1": [
63-
[
64-
{
65-
"id": "test",
66-
"single_end": false
67-
},
68-
"test.log:md5,d41d8cd98f00b204e9800998ecf8427e"
69-
]
70-
],
71-
"2": [
72-
"versions.yml:md5,1c631aefa156e739b773679c471467c1"
73-
],
74-
"log": [
75-
[
76-
{
77-
"id": "test",
78-
"single_end": false
79-
},
80-
"test.log:md5,d41d8cd98f00b204e9800998ecf8427e"
81-
]
82-
],
83-
"transcript_fasta": [
77+
"versions_trinity": [
8478
[
85-
{
86-
"id": "test",
87-
"single_end": false
88-
},
89-
"test.fa.gz:md5,d41d8cd98f00b204e9800998ecf8427e"
79+
"TRINITY",
80+
"trinity",
81+
"2.15.2"
9082
]
91-
],
92-
"versions": [
93-
"versions.yml:md5,1c631aefa156e739b773679c471467c1"
9483
]
9584
}
9685
],
9786
"meta": {
9887
"nf-test": "0.9.2",
99-
"nextflow": "24.10.2"
88+
"nextflow": "25.04.6"
10089
},
101-
"timestamp": "2024-11-28T14:09:00.571900709"
90+
"timestamp": "2025-10-28T13:49:50.612026008"
10291
}
103-
}
92+
}

0 commit comments

Comments
 (0)