Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions modules/nf-core/salsa2/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ process SALSA2 {
tuple val(meta), path("*_scaffolds_FINAL.fasta") , emit: fasta
tuple val(meta), path("*_scaffolds_FINAL.agp") , emit: agp
tuple val(meta), path("*/*scaffolds_FINAL.original-coordinates.agp"), emit: agp_original_coordinates, optional: true
path "versions.yml" , emit: versions
tuple val("${task.process}"), val('salsa2'), eval("echo 2.3"), topic: versions, emit: versions_salsa2
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
tuple val("${task.process}"), val('salsa2'), eval("echo 2.3"), topic: versions, emit: versions_salsa2
tuple val("${task.process}"), val('salsa2'), val("2.3"), topic: versions, emit: versions_salsa2


when:
task.ext.when == null || task.ext.when
Expand All @@ -30,7 +30,6 @@ process SALSA2 {
def gfa_opt = gfa ? "--gfa $gfa" : ""
def dup_opt = dup ? "--dup $dup" : ""
def filter = filter_bed ? "--filter $filter_bed" : ""
def VERSION = '2.3' // WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions.
"""
run_pipeline.py \\
$args \\
Expand All @@ -43,10 +42,12 @@ process SALSA2 {

mv */scaffolds_FINAL.fasta ${prefix}_scaffolds_FINAL.fasta
mv */scaffolds_FINAL.agp ${prefix}_scaffolds_FINAL.agp
"""

cat <<-END_VERSIONS > versions.yml
"${task.process}":
SALSA2: $VERSION
END_VERSIONS
stub:
def prefix = task.ext.prefix ?: "${meta.id}"
"""
touch ${prefix}_scaffolds_FINAL.fasta
touch ${prefix}_scaffolds_FINAL.agp
"""
}
41 changes: 29 additions & 12 deletions modules/nf-core/salsa2/meta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ tools:
documentation: "https://github.com/marbl/SALSA"
tool_dev_url: "https://github.com/marbl/SALSA"
doi: "10.1186/s12864-017-3879-z"
licence: ["MIT"]
licence:
- "MIT"
identifier: ""
input:
- - meta:
Expand All @@ -29,7 +30,8 @@ input:
ontologies: []
- index:
type: file
description: Fasta index file of assembly containing the length of contigs.
description: Fasta index file of assembly containing the length of
contigs.
pattern: "*.{fa.fai, fasta.fai}"
ontologies: []
- bed:
Expand Down Expand Up @@ -70,8 +72,8 @@ output:
e.g. [ id:'test', single_end:false ]
- "*_scaffolds_FINAL.agp":
type: file
description: AGP style output for the scaffolds describing the assignment,
orientation and ordering of contigs along the scaffolds
description: AGP style output for the scaffolds describing the
assignment, orientation and ordering of contigs along the scaffolds
pattern: "*_scaffolds_FINAL.agp"
ontologies: []
agp_original_coordinates:
Expand All @@ -82,17 +84,32 @@ output:
e.g. [ id:'test', single_end:false ]
- "*/*scaffolds_FINAL.original-coordinates.agp":
type: file
description: Secondary output AGP file with names and coordinates matching
the original input assembly (optional)
description: Secondary output AGP file with names and coordinates
matching the original input assembly (optional)
pattern: "*scaffolds_FINAL.original-coordinates.agp"
ontologies: []

versions_salsa2:
- - ${task.process}:
type: string
description: The name of the process
- salsa2:
type: string
description: The name of the tool
- echo 2.3:
type: eval
description: The expression to obtain the version of the tool
topics:
versions:
- versions.yml:
type: file
description: File containing software versions
pattern: "versions.yml"
ontologies:
- edam: http://edamontology.org/format_3750 # YAML
- - ${task.process}:
type: string
description: The name of the process
- salsa2:
type: string
description: The name of the tool
- echo 2.3:
type: eval
description: The expression to obtain the version of the tool
authors:
- "@scorreard"
maintainers:
Expand Down
34 changes: 31 additions & 3 deletions modules/nf-core/salsa2/tests/main.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,37 @@ nextflow_process {
then {
assertAll (
{ assert process.success },
{ assert snapshot(process.out.fasta).match("fasta") },
{ assert snapshot(process.out.agp).match("agp") },
{ assert snapshot(process.out.versions).match("versions") }
{ assert snapshot(sanitizeOutput(process.out)).match() }
)
}
}

test("Single-Read - stub") {

options "-stub"

when {
process {
"""
input[0] = [
[ id:'test', single_end: false ], // meta map
file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true),
file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta.fai', checkIfExists: true)
]
input[1] = [
file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/bed/test.bed', checkIfExists: true)
]
input[2] = []
input[3] = []
input[4] = []
"""
}
}

then {
assertAll (
{ assert process.success },
{ assert snapshot(sanitizeOutput(process.out)).match() }
)
}
}
Expand Down
98 changes: 70 additions & 28 deletions modules/nf-core/salsa2/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
@@ -1,38 +1,80 @@
{
"versions": {
"Single-Read - stub": {
"content": [
[
"versions.yml:md5,5985e59c635903ae7725afa4f5368de7"
]
],
"timestamp": "2024-05-22T19:35:47.254995"
},
"agp": {
"content": [
[
[
{
"id": "test",
"single_end": false
},
"test_scaffolds_FINAL.agp:md5,03fe8c559b80730aab465697a6b0e01c"
{
"agp": [
[
{
"id": "test",
"single_end": false
},
"test_scaffolds_FINAL.agp:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"agp_original_coordinates": [

],
"fasta": [
[
{
"id": "test",
"single_end": false
},
"test_scaffolds_FINAL.fasta:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"versions_salsa2": [
[
"SALSA2",
"salsa2",
"2.3"
]
]
]
}
],
"timestamp": "2024-05-22T19:34:18.646515"
"timestamp": "2026-04-30T17:20:13.326132",
"meta": {
"nf-test": "0.9.5",
"nextflow": "26.04.0"
}
},
"fasta": {
"Single-Read": {
"content": [
[
[
{
"id": "test",
"single_end": false
},
"test_scaffolds_FINAL.fasta:md5,32c805e9e447ad47d6437e10f91bd5bf"
{
"agp": [
[
{
"id": "test",
"single_end": false
},
"test_scaffolds_FINAL.agp:md5,03fe8c559b80730aab465697a6b0e01c"
]
],
"agp_original_coordinates": [

],
"fasta": [
[
{
"id": "test",
"single_end": false
},
"test_scaffolds_FINAL.fasta:md5,32c805e9e447ad47d6437e10f91bd5bf"
]
],
"versions_salsa2": [
[
"SALSA2",
"salsa2",
"2.3"
]
]
]
}
],
"timestamp": "2024-05-22T19:35:47.240011"
"timestamp": "2026-04-30T17:19:21.703989",
"meta": {
"nf-test": "0.9.5",
"nextflow": "26.04.0"
}
}
}
Loading