diff --git a/modules/nf-core/pbmm2/align/main.nf b/modules/nf-core/pbmm2/align/main.nf index e993f7760610..5a545a6ff9b9 100644 --- a/modules/nf-core/pbmm2/align/main.nf +++ b/modules/nf-core/pbmm2/align/main.nf @@ -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} diff --git a/modules/nf-core/pbmm2/align/tests/main.nf.test b/modules/nf-core/pbmm2/align/tests/main.nf.test index a753ddb6a9ba..5fac28d120dc 100644 --- a/modules/nf-core/pbmm2/align/tests/main.nf.test +++ b/modules/nf-core/pbmm2/align/tests/main.nf.test @@ -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" diff --git a/modules/nf-core/pbmm2/align/tests/main.nf.test.snap b/modules/nf-core/pbmm2/align/tests/main.nf.test.snap index 5fd660139695..4b465725fe36 100644 --- a/modules/nf-core/pbmm2/align/tests/main.nf.test.snap +++ b/modules/nf-core/pbmm2/align/tests/main.nf.test.snap @@ -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": [ @@ -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" } } } \ No newline at end of file