Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
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: 12 additions & 1 deletion modules/nf-core/pbmm2/align/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,21 @@ process PBMM2_ALIGN {
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"
"""
fasta="${fasta}"
if [[ \${fasta} == *.fna ]]; then
new_name=\${fasta%.fna}.fa
mv \${fasta} \${new_name}
fasta=\${new_name}
elif [[ \${fasta} == *.fna.gz ]]; then
new_name=\${fasta%.fna.gz}.fa.gz
mv \${fasta} \${new_name}
fasta=\${new_name}
fi

pbmm2 \\
align \\
$args \\
$fasta \\
\${fasta} \\
$bam \\
${prefix}.bam \\
--num-threads ${task.cpus}
Expand Down
67 changes: 67 additions & 0 deletions modules/nf-core/pbmm2/align/tests/fna.nf.test

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.

Please add all tests to main.nf.test. This way all tests are in the same place which makes it easier to update them if necessary

Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
nextflow_process {

name "Test Process PBMM2_ALIGN"
script "../main.nf"
process "PBMM2_ALIGN"

tag "modules"
tag "modules_nfcore"
tag "pbmm2"
tag "pbmm2/align"

test("pbmm2 - bam - fna") {
when {
process {
"""
input[0] = [
[ id:'test' ], // meta map
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/pacbio/bam/NA03697B2_downsampled.pbmm2.repeats.bam', checkIfExists: true),
]

input[1] = [
[ id:'test' ], // meta map
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome3.fna', checkIfExists: true),
]
"""
}
}

then {
assertAll(
{ assert process.success },
{ assert snapshot(sanitizeOutput(process.out)).match() }
)
}

}

test("pbmm2 - bam - fna - stub") {

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.

No need for a stub test here since there is already one in the main.nf.test


options "-stub"

when {
process {
"""
input[0] = [
[ id:'test' ], // meta map
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/pacbio/bam/NA03697B2_downsampled.pbmm2.repeats.bam', checkIfExists: true),
]

input[1] = [
[ id:'test' ], // meta map
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome3.fna', checkIfExists: true),
]
"""
}
}

then {
assertAll(
{ assert process.success },
{ assert snapshot(sanitizeOutput(process.out)).match() }
)
}

}

}
54 changes: 54 additions & 0 deletions modules/nf-core/pbmm2/align/tests/fna.nf.test.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
{
"pbmm2 - bam - fna": {
"content": [
{
"bam": [
[
{
"id": "test"
},
"test.bam:md5,f0f615a8a6172a739dfb81e6e08043f4"
]
],
"versions_pbmm2": [
[
"PBMM2_ALIGN",
"pbmm2",
"26.2.0"
]
]
}
],
"timestamp": "2026-08-06T11:28:10.82763057",
"meta": {
"nf-test": "0.9.5",
"nextflow": "26.04.6"
}
},
"pbmm2 - bam - fna - stub": {
"content": [
{
"bam": [
[
{
"id": "test"
},
"test.bam:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"versions_pbmm2": [
[
"PBMM2_ALIGN",
"pbmm2",
"26.2.0"
]
]
}
],
"timestamp": "2026-08-06T11:28:15.998416537",
"meta": {
"nf-test": "0.9.5",
"nextflow": "26.04.6"
}
}
}
6 changes: 3 additions & 3 deletions modules/nf-core/pbmm2/align/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
{
"id": "test"
},
"test.bam:md5,f2be1fe20bbccf66afae237452e112cd"
"test.bam:md5,ccb989e67933259d6213ca6236b7971c"
]
],
"versions_pbmm2": [
Expand All @@ -19,10 +19,10 @@
]
}
],
"timestamp": "2026-07-01T15:03:18.017362993",
"timestamp": "2026-07-31T11:02:25.18889907",
"meta": {
"nf-test": "0.9.5",
"nextflow": "26.03.4"
"nextflow": "26.04.6"
}
},
"pbmm2 - bam - stub": {
Expand Down