diff --git a/modules/nf-core/pbmm2/align/main.nf b/modules/nf-core/pbmm2/align/main.nf index 3233b84df07f..69dc9787f5a3 100644 --- a/modules/nf-core/pbmm2/align/main.nf +++ b/modules/nf-core/pbmm2/align/main.nf @@ -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} diff --git a/modules/nf-core/pbmm2/align/tests/fna.nf.test b/modules/nf-core/pbmm2/align/tests/fna.nf.test new file mode 100644 index 000000000000..3a81512116bd --- /dev/null +++ b/modules/nf-core/pbmm2/align/tests/fna.nf.test @@ -0,0 +1,38 @@ +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() } + ) + } + + } + +} diff --git a/modules/nf-core/pbmm2/align/tests/fna.nf.test.snap b/modules/nf-core/pbmm2/align/tests/fna.nf.test.snap new file mode 100644 index 000000000000..c3c119baa59c --- /dev/null +++ b/modules/nf-core/pbmm2/align/tests/fna.nf.test.snap @@ -0,0 +1,28 @@ +{ + "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" + } + } +} \ No newline at end of file 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 8250bd5826be..4ada87e2eb32 100644 --- a/modules/nf-core/pbmm2/align/tests/main.nf.test.snap +++ b/modules/nf-core/pbmm2/align/tests/main.nf.test.snap @@ -7,7 +7,7 @@ { "id": "test" }, - "test.bam:md5,f2be1fe20bbccf66afae237452e112cd" + "test.bam:md5,ccb989e67933259d6213ca6236b7971c" ] ], "versions_pbmm2": [ @@ -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": {