diff --git a/modules/nf-core/parabricks/minimap2/main.nf b/modules/nf-core/parabricks/minimap2/main.nf index e0761131ad0d..ce3527293a03 100644 --- a/modules/nf-core/parabricks/minimap2/main.nf +++ b/modules/nf-core/parabricks/minimap2/main.nf @@ -10,15 +10,14 @@ process PARABRICKS_MINIMAP2 { input: tuple val(meta), path(reads) tuple val(meta2), path(fasta) - tuple val(meta3), path(intervals) - tuple val(meta4), path(known_sites) + tuple val(meta3), path(index) + tuple val(meta4), path(intervals) + tuple val(meta5), path(known_sites) val output_fmt output: - tuple val(meta), path("*.bam"), emit: bam, optional: true - tuple val(meta), path("*.bai"), emit: bai, optional: true - tuple val(meta), path("*.cram"), emit: cram, optional: true - tuple val(meta), path("*.crai"), emit: crai, optional: true + tuple val(meta), path("*.{bam,cram}"), emit: bam, optional: true + tuple val(meta), path("*.{bai,crai}"), emit: index, optional: true tuple val(meta), path("*.table"), emit: bqsr_table, optional: true tuple val(meta), path("*_qc_metrics"), emit: qc_metrics, optional: true tuple val(meta), path("*.duplicate-metrics.txt"), emit: duplicate_metrics, optional: true @@ -49,6 +48,7 @@ process PARABRICKS_MINIMAP2 { } def extension = "${output_fmt}" + def index_command = index ? "--index ${index}" : "" def known_sites_command = known_sites ? (known_sites instanceof List ? known_sites.collect { knownSite -> "--knownSites ${knownSite}" }.join(' ') : "--knownSites ${known_sites}") : "" def known_sites_output_cmd = known_sites ? "--out-recal-file ${prefix}.table" : "" def intervals_command = intervals ? (intervals instanceof List ? intervals.collect { interval -> "--interval-file ${interval}" }.join(' ') : "--interval-file ${intervals}") : "" @@ -60,11 +60,25 @@ process PARABRICKS_MINIMAP2 { --ref ${fasta} \\ ${in_command} \\ --out-bam ${prefix}.${extension} \\ + ${index_command} \\ ${known_sites_command} \\ ${known_sites_output_cmd} \\ ${intervals_command} \\ ${num_gpus} \\ ${args} + + # Capture the full version output once and store it in a variable + pbrun_version_output=\$(pbrun minimap2 --version 2>&1) + + # We handle this different to the other modules because minimap does not begin with an Uppercase letter + + # Generate compatible_versions.yml + cat < compatible_versions.yml + "${task.process}": + pbrun_version: \$(echo "\$pbrun_version_output" | grep "pbrun:" | awk '{print \$2}') + compatible_with: + \$(echo "\$pbrun_version_output" | tr '\\t' ' ' | awk -F':' '/Compatible With:/,/^---/ { if (\$0 !~ /Compatible With:/ && \$0 !~ /^---\$/ && index(\$0,":")>0) { key=\$1; val=\$2; gsub(/^[ ]+|[ ]+\$/, "", key); gsub(/^[ ]+|[ ]+\$/, "", val); printf " %s: %s\\n", key, val } }') + EOF """ stub: @@ -85,7 +99,6 @@ process PARABRICKS_MINIMAP2 { ${known_sites_output} ${qc_metrics_output} ${duplicate_metrics_output} - # Capture the full version output once and store it in a variable pbrun_version_output=\$(pbrun minimap2 --version 2>&1) diff --git a/modules/nf-core/parabricks/minimap2/meta.yml b/modules/nf-core/parabricks/minimap2/meta.yml index 90a9ff53755b..5ccb9227390a 100644 --- a/modules/nf-core/parabricks/minimap2/meta.yml +++ b/modules/nf-core/parabricks/minimap2/meta.yml @@ -43,13 +43,22 @@ input: type: map description: | Groovy Map containing index information + - index: + type: file + description: (optional) minimap2 index file for the reference + pattern: "*.mmi" + ontologies: [] + - - meta4: + type: map + description: | + Groovy Map containing intervals information - intervals: type: file description: (optional) file(s) containing genomic intervals for use in base quality score recalibration (BQSR) pattern: "*.{bed,interval_list,picard,list,intervals}" ontologies: [] - - - meta4: + - - meta5: type: map description: | Groovy Map containing known sites information @@ -72,44 +81,22 @@ output: description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - "*.bam": + - "*.{bam,cram}": type: file - description: Sorted BAM file - pattern: "*.bam" + description: Sorted BAM or CRAM file + pattern: "*.{bam,cram}" ontologies: - edam: "http://edamontology.org/format_2572" # BAM - bai: - - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] - - "*.bai": - type: file - description: index corresponding to sorted BAM file - pattern: "*.bai" - ontologies: [] - cram: - - - meta: - type: map - description: | - Groovy Map containing sample information - e.g. [ id:'test', single_end:false ] - - "*.cram": - type: file - description: Sorted CRAM file - pattern: "*.cram" - ontologies: [] - crai: + index: - - meta: type: map description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] - - "*.crai": + - "*.{bai,crai}": type: file - description: index corresponding to sorted CRAM file - pattern: "*.crai" + description: Index corresponding to sorted BAM or CRAM file + pattern: "*.{bai,crai}" ontologies: [] bqsr_table: - - meta: @@ -178,3 +165,4 @@ authors: - "@haidyi" maintainers: - "@haidyi" + - "@gburnett-nvidia" diff --git a/modules/nf-core/parabricks/minimap2/tests/main.nf.test b/modules/nf-core/parabricks/minimap2/tests/main.nf.test index 72fdbbfb1f47..f55e7e11d27d 100644 --- a/modules/nf-core/parabricks/minimap2/tests/main.nf.test +++ b/modules/nf-core/parabricks/minimap2/tests/main.nf.test @@ -31,7 +31,8 @@ nextflow_process { ] input[2] = [ [], [] ] input[3] = [ [], [] ] - input[4] = 'bam' + input[4] = [ [], [] ] + input[5] = 'bam' """ } } @@ -41,7 +42,7 @@ nextflow_process { { assert process.success }, { assert snapshot( bam(process.out.bam[0][1]).getReadsMD5(), - file(process.out.bai[0][1]).name, + file(process.out.index[0][1]).name, process.out.findAll { key, val -> key.startsWith('versions') } ).match() } ) @@ -68,7 +69,8 @@ nextflow_process { ] input[2] = [ [], [] ] input[3] = [ [], [] ] - input[4] = 'bam' + input[4] = [ [], [] ] + input[5] = 'bam' """ } } @@ -101,12 +103,13 @@ nextflow_process { [ id:'test' ], file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) ] - input[2] = [ + input[2] = [ [], [] ] + input[3] = [ [:], file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/bed/test.bed', checkIfExists: true) ] - input[3] = [ [], [] ] - input[4] = 'bam' + input[4] = [ [], [] ] + input[5] = 'bam' """ } } @@ -116,7 +119,7 @@ nextflow_process { { assert process.success }, { assert snapshot( bam(process.out.bam[0][1]).getReadsMD5(), - file(process.out.bai[0][1]).name, + file(process.out.index[0][1]).name, ).match() } ) } @@ -141,12 +144,13 @@ nextflow_process { [ id:'test' ], file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) ] - input[2] = [ + input[2] = [ [], [] ] + input[3] = [ [:], file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/bed/test.bed', checkIfExists: true) ] - input[3] = [ [], [] ] - input[4] = 'bam' + input[4] = [ [], [] ] + input[5] = 'bam' """ } } @@ -178,11 +182,12 @@ nextflow_process { file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) ] input[2] = [ [], [] ] - input[3] = [ + input[3] = [ [], [] ] + input[4] = [ [:], file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/ngscheckmate/test1.vcf.gz', checkIfExists: true) ] - input[4] = 'bam' + input[5] = 'bam' """ } } @@ -192,7 +197,7 @@ nextflow_process { { assert process.success }, { assert snapshot( bam(process.out.bam[0][1]).getReadsMD5(), - file(process.out.bai[0][1]).name, + file(process.out.index[0][1]).name, process.out.findAll { key, val -> key.startsWith('versions') } ).match() } ) @@ -219,11 +224,12 @@ nextflow_process { file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) ] input[2] = [ [], [] ] - input[3] = [ + input[3] = [ [], [] ] + input[4] = [ [:], file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/ngscheckmate/test1.vcf.gz', checkIfExists: true) ] - input[4] = 'bam' + input[5] = 'bam' """ } } @@ -254,15 +260,16 @@ nextflow_process { [ id:'test' ], file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) ] - input[2] = [ + input[2] = [ [], [] ] + input[3] = [ [:], file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/bed/test.bed', checkIfExists: true) ] - input[3] = [ + input[4] = [ [:], file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/ngscheckmate/test1.vcf.gz', checkIfExists: true) ] - input[4] = 'bam' + input[5] = 'bam' """ } } @@ -272,7 +279,7 @@ nextflow_process { { assert process.success }, { assert snapshot( bam(process.out.bam[0][1]).getReadsMD5(), - file(process.out.bai[0][1]).name, + file(process.out.index[0][1]).name, process.out.findAll { key, val -> key.startsWith('versions') } ).match() } ) @@ -298,15 +305,16 @@ nextflow_process { [ id:'test' ], file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true) ] - input[2] = [ + input[2] = [ [], [] ] + input[3] = [ [:], file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/bed/test.bed', checkIfExists: true) ] - input[3] = [ + input[4] = [ [:], file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/ngscheckmate/test1.vcf.gz', checkIfExists: true) ] - input[4] = 'bam' + input[5] = 'bam' """ } } @@ -339,7 +347,8 @@ nextflow_process { ] input[2] = [ [], [] ] input[3] = [ [], [] ] - input[4] = 'bam' + input[4] = [ [], [] ] + input[5] = 'bam' """ } } @@ -349,7 +358,7 @@ nextflow_process { { assert process.success }, { assert snapshot( bam(process.out.bam[0][1]).getReadsMD5(), - file(process.out.bai[0][1]).name, + file(process.out.index[0][1]).name, process.out.findAll { key, val -> key.startsWith('versions') } ).match() } ) @@ -376,7 +385,8 @@ nextflow_process { ] input[2] = [ [], [] ] input[3] = [ [], [] ] - input[4] = 'bam' + input[4] = [ [], [] ] + input[5] = 'bam' """ } } @@ -408,7 +418,8 @@ nextflow_process { ] input[2] = [ [], [] ] input[3] = [ [], [] ] - input[4] = 'cram' + input[4] = [ [], [] ] + input[5] = 'cram' """ } } @@ -419,10 +430,10 @@ nextflow_process { { assert process.success }, { assert snapshot( cram( - process.out.cram[0][1], + process.out.bam[0][1], fasta, ).getReadsMD5(), - file(process.out.crai[0][1]).name, + file(process.out.index[0][1]).name, process.out.findAll { key, val -> key.startsWith('versions') } ).match() } ) @@ -449,7 +460,8 @@ nextflow_process { ] input[2] = [ [], [] ] input[3] = [ [], [] ] - input[4] = 'cram' + input[4] = [ [], [] ] + input[5] = 'cram' """ } } @@ -481,7 +493,8 @@ nextflow_process { ] input[2] = [ [], [] ] input[3] = [ [], [] ] - input[4] = 'cram' + input[4] = [ [], [] ] + input[5] = 'cram' """ } } @@ -492,10 +505,10 @@ nextflow_process { { assert process.success }, { assert snapshot( cram( - process.out.cram[0][1], + process.out.bam[0][1], fasta, ).getReadsMD5(), - file(process.out.crai[0][1]).name, + file(process.out.index[0][1]).name, process.out.findAll { key, val -> key.startsWith('versions') } ).match() } ) @@ -522,7 +535,8 @@ nextflow_process { ] input[2] = [ [], [] ] input[3] = [ [], [] ] - input[4] = 'cram' + input[4] = [ [], [] ] + input[5] = 'cram' """ } } diff --git a/modules/nf-core/parabricks/minimap2/tests/main.nf.test.snap b/modules/nf-core/parabricks/minimap2/tests/main.nf.test.snap index 0a9ebf463f80..345cfe4cb622 100644 --- a/modules/nf-core/parabricks/minimap2/tests/main.nf.test.snap +++ b/modules/nf-core/parabricks/minimap2/tests/main.nf.test.snap @@ -43,12 +43,6 @@ "content": [ { "0": [ - - ], - "1": [ - - ], - "2": [ [ { "id": "test", @@ -57,7 +51,7 @@ "test.cram:md5,d41d8cd98f00b204e9800998ecf8427e" ] ], - "3": [ + "1": [ [ { "id": "test", @@ -66,30 +60,33 @@ "test.cram.crai:md5,d41d8cd98f00b204e9800998ecf8427e" ] ], - "4": [ + "2": [ ], - "5": [ + "3": [ ], - "6": [ + "4": [ ], - "7": [ + "5": [ "compatible_versions.yml:md5,9752526376a71449ae2f33c4b8b6b19e" ], - "8": [ + "6": [ [ "PARABRICKS_MINIMAP2", "parabricks", "4.6.0-1" ] - ], - "bai": [ - ], "bam": [ - + [ + { + "id": "test", + "single_end": false + }, + "test.cram:md5,d41d8cd98f00b204e9800998ecf8427e" + ] ], "bqsr_table": [ @@ -97,26 +94,17 @@ "compatible_versions": [ "compatible_versions.yml:md5,9752526376a71449ae2f33c4b8b6b19e" ], - "crai": [ - [ - { - "id": "test", - "single_end": false - }, - "test.cram.crai:md5,d41d8cd98f00b204e9800998ecf8427e" - ] + "duplicate_metrics": [ + ], - "cram": [ + "index": [ [ { "id": "test", "single_end": false }, - "test.cram:md5,d41d8cd98f00b204e9800998ecf8427e" + "test.cram.crai:md5,d41d8cd98f00b204e9800998ecf8427e" ] - ], - "duplicate_metrics": [ - ], "qc_metrics": [ @@ -132,9 +120,9 @@ ], "meta": { "nf-test": "0.9.3", - "nextflow": "25.10.2" + "nextflow": "25.10.4" }, - "timestamp": "2026-01-21T13:34:13.489438634" + "timestamp": "2026-03-12T08:49:26.763200957" }, "homo_sapiens - bam - cram": { "content": [ @@ -178,12 +166,6 @@ ] ], "2": [ - - ], - "3": [ - - ], - "4": [ [ { "id": "test", @@ -192,31 +174,22 @@ "test.table:md5,d41d8cd98f00b204e9800998ecf8427e" ] ], - "5": [ + "3": [ ], - "6": [ + "4": [ ], - "7": [ + "5": [ "compatible_versions.yml:md5,9752526376a71449ae2f33c4b8b6b19e" ], - "8": [ + "6": [ [ "PARABRICKS_MINIMAP2", "parabricks", "4.6.0-1" ] ], - "bai": [ - [ - { - "id": "test", - "single_end": false - }, - "test.bam.bai:md5,d41d8cd98f00b204e9800998ecf8427e" - ] - ], "bam": [ [ { @@ -237,15 +210,18 @@ ], "compatible_versions": [ "compatible_versions.yml:md5,9752526376a71449ae2f33c4b8b6b19e" - ], - "crai": [ - - ], - "cram": [ - ], "duplicate_metrics": [ + ], + "index": [ + [ + { + "id": "test", + "single_end": false + }, + "test.bam.bai:md5,d41d8cd98f00b204e9800998ecf8427e" + ] ], "qc_metrics": [ @@ -261,9 +237,9 @@ ], "meta": { "nf-test": "0.9.3", - "nextflow": "25.10.2" + "nextflow": "25.10.4" }, - "timestamp": "2026-01-21T13:32:49.974659902" + "timestamp": "2026-03-12T08:48:19.89523659" }, "homo_sapiens - bam - bam": { "content": [ @@ -307,12 +283,6 @@ ] ], "2": [ - - ], - "3": [ - - ], - "4": [ [ { "id": "test", @@ -321,31 +291,22 @@ "test.table:md5,d41d8cd98f00b204e9800998ecf8427e" ] ], - "5": [ + "3": [ ], - "6": [ + "4": [ ], - "7": [ + "5": [ "compatible_versions.yml:md5,9752526376a71449ae2f33c4b8b6b19e" ], - "8": [ + "6": [ [ "PARABRICKS_MINIMAP2", "parabricks", "4.6.0-1" ] ], - "bai": [ - [ - { - "id": "test", - "single_end": false - }, - "test.bam.bai:md5,d41d8cd98f00b204e9800998ecf8427e" - ] - ], "bam": [ [ { @@ -366,15 +327,18 @@ ], "compatible_versions": [ "compatible_versions.yml:md5,9752526376a71449ae2f33c4b8b6b19e" - ], - "crai": [ - - ], - "cram": [ - ], "duplicate_metrics": [ + ], + "index": [ + [ + { + "id": "test", + "single_end": false + }, + "test.bam.bai:md5,d41d8cd98f00b204e9800998ecf8427e" + ] ], "qc_metrics": [ @@ -390,9 +354,9 @@ ], "meta": { "nf-test": "0.9.3", - "nextflow": "25.10.2" + "nextflow": "25.10.4" }, - "timestamp": "2026-01-21T13:32:09.966638852" + "timestamp": "2026-03-12T08:47:44.770248707" }, "homo_sapiens - fastq - bam - interval_file": { "content": [ @@ -476,30 +440,15 @@ ], "5": [ - - ], - "6": [ - - ], - "7": [ "compatible_versions.yml:md5,9752526376a71449ae2f33c4b8b6b19e" ], - "8": [ + "6": [ [ "PARABRICKS_MINIMAP2", "parabricks", "4.6.0-1" ] ], - "bai": [ - [ - { - "id": "test", - "single_end": false - }, - "test.bam.bai:md5,d41d8cd98f00b204e9800998ecf8427e" - ] - ], "bam": [ [ { @@ -514,15 +463,18 @@ ], "compatible_versions": [ "compatible_versions.yml:md5,9752526376a71449ae2f33c4b8b6b19e" - ], - "crai": [ - - ], - "cram": [ - ], "duplicate_metrics": [ + ], + "index": [ + [ + { + "id": "test", + "single_end": false + }, + "test.bam.bai:md5,d41d8cd98f00b204e9800998ecf8427e" + ] ], "qc_metrics": [ @@ -538,9 +490,9 @@ ], "meta": { "nf-test": "0.9.3", - "nextflow": "25.10.2" + "nextflow": "25.10.4" }, - "timestamp": "2026-01-21T13:33:32.102263959" + "timestamp": "2026-03-12T08:48:54.523688109" }, "homo_sapiens - fastq - bam - stub": { "content": [ @@ -573,30 +525,15 @@ ], "5": [ - - ], - "6": [ - - ], - "7": [ "compatible_versions.yml:md5,9752526376a71449ae2f33c4b8b6b19e" ], - "8": [ + "6": [ [ "PARABRICKS_MINIMAP2", "parabricks", "4.6.0-1" ] ], - "bai": [ - [ - { - "id": "test", - "single_end": false - }, - "test.bam.bai:md5,d41d8cd98f00b204e9800998ecf8427e" - ] - ], "bam": [ [ { @@ -611,15 +548,18 @@ ], "compatible_versions": [ "compatible_versions.yml:md5,9752526376a71449ae2f33c4b8b6b19e" - ], - "crai": [ - - ], - "cram": [ - ], "duplicate_metrics": [ + ], + "index": [ + [ + { + "id": "test", + "single_end": false + }, + "test.bam.bai:md5,d41d8cd98f00b204e9800998ecf8427e" + ] ], "qc_metrics": [ @@ -643,20 +583,14 @@ ], "meta": { "nf-test": "0.9.3", - "nextflow": "25.10.2" + "nextflow": "25.10.4" }, - "timestamp": "2026-01-21T13:30:50.547418555" + "timestamp": "2026-03-12T08:45:33.262157843" }, "homo_sapiens - bam - cram - stub": { "content": [ { "0": [ - - ], - "1": [ - - ], - "2": [ [ { "id": "test", @@ -665,7 +599,7 @@ "test.cram:md5,d41d8cd98f00b204e9800998ecf8427e" ] ], - "3": [ + "1": [ [ { "id": "test", @@ -674,30 +608,33 @@ "test.cram.crai:md5,d41d8cd98f00b204e9800998ecf8427e" ] ], - "4": [ + "2": [ ], - "5": [ + "3": [ ], - "6": [ + "4": [ ], - "7": [ + "5": [ "compatible_versions.yml:md5,9752526376a71449ae2f33c4b8b6b19e" ], - "8": [ + "6": [ [ "PARABRICKS_MINIMAP2", "parabricks", "4.6.0-1" ] - ], - "bai": [ - ], "bam": [ - + [ + { + "id": "test", + "single_end": false + }, + "test.cram:md5,d41d8cd98f00b204e9800998ecf8427e" + ] ], "bqsr_table": [ @@ -705,26 +642,17 @@ "compatible_versions": [ "compatible_versions.yml:md5,9752526376a71449ae2f33c4b8b6b19e" ], - "crai": [ - [ - { - "id": "test", - "single_end": false - }, - "test.cram.crai:md5,d41d8cd98f00b204e9800998ecf8427e" - ] + "duplicate_metrics": [ + ], - "cram": [ + "index": [ [ { "id": "test", "single_end": false }, - "test.cram:md5,d41d8cd98f00b204e9800998ecf8427e" + "test.cram.crai:md5,d41d8cd98f00b204e9800998ecf8427e" ] - ], - "duplicate_metrics": [ - ], "qc_metrics": [ @@ -740,9 +668,9 @@ ], "meta": { "nf-test": "0.9.3", - "nextflow": "25.10.2" + "nextflow": "25.10.4" }, - "timestamp": "2026-01-21T13:34:53.848400581" + "timestamp": "2026-03-12T08:49:59.693487969" }, "homo_sapiens - fastq - bam - interval_file - stub": { "content": [ @@ -775,30 +703,15 @@ ], "5": [ - - ], - "6": [ - - ], - "7": [ "compatible_versions.yml:md5,9752526376a71449ae2f33c4b8b6b19e" ], - "8": [ + "6": [ [ "PARABRICKS_MINIMAP2", "parabricks", "4.6.0-1" ] ], - "bai": [ - [ - { - "id": "test", - "single_end": false - }, - "test.bam.bai:md5,d41d8cd98f00b204e9800998ecf8427e" - ] - ], "bam": [ [ { @@ -813,15 +726,18 @@ ], "compatible_versions": [ "compatible_versions.yml:md5,9752526376a71449ae2f33c4b8b6b19e" - ], - "crai": [ - - ], - "cram": [ - ], "duplicate_metrics": [ + ], + "index": [ + [ + { + "id": "test", + "single_end": false + }, + "test.bam.bai:md5,d41d8cd98f00b204e9800998ecf8427e" + ] ], "qc_metrics": [ @@ -837,8 +753,8 @@ ], "meta": { "nf-test": "0.9.3", - "nextflow": "25.10.2" + "nextflow": "25.10.4" }, - "timestamp": "2026-01-21T13:31:30.016991953" + "timestamp": "2026-03-12T08:47:09.61266936" } } \ No newline at end of file