Skip to content
Open
Show file tree
Hide file tree
Changes from all 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 @@ -24,10 +24,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
28 changes: 27 additions & 1 deletion modules/nf-core/pbmm2/align/tests/main.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,33 @@ nextflow_process {

}

test("pbmm2 - bam - stub") {
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 - stub") {

options "-stub"

Expand Down
44 changes: 39 additions & 5 deletions modules/nf-core/pbmm2/align/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,47 @@
]
}
],
"timestamp": "2026-07-31T09:41:49.070164992",
"timestamp": "2026-08-26T11:17:08.217985366",
"meta": {
"nf-test": "0.9.5",
"nextflow": "26.07.0"
"nextflow": "26.04.6"
}
},
"pbmm2 - bam - stub": {
"pbmm2 - bam - fna": {
"content": [
{
"bam": [
[
{
"id": "test"
},
"test.bam:md5,85fc597755dd2aca64e9141248fac2e0"
]
],
"index": [
[
{
"id": "test"
},
"test.bam.bai:md5,d19601b196d069d281c0280bbb6dda6f"
]
],
"versions_pbmm2": [
[
"PBMM2_ALIGN",
"pbmm2",
"26.2.0"
]
]
}
],
"timestamp": "2026-08-26T11:17:26.093538311",
"meta": {
"nf-test": "0.9.5",
"nextflow": "26.04.6"
}
},
"pbmm2 - bam - stub": {
"content": [
{
"bam": [
Expand Down Expand Up @@ -61,10 +95,10 @@
]
}
],
"timestamp": "2026-07-31T09:24:42.692283981",
"timestamp": "2026-08-26T09:49:08.199180076",
"meta": {
"nf-test": "0.9.5",
"nextflow": "26.07.0"
"nextflow": "26.04.6"
}
}
}