Skip to content

Commit b911d0c

Browse files
committed
migrate leviosam2/lift module to topic channels
1 parent c1a3901 commit b911d0c

4 files changed

Lines changed: 57 additions & 32 deletions

File tree

modules/nf-core/leviosam2/lift/main.nf

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ process LEVIOSAM2_LIFT {
99

1010
input:
1111
tuple val(meta), path(input)
12-
tuple val(meta_ref), path(clft)
12+
tuple val(meta2), path(clft)
1313

1414
output:
1515
tuple val(meta), path("*.bam"), emit: bam
16-
path "versions.yml" , emit: versions
16+
tuple val("${task.process}"), val('leviosam2'), eval("leviosam2 --version"), emit: versions_leviosam2, topic: versions
1717

1818
when:
1919
task.ext.when == null || task.ext.when
@@ -30,21 +30,11 @@ process LEVIOSAM2_LIFT {
3030
-p ${prefix} \\
3131
-O bam \\
3232
${args}
33-
34-
cat <<-END_VERSIONS > versions.yml
35-
"${task.process}":
36-
leviosam2: \$(leviosam2 --version)
37-
END_VERSIONS
3833
"""
3934

4035
stub:
4136
def prefix = task.ext.prefix ?: "${meta.id}"
4237
"""
4338
touch ${prefix}.bam
44-
45-
cat <<-END_VERSIONS > versions.yml
46-
"${task.process}":
47-
leviosam2: \$(leviosam2 --version)
48-
END_VERSIONS
4939
"""
5040
}

modules/nf-core/leviosam2/lift/meta.yml

Lines changed: 25 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: "leviosam2_lift"
2-
description: Converting aligned short and long reads records from one reference to
3-
another
2+
description: Converting aligned short and long reads records from one reference
3+
to another
44
keywords:
55
- leviosam2
66
- index
@@ -10,7 +10,8 @@ tools:
1010
description: "Fast and accurate coordinate conversion between assemblies"
1111
homepage: "https://github.com/milkschen/leviosam2/blob/main/workflow/README.md"
1212
documentation: "https://github.com/milkschen/leviosam2/blob/main/workflow/README.md"
13-
licence: ["MIT"]
13+
licence:
14+
- "MIT"
1415
identifier: ""
1516
input:
1617
- - meta:
@@ -23,7 +24,7 @@ input:
2324
description: SAM/BAM/CRAM file to be lifted
2425
pattern: "*.{bam}"
2526
ontologies: []
26-
- - meta_ref:
27+
- - meta2:
2728
type: map
2829
description: |
2930
Groovy Map containing reference information
@@ -45,13 +46,27 @@ output:
4546
description: Lifted bam file
4647
pattern: "*.{bam}"
4748
ontologies: []
49+
versions_leviosam2:
50+
- - ${task.process}:
51+
type: string
52+
description: The name of the process
53+
- "leviosam2":
54+
type: string
55+
description: The name of the tool
56+
- leviosam2 --version:
57+
type: eval
58+
description: The expression to obtain the version of the tool
59+
topics:
4860
versions:
49-
- versions.yml:
50-
type: file
51-
description: File containing software versions
52-
pattern: "versions.yml"
53-
ontologies:
54-
- edam: http://edamontology.org/format_3750 # YAML
61+
- - ${task.process}:
62+
type: string
63+
description: The name of the process
64+
- "leviosam2":
65+
type: string
66+
description: The name of the tool
67+
- leviosam2 --version:
68+
type: eval
69+
description: The expression to obtain the version of the tool
5570
authors:
5671
- "@lgrochowalski"
5772
maintainers:

modules/nf-core/leviosam2/lift/tests/main.nf.test

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ nextflow_process {
5858
{
5959
assert snapshot(
6060
process.out.bam.collect { file(it[1]).getName() },
61-
process.out.versions
61+
process.out.findAll { key, val -> key.startsWith('versions') },
6262
).match()
6363
}
6464
)
@@ -113,7 +113,7 @@ nextflow_process {
113113
{
114114
assert snapshot(
115115
process.out.bam.collect { file(it[1]).getName() },
116-
process.out.versions
116+
process.out.findAll { key, val -> key.startsWith('versions') },
117117
).match()
118118
}
119119
)
@@ -143,10 +143,13 @@ nextflow_process {
143143
then {
144144
assertAll(
145145
{ assert process.success },
146-
{ assert snapshot(process.out).match() }
146+
{ assert snapshot(sanitizeOutput(process.out)).match()
147+
}
147148
)
148149
}
149150

150151
}
151152

152153
}
154+
155+

modules/nf-core/leviosam2/lift/tests/main.nf.test.snap

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,11 @@
55
"test.bam"
66
],
77
[
8-
"versions.yml:md5,331d0fec62acbb6e8366e836e7e15469"
8+
[
9+
"LEVIOSAM2_LIFT",
10+
"leviosam2",
11+
"0.4.2"
12+
]
913
]
1014
],
1115
"meta": {
@@ -27,7 +31,11 @@
2731
]
2832
],
2933
"1": [
30-
"versions.yml:md5,331d0fec62acbb6e8366e836e7e15469"
34+
[
35+
"LEVIOSAM2_LIFT",
36+
"leviosam2",
37+
"0.4.2"
38+
]
3139
],
3240
"bam": [
3341
[
@@ -38,10 +46,14 @@
3846
"test.bam:md5,d41d8cd98f00b204e9800998ecf8427e"
3947
]
4048
],
41-
"versions": [
42-
"versions.yml:md5,331d0fec62acbb6e8366e836e7e15469"
49+
"versions_leviosam2": [
50+
[
51+
"LEVIOSAM2_LIFT",
52+
"leviosam2",
53+
"0.4.2"
54+
]
4355
]
44-
}
56+
}
4557
],
4658
"meta": {
4759
"nf-test": "0.8.4",
@@ -55,7 +67,11 @@
5567
"test.bam"
5668
],
5769
[
58-
"versions.yml:md5,331d0fec62acbb6e8366e836e7e15469"
70+
[
71+
"LEVIOSAM2_LIFT",
72+
"leviosam2",
73+
"0.4.2"
74+
]
5975
]
6076
],
6177
"meta": {
@@ -64,4 +80,5 @@
6480
},
6581
"timestamp": "2024-06-25T12:18:17.99171"
6682
}
67-
}
83+
}
84+

0 commit comments

Comments
 (0)