diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 4a172c2dba46..8f0a0f04b342 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -29,7 +29,7 @@ env: NXF_SINGULARITY_LIBRARYDIR: ${{ github.workspace }}/.singularity GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # renovate: datasource=github-releases depName=nextflow/nextflow versioning=semver - NXF_VER: "24.10.1" + NXF_VER: "25.04.6" jobs: pre-commit: diff --git a/.github/workflows/nf-test-gpu.yml b/.github/workflows/nf-test-gpu.yml index 434dba85069f..06878bcb351a 100644 --- a/.github/workflows/nf-test-gpu.yml +++ b/.github/workflows/nf-test-gpu.yml @@ -30,7 +30,7 @@ env: NXF_SINGULARITY_CACHEDIR: ${{ github.workspace }}/.singularity NXF_SINGULARITY_LIBRARYDIR: ${{ github.workspace }}/.singularity # renovate: datasource=github-releases depName=nextflow-io/nextflow versioning=semver - NXF_VER: "25.04.0" + NXF_VER: "25.04.6" jobs: nf-test-changes: diff --git a/.github/workflows/nf-test.yml b/.github/workflows/nf-test.yml index 97e55ba5c666..d27a9c6eb200 100644 --- a/.github/workflows/nf-test.yml +++ b/.github/workflows/nf-test.yml @@ -28,7 +28,7 @@ env: NXF_SINGULARITY_CACHEDIR: ${{ github.workspace }}/.singularity NXF_SINGULARITY_LIBRARYDIR: ${{ github.workspace }}/.singularity # renovate: datasource=github-releases depName=nextflow/nextflow versioning=semver - NXF_VER: "25.04.0" + NXF_VER: "25.04.6" jobs: nf-test-changes: diff --git a/.github/workflows/pytest-workflow.yml b/.github/workflows/pytest-workflow.yml index 1310273c7d54..1dd1af4ea69e 100644 --- a/.github/workflows/pytest-workflow.yml +++ b/.github/workflows/pytest-workflow.yml @@ -29,7 +29,7 @@ env: NXF_SINGULARITY_LIBRARYDIR: ${{ github.workspace }}/.singularity GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # renovate: datasource=github-releases depName=nextflow-io/nextflow versioning=semver - NXF_VER: "24.10.2" + NXF_VER: "25.04.6" jobs: pytest-changes: diff --git a/.github/workflows/update-gpu-snapshot.yml b/.github/workflows/update-gpu-snapshot.yml index 92bbc38e6d44..d29dc553d366 100644 --- a/.github/workflows/update-gpu-snapshot.yml +++ b/.github/workflows/update-gpu-snapshot.yml @@ -10,7 +10,7 @@ env: NFT_VER: "0.9.2" NXF_ANSI_LOG: false # renovate: datasource=github-releases depName=nextflow/nextflow versioning=semver - NXF_VER: "24.10.2" + NXF_VER: "25.04.6" jobs: update-gpu-snapshot: diff --git a/.github/workflows/update-sentieon-snapshot.yml b/.github/workflows/update-sentieon-snapshot.yml index ff952e48003b..db6579e2ad44 100644 --- a/.github/workflows/update-sentieon-snapshot.yml +++ b/.github/workflows/update-sentieon-snapshot.yml @@ -10,7 +10,7 @@ env: NFT_VER: "0.9.2" NXF_ANSI_LOG: false # renovate: datasource=github-releases depName=nextflow/nextflow versioning=semver - NXF_VER: "24.10.2" + NXF_VER: "25.04.6" jobs: update-sentieon-snapshot: diff --git a/.github/workflows/wave.yml b/.github/workflows/wave.yml index 63124e7ce867..abb0c653a19a 100644 --- a/.github/workflows/wave.yml +++ b/.github/workflows/wave.yml @@ -15,7 +15,7 @@ env: # renovate: datasource=github-releases depName=askimed/nf-test versioning=semver NFT_VER: "0.9.2" # renovate: datasource=github-releases depName=nextflow/nextflow versioning=semver - NXF_VER: "24.10.1" + NXF_VER: "25.04.6" jobs: generate-matrix: diff --git a/modules/nf-core/bwamem2/index/main.nf b/modules/nf-core/bwamem2/index/main.nf index 62af1e390c5e..8c9f12b38cf7 100644 --- a/modules/nf-core/bwamem2/index/main.nf +++ b/modules/nf-core/bwamem2/index/main.nf @@ -1,20 +1,20 @@ process BWAMEM2_INDEX { - tag "$fasta" + tag "${fasta}" // NOTE Requires 28N GB memory where N is the size of the reference sequence, floor of 280M // source: https://github.com/bwa-mem2/bwa-mem2/issues/9 memory { (280.MB * Math.ceil(fasta.size() / 10000000)) * task.attempt } conda "${moduleDir}/environment.yml" - container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://community-cr-prod.seqera.io/docker/registry/v2/blobs/sha256/e0/e05ce34b46ad42810eb29f74e4e304c0cb592b2ca15572929ed8bbaee58faf01/data' : - 'community.wave.seqera.io/library/bwa-mem2_htslib_samtools:db98f81f55b64113' }" + container "${workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container + ? 'https://community-cr-prod.seqera.io/docker/registry/v2/blobs/sha256/e0/e05ce34b46ad42810eb29f74e4e304c0cb592b2ca15572929ed8bbaee58faf01/data' + : 'community.wave.seqera.io/library/bwa-mem2_htslib_samtools:db98f81f55b64113'}" input: tuple val(meta), path(fasta) output: tuple val(meta), path("bwamem2"), emit: index - path "versions.yml" , emit: versions + tuple val("${task.process}"), val('bwa-mem2'), eval("bwa-mem2 version 2>&1 | tail -1"), topic: versions when: task.ext.when == null || task.ext.when @@ -26,14 +26,9 @@ process BWAMEM2_INDEX { mkdir bwamem2 bwa-mem2 \\ index \\ - $args \\ + ${args} \\ -p bwamem2/${prefix} \\ - $fasta - - cat <<-END_VERSIONS > versions.yml - "${task.process}": - bwamem2: \$(echo \$(bwa-mem2 version 2>&1) | sed 's/.* //') - END_VERSIONS + ${fasta} """ stub: @@ -46,10 +41,5 @@ process BWAMEM2_INDEX { touch bwamem2/${prefix}.pac touch bwamem2/${prefix}.amb touch bwamem2/${prefix}.bwt.2bit.64 - - cat <<-END_VERSIONS > versions.yml - "${task.process}": - bwamem2: \$(echo \$(bwa-mem2 version 2>&1) | sed 's/.* //') - END_VERSIONS """ } diff --git a/modules/nf-core/bwamem2/index/meta.yml b/modules/nf-core/bwamem2/index/meta.yml index b2aa45fb6583..b58e3be8c55f 100644 --- a/modules/nf-core/bwamem2/index/meta.yml +++ b/modules/nf-core/bwamem2/index/meta.yml @@ -39,13 +39,6 @@ output: pattern: "*.{0123,amb,ann,bwt.2bit.64,pac}" ontologies: - edam: "http://edamontology.org/data_3210" # Genome index - versions: - - versions.yml: - type: file - description: File containing software versions - pattern: "versions.yml" - ontologies: - - edam: http://edamontology.org/format_3750 # YAML authors: - "@maxulysse" maintainers: diff --git a/modules/nf-core/bwamem2/index/tests/main.nf.test b/modules/nf-core/bwamem2/index/tests/main.nf.test index adf447851de1..0800a31d508a 100644 --- a/modules/nf-core/bwamem2/index/tests/main.nf.test +++ b/modules/nf-core/bwamem2/index/tests/main.nf.test @@ -22,12 +22,11 @@ nextflow_process { } then { + assert process.success assertAll( - { assert process.success }, { assert snapshot( process.out.index, - process.out.versions, - path(process.out.versions[0]).yaml + ['versions', process.out[1]] ).match() } ) } @@ -49,12 +48,11 @@ nextflow_process { } then { + assert process.success assertAll( - { assert process.success }, { assert snapshot( process.out.index, - process.out.versions, - path(process.out.versions[0]).yaml + ['versions', process.out[1]] ).match() } ) } diff --git a/modules/nf-core/bwamem2/index/tests/main.nf.test.snap b/modules/nf-core/bwamem2/index/tests/main.nf.test.snap index 9ad8b20c0ed7..7407d942b730 100644 --- a/modules/nf-core/bwamem2/index/tests/main.nf.test.snap +++ b/modules/nf-core/bwamem2/index/tests/main.nf.test.snap @@ -16,19 +16,21 @@ ] ], [ - "versions.yml:md5,9ffd13d12e7108ed15c58566bc4717d6" - ], - { - "BWAMEM2_INDEX": { - "bwamem2": "2.2.1" - } - } + "versions", + [ + [ + "BWAMEM2_INDEX", + "bwa-mem2", + "2.2.1" + ] + ] + ] ], "meta": { "nf-test": "0.9.2", - "nextflow": "25.04.6" + "nextflow": "25.04.7" }, - "timestamp": "2025-09-04T08:55:53.219699135" + "timestamp": "2025-09-25T14:38:35.557107186" }, "fasta": { "content": [ @@ -47,18 +49,20 @@ ] ], [ - "versions.yml:md5,9ffd13d12e7108ed15c58566bc4717d6" - ], - { - "BWAMEM2_INDEX": { - "bwamem2": "2.2.1" - } - } + "versions", + [ + [ + "BWAMEM2_INDEX", + "bwa-mem2", + "2.2.1" + ] + ] + ] ], "meta": { "nf-test": "0.9.2", - "nextflow": "25.04.6" + "nextflow": "25.04.7" }, - "timestamp": "2025-09-04T08:55:45.007921901" + "timestamp": "2025-09-25T14:38:22.536156282" } } \ No newline at end of file diff --git a/modules/nf-core/bwamem2/mem/main.nf b/modules/nf-core/bwamem2/mem/main.nf index 27910cf6cd61..bfe6cfada967 100644 --- a/modules/nf-core/bwamem2/mem/main.nf +++ b/modules/nf-core/bwamem2/mem/main.nf @@ -1,25 +1,26 @@ process BWAMEM2_MEM { - tag "$meta.id" + tag "${meta.id}" label 'process_high' conda "${moduleDir}/environment.yml" - container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://community-cr-prod.seqera.io/docker/registry/v2/blobs/sha256/e0/e05ce34b46ad42810eb29f74e4e304c0cb592b2ca15572929ed8bbaee58faf01/data' : - 'community.wave.seqera.io/library/bwa-mem2_htslib_samtools:db98f81f55b64113' }" + container "${workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container + ? 'https://community-cr-prod.seqera.io/docker/registry/v2/blobs/sha256/e0/e05ce34b46ad42810eb29f74e4e304c0cb592b2ca15572929ed8bbaee58faf01/data' + : 'community.wave.seqera.io/library/bwa-mem2_htslib_samtools:db98f81f55b64113'}" input: tuple val(meta), path(reads) tuple val(meta2), path(index) tuple val(meta3), path(fasta) - val sort_bam + val sort_bam output: - tuple val(meta), path("*.sam") , emit: sam , optional:true - tuple val(meta), path("*.bam") , emit: bam , optional:true - tuple val(meta), path("*.cram") , emit: cram, optional:true - tuple val(meta), path("*.crai") , emit: crai, optional:true - tuple val(meta), path("*.csi") , emit: csi , optional:true - path "versions.yml" , emit: versions + tuple val(meta), path("*.sam"), emit: sam, optional: true + tuple val(meta), path("*.bam"), emit: bam, optional: true + tuple val(meta), path("*.cram"), emit: cram, optional: true + tuple val(meta), path("*.crai"), emit: crai, optional: true + tuple val(meta), path("*.csi"), emit: csi, optional: true + tuple val("${task.process}"), val('bwa-mem2'), eval("bwa-mem2 version 2>&1 | tail -1"), topic: versions + tuple val("${task.process}"), val('samtools'), eval("samtools --version 2>&1 | head -1 | sed 's/^.*samtools //'"), topic: versions when: task.ext.when == null || task.ext.when @@ -31,53 +32,45 @@ process BWAMEM2_MEM { def samtools_command = sort_bam ? 'sort' : 'view' def extension_pattern = /(--output-fmt|-O)+\s+(\S+)/ - def extension_matcher = (args2 =~ extension_pattern) + def extension_matcher = (args2 =~ extension_pattern) def extension = extension_matcher.getCount() > 0 ? extension_matcher[0][2].toLowerCase() : "bam" - def reference = fasta && extension=="cram" ? "--reference ${fasta}" : "" - if (!fasta && extension=="cram") error "Fasta reference is required for CRAM output" + def reference = fasta && extension == "cram" ? "--reference ${fasta}" : "" + if (!fasta && extension == "cram") { + error("Fasta reference is required for CRAM output") + } """ INDEX=`find -L ./ -name "*.amb" | sed 's/\\.amb\$//'` bwa-mem2 \\ mem \\ - $args \\ - -t $task.cpus \\ + ${args} \\ + -t ${task.cpus} \\ \$INDEX \\ - $reads \\ - | samtools $samtools_command $args2 -@ $task.cpus ${reference} -o ${prefix}.${extension} - - - cat <<-END_VERSIONS > versions.yml - "${task.process}": - bwamem2: \$(echo \$(bwa-mem2 version 2>&1) | sed 's/.* //') - samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//') - END_VERSIONS + ${reads} \\ + | samtools ${samtools_command} ${args2} -@ ${task.cpus} ${reference} -o ${prefix}.${extension} - """ stub: - def args2 = task.ext.args2 ?: '' def prefix = task.ext.prefix ?: "${meta.id}" def extension_pattern = /(--output-fmt|-O)+\s+(\S+)/ - def extension_matcher = (args2 =~ extension_pattern) + def extension_matcher = (args2 =~ extension_pattern) def extension = extension_matcher.getCount() > 0 ? extension_matcher[0][2].toLowerCase() : "bam" - if (!fasta && extension=="cram") error "Fasta reference is required for CRAM output" + if (!fasta && extension == "cram") { + error("Fasta reference is required for CRAM output") + } def create_index = "" if (extension == "cram") { create_index = "touch ${prefix}.crai" - } else if (extension == "bam") { + } + else if (extension == "bam") { create_index = "touch ${prefix}.csi" } """ touch ${prefix}.${extension} ${create_index} - - cat <<-END_VERSIONS > versions.yml - "${task.process}": - bwamem2: \$(echo \$(bwa-mem2 version 2>&1) | sed 's/.* //') - samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//') - END_VERSIONS """ } diff --git a/modules/nf-core/bwamem2/mem/meta.yml b/modules/nf-core/bwamem2/mem/meta.yml index 6c7d17284617..b57fe10fd1b6 100644 --- a/modules/nf-core/bwamem2/mem/meta.yml +++ b/modules/nf-core/bwamem2/mem/meta.yml @@ -118,13 +118,6 @@ output: description: Index file for BAM file pattern: "*.{csi}" ontologies: [] - versions: - - versions.yml: - type: file - description: File containing software versions - pattern: "versions.yml" - ontologies: - - edam: http://edamontology.org/format_3750 # YAML authors: - "@maxulysse" - "@matthdsm" diff --git a/modules/nf-core/bwamem2/mem/tests/main.nf.test b/modules/nf-core/bwamem2/mem/tests/main.nf.test index 9e0ab14aec59..8568d3b62ebf 100644 --- a/modules/nf-core/bwamem2/mem/tests/main.nf.test +++ b/modules/nf-core/bwamem2/mem/tests/main.nf.test @@ -41,16 +41,15 @@ nextflow_process { } then { + assert process.success assertAll( - { assert process.success }, { assert snapshot( bam(process.out.bam[0][1]).getHeaderMD5(), bam(process.out.bam[0][1]).getReadsMD5(), - process.out.versions + ['versions', process.out[5], process.out[6]] ).match() } ) } - } test("sarscov2 - fastq, index, fasta, true") { @@ -70,16 +69,15 @@ nextflow_process { } then { + assert process.success assertAll( - { assert process.success }, { assert snapshot( bam(process.out.bam[0][1]).getHeaderMD5(), bam(process.out.bam[0][1]).getReadsMD5(), - process.out.versions + ['versions', process.out[5], process.out[6]] ).match() } ) } - } test("sarscov2 - [fastq1, fastq2], index, fasta, false") { @@ -102,16 +100,15 @@ nextflow_process { } then { + assert process.success assertAll( - { assert process.success }, { assert snapshot( bam(process.out.bam[0][1]).getHeaderMD5(), bam(process.out.bam[0][1]).getReadsMD5(), - process.out.versions + ['versions', process.out[5], process.out[6]] ).match() } ) } - } test("sarscov2 - [fastq1, fastq2], index, fasta, true") { @@ -134,16 +131,15 @@ nextflow_process { } then { + assert process.success assertAll( - { assert process.success }, { assert snapshot( bam(process.out.bam[0][1]).getHeaderMD5(), bam(process.out.bam[0][1]).getReadsMD5(), - process.out.versions + ['versions', process.out[5], process.out[6]] ).match() } ) } - } test("sarscov2 - [fastq1, fastq2], index, fasta, true - stub") { @@ -168,12 +164,14 @@ nextflow_process { } then { + assert process.success assertAll( - { assert process.success }, - { assert snapshot(process.out).match() } + { assert snapshot( + bam(process.out.bam[0][1]).getHeaderMD5(), + bam(process.out.bam[0][1]).getReadsMD5(), + ['versions', process.out[5], process.out[6]] + ).match() } ) } - } - } diff --git a/modules/nf-core/bwamem2/mem/tests/main.nf.test.snap b/modules/nf-core/bwamem2/mem/tests/main.nf.test.snap index b7d40a6830b4..317e2dff0728 100644 --- a/modules/nf-core/bwamem2/mem/tests/main.nf.test.snap +++ b/modules/nf-core/bwamem2/mem/tests/main.nf.test.snap @@ -4,126 +4,139 @@ "e414c2d48e2e44c2c52c20ecd88e8bd8", "57aeef88ed701a8ebc8e2f0a381b2a6", [ - "versions.yml:md5,3574188ab1f33fd99cff9f5562dfb885" + "versions", + [ + [ + "BWAMEM2_MEM", + "bwa-mem2", + "2.2.1" + ] + ], + [ + [ + "BWAMEM2_MEM", + "samtools", + "1.22.1" + ] + ] ] ], "meta": { "nf-test": "0.9.2", "nextflow": "25.04.7" }, - "timestamp": "2025-09-23T11:44:52.73673293" + "timestamp": "2025-09-25T14:23:04.53766834" }, "sarscov2 - [fastq1, fastq2], index, fasta, true - stub": { "content": [ - { - "0": [ - - ], - "1": [ - [ - { - "id": "test", - "single_end": false - }, - "test.bam:md5,d41d8cd98f00b204e9800998ecf8427e" - ] - ], - "2": [ - - ], - "3": [ - - ], - "4": [ - [ - { - "id": "test", - "single_end": false - }, - "test.csi:md5,d41d8cd98f00b204e9800998ecf8427e" - ] - ], - "5": [ - "versions.yml:md5,3574188ab1f33fd99cff9f5562dfb885" - ], - "bam": [ + "895266757df4950e5f81c3bc8fca5b47", + "d41d8cd98f00b204e9800998ecf8427e", + [ + "versions", + [ [ - { - "id": "test", - "single_end": false - }, - "test.bam:md5,d41d8cd98f00b204e9800998ecf8427e" + "BWAMEM2_MEM", + "bwa-mem2", + "2.2.1" ] ], - "crai": [ - - ], - "cram": [ - - ], - "csi": [ + [ [ - { - "id": "test", - "single_end": false - }, - "test.csi:md5,d41d8cd98f00b204e9800998ecf8427e" + "BWAMEM2_MEM", + "samtools", + "1.22.1" ] - ], - "sam": [ - - ], - "versions": [ - "versions.yml:md5,3574188ab1f33fd99cff9f5562dfb885" ] - } + ] ], "meta": { "nf-test": "0.9.2", "nextflow": "25.04.7" }, - "timestamp": "2025-09-23T11:45:14.834888709" + "timestamp": "2025-09-25T14:23:36.384759156" }, "sarscov2 - [fastq1, fastq2], index, fasta, true": { "content": [ "716ed1ef39deaad346ca7cf86e08f959", "af8628d9df18b2d3d4f6fd47ef2bb872", [ - "versions.yml:md5,3574188ab1f33fd99cff9f5562dfb885" + "versions", + [ + [ + "BWAMEM2_MEM", + "bwa-mem2", + "2.2.1" + ] + ], + [ + [ + "BWAMEM2_MEM", + "samtools", + "1.22.1" + ] + ] ] ], "meta": { "nf-test": "0.9.2", "nextflow": "25.04.7" }, - "timestamp": "2025-09-23T11:45:04.750057645" + "timestamp": "2025-09-25T14:23:19.645778635" }, "sarscov2 - fastq, index, fasta, false": { "content": [ "283a83f604f3f5338acedfee349dccf4", "798439cbd7fd81cbcc5078022dc5479d", [ - "versions.yml:md5,3574188ab1f33fd99cff9f5562dfb885" + "versions", + [ + [ + "BWAMEM2_MEM", + "bwa-mem2", + "2.2.1" + ] + ], + [ + [ + "BWAMEM2_MEM", + "samtools", + "1.22.1" + ] + ] ] ], "meta": { "nf-test": "0.9.2", "nextflow": "25.04.7" }, - "timestamp": "2025-09-23T11:44:28.57550711" + "timestamp": "2025-09-25T14:22:34.60144871" }, "sarscov2 - fastq, index, fasta, true": { "content": [ "ed99048bb552cac58e39923b550b6d5b", "94fcf617f5b994584c4e8d4044e16b4f", [ - "versions.yml:md5,3574188ab1f33fd99cff9f5562dfb885" + "versions", + [ + [ + "BWAMEM2_MEM", + "bwa-mem2", + "2.2.1" + ] + ], + [ + [ + "BWAMEM2_MEM", + "samtools", + "1.22.1" + ] + ] ] ], "meta": { "nf-test": "0.9.2", "nextflow": "25.04.7" }, - "timestamp": "2025-09-23T11:44:40.437183765" + "timestamp": "2025-09-25T14:22:49.129294037" } } \ No newline at end of file diff --git a/subworkflows/nf-core/fasta_index_dna/main.nf b/subworkflows/nf-core/fasta_index_dna/main.nf index 3274f8aa7a85..f77cd9ff0e20 100644 --- a/subworkflows/nf-core/fasta_index_dna/main.nf +++ b/subworkflows/nf-core/fasta_index_dna/main.nf @@ -4,71 +4,67 @@ // FASTA_INDEX_DNA: Build aligner specific index for fasta files // -include { BOWTIE2_BUILD } from '../../../modules/nf-core/bowtie2/build/main' -include { BWA_INDEX as BWAMEM1_INDEX } from '../../../modules/nf-core/bwa/index/main' -include { BWAMEM2_INDEX } from '../../../modules/nf-core/bwamem2/index/main' -include { DRAGMAP_HASHTABLE } from '../../../modules/nf-core/dragmap/hashtable/main' -include { SNAPALIGNER_INDEX as SNAP_INDEX } from '../../../modules/nf-core/snapaligner/index/main' +include { BOWTIE2_BUILD } from '../../../modules/nf-core/bowtie2/build/main' +include { BWA_INDEX as BWAMEM1_INDEX } from '../../../modules/nf-core/bwa/index/main' +include { BWAMEM2_INDEX } from '../../../modules/nf-core/bwamem2/index/main' +include { DRAGMAP_HASHTABLE } from '../../../modules/nf-core/dragmap/hashtable/main' +include { SNAPALIGNER_INDEX as SNAP_INDEX } from '../../../modules/nf-core/snapaligner/index/main' workflow FASTA_INDEX_DNA { - take: - ch_fasta // channel: [mandatory] [ val(meta), path(fasta) ] - ch_altliftover // channel: [mandatory, if aligner is bwamem or bwamem2 or snap] [ val(meta), path(altliftover) ] - val_aligner // string: [mandatory] aligner [bowtie2, bwamem, bwamem2, dragmap, snap] + ch_fasta // channel: [mandatory] [ val(meta), path(fasta) ] + ch_altliftover // channel: [mandatory, if aligner is bwamem or bwamem2 or snap] [ val(meta), path(altliftover) ] + val_aligner // string: [mandatory] aligner [bowtie2, bwamem, bwamem2, dragmap, snap] main: - ch_aligner_index = Channel.empty() - ch_versions = Channel.empty() - - switch (val_aligner) { - case 'bowtie2': - BOWTIE2_BUILD(ch_fasta ) // if aligner is bowtie2 - ch_aligner_index = ch_aligner_index.mix(BOWTIE2_BUILD.out.index) - ch_versions = ch_versions.mix(BOWTIE2_BUILD.out.versions) - break - case 'bwamem': - BWAMEM1_INDEX(ch_fasta) // If aligner is bwa-mem - ch_aligner_index = ch_aligner_index - .mix( - BWAMEM1_INDEX.out.index - .join(ch_altliftover) - .map{meta, index, alt -> [meta, index + alt]} - ) + ch_aligner_index = Channel.empty() + ch_versions = Channel.empty() - ch_versions = ch_versions.mix(BWAMEM1_INDEX.out.versions) - break - case 'bwamem2': - BWAMEM2_INDEX(ch_fasta) // If aligner is bwa-mem2 - ch_aligner_index = ch_aligner_index - .mix( - BWAMEM2_INDEX.out.index - .join(ch_altliftover) - .map{meta, index, alt -> [meta, index + alt]} - ) + if (val_aligner == 'bowtie2') { + BOWTIE2_BUILD(ch_fasta) + // if aligner is bowtie2 + ch_aligner_index = ch_aligner_index.mix(BOWTIE2_BUILD.out.index) + ch_versions = ch_versions.mix(BOWTIE2_BUILD.out.versions) + } + else if (val_aligner == 'bwamem') { + BWAMEM1_INDEX(ch_fasta) + // If aligner is bwa-mem + ch_aligner_index = ch_aligner_index.mix( + BWAMEM1_INDEX.out.index.join(ch_altliftover).map { meta, index, alt -> [meta, index + alt] } + ) - ch_versions = ch_versions.mix(BWAMEM2_INDEX.out.versions) - break - case 'dragmap': - DRAGMAP_HASHTABLE(ch_fasta) // If aligner is dragmap - ch_aligner_index = ch_aligner_index.mix(DRAGMAP_HASHTABLE.out.hashmap) - ch_versions = ch_versions.mix(DRAGMAP_HASHTABLE.out.versions) - break - case 'snap': - ch_snap_reference = ch_fasta - .join(ch_altliftover) - .map {meta, fasta, alt -> [meta, fasta, [], [], alt]} + ch_versions = ch_versions.mix(BWAMEM1_INDEX.out.versions) + } + else if (val_aligner == 'bwamem2') { + BWAMEM2_INDEX(ch_fasta) + // If aligner is bwa-mem2 + ch_aligner_index = ch_aligner_index.mix( + BWAMEM2_INDEX.out.index.join(ch_altliftover).map { meta, index, alt -> [meta, index + alt] } + ) + } + else if (val_aligner == 'dragmap') { + DRAGMAP_HASHTABLE(ch_fasta) + // If aligner is dragmap + ch_aligner_index = ch_aligner_index.mix(DRAGMAP_HASHTABLE.out.hashmap) + ch_versions = ch_versions.mix(DRAGMAP_HASHTABLE.out.versions) + } + else if (val_aligner == 'snap') { + ch_snap_reference = ch_fasta + .join(ch_altliftover) + .map { meta, fasta, alt -> [meta, fasta, [], [], alt] } - SNAP_INDEX(ch_snap_reference) // If aligner is snap - ch_aligner_index = ch_aligner_index.mix(SNAP_INDEX.out.index) - ch_versions = ch_versions.mix(SNAP_INDEX.out.versions) - break - default: - error "Unknown aligner: ${val_aligner}" + SNAP_INDEX(ch_snap_reference) + // If aligner is snap + ch_aligner_index = ch_aligner_index.mix(SNAP_INDEX.out.index) + ch_versions = ch_versions.mix(SNAP_INDEX.out.versions) + } + else { + error("Unknown aligner: ${val_aligner}") } emit: - index = ch_aligner_index // channel: [ val(meta), path(index) ] - versions = ch_versions // channel: [ path(versions.yml) ] + index = ch_aligner_index // channel: [ val(meta), path(index) ] + topic_versions = channel.topic('versions') + versions = ch_versions // channel: [ path(versions.yml) ] } diff --git a/subworkflows/nf-core/fastq_align_dna/main.nf b/subworkflows/nf-core/fastq_align_dna/main.nf index 526f0bb8d942..8e3ac39a1363 100644 --- a/subworkflows/nf-core/fastq_align_dna/main.nf +++ b/subworkflows/nf-core/fastq_align_dna/main.nf @@ -5,72 +5,78 @@ // -include { BOWTIE2_ALIGN } from "../../../modules/nf-core/bowtie2/align/main" -include { BWA_MEM as BWAMEM1_MEM } from '../../../modules/nf-core/bwa/mem/main' -include { BWAMEM2_MEM as BWAMEM2_MEM } from '../../../modules/nf-core/bwamem2/mem/main' -include { DRAGMAP_ALIGN } from "../../../modules/nf-core/dragmap/align/main" -include { SNAPALIGNER_ALIGN as SNAP_ALIGN } from '../../../modules/nf-core/snapaligner/align/main' -include { STROBEALIGN } from "../../../modules/nf-core/strobealign/main" +include { BOWTIE2_ALIGN } from "../../../modules/nf-core/bowtie2/align/main" +include { BWA_MEM as BWAMEM1_MEM } from '../../../modules/nf-core/bwa/mem/main' +include { BWAMEM2_MEM as BWAMEM2_MEM } from '../../../modules/nf-core/bwamem2/mem/main' +include { DRAGMAP_ALIGN } from "../../../modules/nf-core/dragmap/align/main" +include { SNAPALIGNER_ALIGN as SNAP_ALIGN } from '../../../modules/nf-core/snapaligner/align/main' +include { STROBEALIGN } from "../../../modules/nf-core/strobealign/main" workflow FASTQ_ALIGN_DNA { take: - ch_reads // channel: [mandatory] meta, reads - ch_aligner_index // channel: [mandatory] aligner index - ch_fasta // channel: [mandatory] fasta file - aligner // string: [mandatory] aligner [bowtie2, bwamem, bwamem2, dragmap, snap] - sort // boolean: [mandatory] true -> sort, false -> don't sort + ch_reads // channel: [mandatory] meta, reads + ch_aligner_index // channel: [mandatory] aligner index + ch_fasta // channel: [mandatory] fasta file + aligner // string: [mandatory] aligner [bowtie2, bwamem, bwamem2, dragmap, snap] + sort // boolean: [mandatory] true -> sort, false -> don't sort main: - ch_bam_index = Channel.empty() - ch_bam = Channel.empty() - ch_reports = Channel.empty() - ch_versions = Channel.empty() + ch_bam_index = Channel.empty() + ch_bam = Channel.empty() + ch_reports = Channel.empty() + ch_versions = Channel.empty() - // Align fastq files to reference genome and (optionally) sort - if (aligner == 'bowtie2') { - BOWTIE2_ALIGN(ch_reads, ch_aligner_index, ch_fasta, false, sort) // if aligner is bowtie2 - ch_bam = ch_bam.mix(BOWTIE2_ALIGN.out.bam) - ch_versions = ch_versions.mix(BOWTIE2_ALIGN.out.versions) - } - else if (aligner == 'bwamem'){ - BWAMEM1_MEM (ch_reads, ch_aligner_index, ch_fasta, sort) // If aligner is bwa-mem - ch_bam = ch_bam.mix(BWAMEM1_MEM.out.bam) - ch_bam_index = ch_bam_index.mix(BWAMEM1_MEM.out.csi) - ch_versions = ch_versions.mix(BWAMEM1_MEM.out.versions) - } - else if (aligner == 'bwamem2'){ - BWAMEM2_MEM (ch_reads, ch_aligner_index, ch_fasta, sort) // If aligner is bwa-mem2 - ch_bam = ch_bam.mix(BWAMEM2_MEM.out.bam) - ch_versions = ch_versions.mix(BWAMEM2_MEM.out.versions) - } - else if (aligner == 'dragmap'){ - DRAGMAP_ALIGN(ch_reads, ch_aligner_index, ch_fasta, sort) // If aligner is dragmap - ch_bam = ch_bam.mix(DRAGMAP_ALIGN.out.bam) - ch_reports = ch_reports.mix(DRAGMAP_ALIGN.out.log) - ch_versions = ch_versions.mix(DRAGMAP_ALIGN.out.versions) - } - else if (aligner == 'snap'){ - SNAP_ALIGN (ch_reads, ch_aligner_index) // If aligner is snap - ch_bam = ch_bam.mix(SNAP_ALIGN.out.bam) - ch_bam_index.mix(SNAP_ALIGN.out.bai) - ch_versions = ch_versions.mix(SNAP_ALIGN.out.versions) - } - else if (aligner == 'strobealign'){ - STROBEALIGN (ch_reads, ch_fasta, ch_aligner_index, sort) // If aligner is strobealign - ch_bam = ch_bam.mix(STROBEALIGN.out.bam) - ch_bam_index = ch_bam_index.mix(STROBEALIGN.out.csi) - ch_versions = ch_versions.mix(STROBEALIGN.out.versions) - } - else { - error "Unknown aligner: ${aligner}" - } + // Align fastq files to reference genome and (optionally) sort + if (aligner == 'bowtie2') { + BOWTIE2_ALIGN(ch_reads, ch_aligner_index, ch_fasta, false, sort) + // if aligner is bowtie2 + ch_bam = ch_bam.mix(BOWTIE2_ALIGN.out.bam) + ch_versions = ch_versions.mix(BOWTIE2_ALIGN.out.versions) + } + else if (aligner == 'bwamem') { + BWAMEM1_MEM(ch_reads, ch_aligner_index, ch_fasta, sort) + // If aligner is bwa-mem + ch_bam = ch_bam.mix(BWAMEM1_MEM.out.bam) + ch_bam_index = ch_bam_index.mix(BWAMEM1_MEM.out.csi) + ch_versions = ch_versions.mix(BWAMEM1_MEM.out.versions) + } + else if (aligner == 'bwamem2') { + BWAMEM2_MEM(ch_reads, ch_aligner_index, ch_fasta, sort) + // If aligner is bwa-mem2 + ch_bam = ch_bam.mix(BWAMEM2_MEM.out.bam) + } + else if (aligner == 'dragmap') { + DRAGMAP_ALIGN(ch_reads, ch_aligner_index, ch_fasta, sort) + // If aligner is dragmap + ch_bam = ch_bam.mix(DRAGMAP_ALIGN.out.bam) + ch_reports = ch_reports.mix(DRAGMAP_ALIGN.out.log) + ch_versions = ch_versions.mix(DRAGMAP_ALIGN.out.versions) + } + else if (aligner == 'snap') { + SNAP_ALIGN(ch_reads, ch_aligner_index) + // If aligner is snap + ch_bam = ch_bam.mix(SNAP_ALIGN.out.bam) + ch_bam_index.mix(SNAP_ALIGN.out.bai) + ch_versions = ch_versions.mix(SNAP_ALIGN.out.versions) + } + else if (aligner == 'strobealign') { + STROBEALIGN(ch_reads, ch_fasta, ch_aligner_index, sort) + // If aligner is strobealign + ch_bam = ch_bam.mix(STROBEALIGN.out.bam) + ch_bam_index = ch_bam_index.mix(STROBEALIGN.out.csi) + ch_versions = ch_versions.mix(STROBEALIGN.out.versions) + } + else { + error("Unknown aligner: ${aligner}") + } emit: - bam = ch_bam // channel: [ [meta], bam ] - bam_index = ch_bam_index // channel: [ [meta], csi/bai ] - reports = ch_reports // channel: [ [meta], log ] - versions = ch_versions // channel: [ versions.yml ] + bam = ch_bam // channel: [ [meta], bam ] + bam_index = ch_bam_index // channel: [ [meta], csi/bai ] + reports = ch_reports // channel: [ [meta], log ] + versions = ch_versions // channel: [ versions.yml ] + topic_versions = channel.topic('versions') } diff --git a/subworkflows/nf-core/fastq_align_dna/tests/main.nf.test b/subworkflows/nf-core/fastq_align_dna/tests/main.nf.test index b65eec69b5fd..f2e141775a94 100644 --- a/subworkflows/nf-core/fastq_align_dna/tests/main.nf.test +++ b/subworkflows/nf-core/fastq_align_dna/tests/main.nf.test @@ -52,7 +52,8 @@ nextflow_workflow { { assert workflow.success}, { assert snapshot( file(workflow.out.bam[0][1]).name, - workflow.out.versions[0] + workflow.out.versions.collect{ path(it).yaml }, + workflow.out.topic_versions ).match() } ) } @@ -86,7 +87,8 @@ nextflow_workflow { { assert workflow.success}, { assert snapshot( file(workflow.out.bam[0][1]).name, - workflow.out.versions[0] + workflow.out.versions.collect{ path(it).yaml }, + workflow.out.topic_versions ).match() } ) } @@ -121,7 +123,8 @@ nextflow_workflow { file(workflow.out.bam[0][1]).name, workflow.out.bam_index, workflow.out.reports, - workflow.out.versions, + workflow.out.versions.collect{ path(it).yaml }, + workflow.out.topic_versions ).match() } ) @@ -157,7 +160,8 @@ nextflow_workflow { file(workflow.out.bam[0][1]).name, workflow.out.bam_index, workflow.out.reports, - workflow.out.versions, + workflow.out.versions.collect{ path(it).yaml }, + workflow.out.topic_versions ).match() } ) @@ -193,7 +197,8 @@ nextflow_workflow { file(workflow.out.bam[0][1]).name, workflow.out.bam_index, workflow.out.reports, - workflow.out.versions, + workflow.out.versions.collect{ path(it).yaml }, + workflow.out.topic_versions ).match() } ) @@ -229,7 +234,8 @@ nextflow_workflow { file(workflow.out.bam[0][1]).name, workflow.out.bam_index, workflow.out.reports, - workflow.out.versions, + workflow.out.versions.collect{ path(it).yaml }, + workflow.out.topic_versions ).match() } ) @@ -264,7 +270,8 @@ nextflow_workflow { { assert snapshot( file(workflow.out.bam[0][1]).name, file(workflow.out.reports[0][1]).readLines().findAll { it.startsWith("decompHash") }, - file(workflow.out.versions[0]).name + workflow.out.versions.collect{ path(it).yaml }, + workflow.out.topic_versions ).match() } ) } @@ -298,7 +305,8 @@ nextflow_workflow { { assert snapshot( file(workflow.out.bam[0][1]).name, file(workflow.out.reports[0][1]).readLines().findAll { it.startsWith("decompHash") }, - file(workflow.out.versions[0]).name + workflow.out.versions.collect{ path(it).yaml }, + workflow.out.topic_versions ).match() } ) } diff --git a/subworkflows/nf-core/fastq_align_dna/tests/main.nf.test.snap b/subworkflows/nf-core/fastq_align_dna/tests/main.nf.test.snap index 9e34d924e84a..cf41b25ecb0a 100644 --- a/subworkflows/nf-core/fastq_align_dna/tests/main.nf.test.snap +++ b/subworkflows/nf-core/fastq_align_dna/tests/main.nf.test.snap @@ -9,14 +9,31 @@ ], [ - "versions.yml:md5,792091aac50160e3fbc865eba482e0c4" + + ], + [ + [ + "BWAMEM2_INDEX", + "bwa-mem2", + "2.2.1" + ], + [ + "FASTQ_ALIGN_DNA:BWAMEM2_MEM", + "bwa-mem2", + "2.2.1" + ], + [ + "FASTQ_ALIGN_DNA:BWAMEM2_MEM", + "samtools", + "1.22.1" + ] ] ], "meta": { "nf-test": "0.9.2", "nextflow": "25.04.7" }, - "timestamp": "2025-09-23T11:46:20.36265064" + "timestamp": "2025-09-25T14:26:20.204243812" }, "test_fastq_align_dragmap_PE": { "content": [ @@ -29,13 +46,24 @@ "decompHashTableAutoHits...", "decompHashTableSetFlags..." ], - "versions.yml" + [ + { + "FASTQ_ALIGN_DNA:DRAGMAP_ALIGN": { + "dragmap": "1.2.1", + "samtools": "1.19.2", + "pigz": "2.3.4" + } + } + ], + [ + + ] ], "meta": { - "nf-test": "0.8.4", - "nextflow": "23.10.1" + "nf-test": "0.9.2", + "nextflow": "25.04.7" }, - "timestamp": "2024-03-14T08:28:25.283436546" + "timestamp": "2025-09-25T14:28:00.270822687" }, "test_fastq_align_strobealign_PE": { "content": [ @@ -57,6 +85,9 @@ ], "3": [ "versions.yml:md5,9d1991417e63455f5e7fe9d67e5985a4" + ], + "4": [ + ], "bam": [ [ @@ -72,6 +103,9 @@ ], "reports": [ + ], + "topic_versions": [ + ], "versions": [ "versions.yml:md5,9d1991417e63455f5e7fe9d67e5985a4" @@ -82,7 +116,7 @@ "nf-test": "0.9.2", "nextflow": "25.04.7" }, - "timestamp": "2025-09-23T14:32:08.743821" + "timestamp": "2025-09-25T14:29:14.157572493" }, "test_fastq_align_bwa_mem_SE": { "content": [ @@ -94,14 +128,22 @@ ], [ - "versions.yml:md5,315f4ae70b5322c025925d84c887da18" + { + "FASTQ_ALIGN_DNA:BWAMEM1_MEM": { + "bwa": "0.7.19-r1273", + "samtools": "1.22.1" + } + } + ], + [ + ] ], "meta": { "nf-test": "0.9.2", "nextflow": "25.04.7" }, - "timestamp": "2025-09-23T11:20:12.631487104" + "timestamp": "2025-09-25T14:25:23.474432812" }, "test_fastq_align_bwamem2_SE": { "content": [ @@ -113,44 +155,80 @@ ], [ - "versions.yml:md5,792091aac50160e3fbc865eba482e0c4" + + ], + [ + [ + "BWAMEM2_INDEX", + "bwa-mem2", + "2.2.1" + ], + [ + "FASTQ_ALIGN_DNA:BWAMEM2_MEM", + "bwa-mem2", + "2.2.1" + ], + [ + "FASTQ_ALIGN_DNA:BWAMEM2_MEM", + "samtools", + "1.22.1" + ] ] ], "meta": { "nf-test": "0.9.2", "nextflow": "25.04.7" }, - "timestamp": "2025-09-23T11:46:07.813351063" + "timestamp": "2025-09-25T14:26:01.163352946" }, - "test_fastq_align_bwa_mem_PE": { + "test_fastq_align_bowtie2_SE": { "content": [ "test.bam", [ - + { + "FASTQ_ALIGN_DNA:BOWTIE2_ALIGN": { + "bowtie2": "2.5.4", + "samtools": 1.21, + "pigz": 2.8 + } + } ], [ - ], - [ - "versions.yml:md5,315f4ae70b5322c025925d84c887da18" ] ], "meta": { "nf-test": "0.9.2", "nextflow": "25.04.7" }, - "timestamp": "2025-09-23T11:20:21.322039351" + "timestamp": "2025-09-25T14:24:40.16043618" }, - "test_fastq_align_bowtie2_SE": { + "test_fastq_align_bwa_mem_PE": { "content": [ "test.bam", - "versions.yml:md5,ef191e9624d747934f15d368715d87db" + [ + + ], + [ + + ], + [ + { + "FASTQ_ALIGN_DNA:BWAMEM1_MEM": { + "bwa": "0.7.19-r1273", + "samtools": "1.22.1" + } + } + ], + [ + + ] ], "meta": { "nf-test": "0.9.2", - "nextflow": "24.10.4" + "nextflow": "25.04.7" }, - "timestamp": "2025-03-24T14:20:30.468391" + "timestamp": "2025-09-25T14:25:40.603778154" }, "test_fastq_align_dragmap_SE": { "content": [ @@ -163,24 +241,46 @@ "decompHashTableAutoHits...", "decompHashTableSetFlags..." ], - "versions.yml" + [ + { + "FASTQ_ALIGN_DNA:DRAGMAP_ALIGN": { + "dragmap": "1.2.1", + "samtools": "1.19.2", + "pigz": "2.3.4" + } + } + ], + [ + + ] ], "meta": { - "nf-test": "0.8.4", - "nextflow": "23.10.1" + "nf-test": "0.9.2", + "nextflow": "25.04.7" }, - "timestamp": "2024-03-14T08:28:12.991034375" + "timestamp": "2025-09-25T14:27:49.052603319" }, "test_fastq_align_bowtie2_PE": { "content": [ "test.bam", - "versions.yml:md5,ef191e9624d747934f15d368715d87db" + [ + { + "FASTQ_ALIGN_DNA:BOWTIE2_ALIGN": { + "bowtie2": "2.5.4", + "samtools": 1.21, + "pigz": 2.8 + } + } + ], + [ + + ] ], "meta": { "nf-test": "0.9.2", - "nextflow": "24.10.4" + "nextflow": "25.04.7" }, - "timestamp": "2025-03-24T14:25:41.372083" + "timestamp": "2025-09-25T14:24:55.755744308" }, "test_fastq_align_snapaligner_PE": { "content": [ @@ -202,6 +302,9 @@ ], "3": [ "versions.yml:md5,e98be7da5d37b69852090365352c3534" + ], + "4": [ + ], "bam": [ [ @@ -217,6 +320,9 @@ ], "reports": [ + ], + "topic_versions": [ + ], "versions": [ "versions.yml:md5,e98be7da5d37b69852090365352c3534" @@ -227,7 +333,7 @@ "nf-test": "0.9.2", "nextflow": "25.04.7" }, - "timestamp": "2025-09-23T12:03:34.617919741" + "timestamp": "2025-09-25T14:28:37.357024943" }, "test_fastq_align_strobealign_SE": { "content": [ @@ -249,6 +355,9 @@ ], "3": [ "versions.yml:md5,9d1991417e63455f5e7fe9d67e5985a4" + ], + "4": [ + ], "bam": [ [ @@ -264,6 +373,9 @@ ], "reports": [ + ], + "topic_versions": [ + ], "versions": [ "versions.yml:md5,9d1991417e63455f5e7fe9d67e5985a4" @@ -274,7 +386,7 @@ "nf-test": "0.9.2", "nextflow": "25.04.7" }, - "timestamp": "2025-09-23T14:32:01.424171" + "timestamp": "2025-09-25T14:28:59.116072002" }, "test_fastq_align_snapaligner_SE": { "content": [ @@ -296,6 +408,9 @@ ], "3": [ "versions.yml:md5,e98be7da5d37b69852090365352c3534" + ], + "4": [ + ], "bam": [ [ @@ -311,6 +426,9 @@ ], "reports": [ + ], + "topic_versions": [ + ], "versions": [ "versions.yml:md5,e98be7da5d37b69852090365352c3534" @@ -321,6 +439,6 @@ "nf-test": "0.9.2", "nextflow": "25.04.7" }, - "timestamp": "2025-09-23T12:03:25.88186957" + "timestamp": "2025-09-25T14:28:23.602263171" } } \ No newline at end of file diff --git a/subworkflows/nf-core/fastq_create_umi_consensus_fgbio/main.nf b/subworkflows/nf-core/fastq_create_umi_consensus_fgbio/main.nf index 4dac538a5f82..9058d7de4a9a 100644 --- a/subworkflows/nf-core/fastq_create_umi_consensus_fgbio/main.nf +++ b/subworkflows/nf-core/fastq_create_umi_consensus_fgbio/main.nf @@ -4,35 +4,34 @@ // use the mapped information to group UMIs and generate consensus reads // -include { BWA_INDEX as BWAMEM1_INDEX } from '../../../modules/nf-core/bwa/index/main.nf' -include { BWA_MEM as BWAMEM1_MEM_PRE } from '../../../modules/nf-core/bwa/mem/main.nf' -include { BWA_MEM as BWAMEM1_MEM_POST } from '../../../modules/nf-core/bwa/mem/main.nf' -include { BWAMEM2_INDEX } from '../../../modules/nf-core/bwamem2/index/main.nf' -include { BWAMEM2_MEM as BWAMEM2_MEM_PRE } from '../../../modules/nf-core/bwamem2/mem/main.nf' -include { BWAMEM2_MEM as BWAMEM2_MEM_POST } from '../../../modules/nf-core/bwamem2/mem/main.nf' -include { FGBIO_CALLMOLECULARCONSENSUSREADS as CALLUMICONSENSUS } from '../../../modules/nf-core/fgbio/callmolecularconsensusreads/main.nf' -include { FGBIO_CALLDUPLEXCONSENSUSREADS as CALLDUPLEXCONSENSUS } from '../../../modules/nf-core/fgbio/callduplexconsensusreads/main.nf' -include { FGBIO_FASTQTOBAM as FASTQTOBAM } from '../../../modules/nf-core/fgbio/fastqtobam/main.nf' -include { FGBIO_FILTERCONSENSUSREADS as FILTERCONSENSUS } from '../../../modules/nf-core/fgbio/filterconsensusreads/main.nf' -include { FGBIO_GROUPREADSBYUMI as GROUPREADSBYUMI } from '../../../modules/nf-core/fgbio/groupreadsbyumi/main.nf' -include { FGBIO_ZIPPERBAMS as ZIPPERBAMS_PRE } from '../../../modules/nf-core/fgbio/zipperbams/main.nf' -include { FGBIO_ZIPPERBAMS as ZIPPERBAMS_POST } from '../../../modules/nf-core/fgbio/zipperbams/main.nf' -include { SAMTOOLS_FASTQ as BAM2FASTQ_PRE } from '../../../modules/nf-core/samtools/fastq/main.nf' -include { SAMTOOLS_FASTQ as BAM2FASTQ_POST } from '../../../modules/nf-core/samtools/fastq/main.nf' -include { SAMTOOLS_SORT as SORTBAM } from '../../../modules/nf-core/samtools/sort/main.nf' +include { BWA_INDEX as BWAMEM1_INDEX } from '../../../modules/nf-core/bwa/index/main.nf' +include { BWA_MEM as BWAMEM1_MEM_PRE } from '../../../modules/nf-core/bwa/mem/main.nf' +include { BWA_MEM as BWAMEM1_MEM_POST } from '../../../modules/nf-core/bwa/mem/main.nf' +include { BWAMEM2_INDEX } from '../../../modules/nf-core/bwamem2/index/main.nf' +include { BWAMEM2_MEM as BWAMEM2_MEM_PRE } from '../../../modules/nf-core/bwamem2/mem/main.nf' +include { BWAMEM2_MEM as BWAMEM2_MEM_POST } from '../../../modules/nf-core/bwamem2/mem/main.nf' +include { FGBIO_CALLMOLECULARCONSENSUSREADS as CALLUMICONSENSUS } from '../../../modules/nf-core/fgbio/callmolecularconsensusreads/main.nf' +include { FGBIO_CALLDUPLEXCONSENSUSREADS as CALLDUPLEXCONSENSUS } from '../../../modules/nf-core/fgbio/callduplexconsensusreads/main.nf' +include { FGBIO_FASTQTOBAM as FASTQTOBAM } from '../../../modules/nf-core/fgbio/fastqtobam/main.nf' +include { FGBIO_FILTERCONSENSUSREADS as FILTERCONSENSUS } from '../../../modules/nf-core/fgbio/filterconsensusreads/main.nf' +include { FGBIO_GROUPREADSBYUMI as GROUPREADSBYUMI } from '../../../modules/nf-core/fgbio/groupreadsbyumi/main.nf' +include { FGBIO_ZIPPERBAMS as ZIPPERBAMS_PRE } from '../../../modules/nf-core/fgbio/zipperbams/main.nf' +include { FGBIO_ZIPPERBAMS as ZIPPERBAMS_POST } from '../../../modules/nf-core/fgbio/zipperbams/main.nf' +include { SAMTOOLS_FASTQ as BAM2FASTQ_PRE } from '../../../modules/nf-core/samtools/fastq/main.nf' +include { SAMTOOLS_FASTQ as BAM2FASTQ_POST } from '../../../modules/nf-core/samtools/fastq/main.nf' +include { SAMTOOLS_SORT as SORTBAM } from '../../../modules/nf-core/samtools/sort/main.nf' workflow FASTQ_CREATE_UMI_CONSENSUS_FGBIO { - take: - reads // channel: [mandatory] [ val(meta), [ reads ] ] - fasta // channel: [mandatory] [ val(meta), /path/to/reference/fasta ] - bwa_index // channel: [optional] [ val(meta), /path/to/reference/bwaindex ] - dict // channel: [mandatory] [ val(meta), /path/to/reference/dictionary ] - groupreadsbyumi_strategy // string: [mandatory] grouping strategy - default: "Adjacency" - aligner // string: [mandatory] "bwa-mem" or "bwa-mem2" - duplex // bool: [mandatory] true or false depending on UMI structure - min_reads // [mandatory] One integer (for non-duplex) or a string of up-to three space-separated numbers for duplex sequencing - min_baseq // integer: [mandatory] - max_base_error_rate // integer: [mandatory] Maximum base error rate for consensus building + reads // channel: [mandatory] [ val(meta), [ reads ] ] + fasta // channel: [mandatory] [ val(meta), /path/to/reference/fasta ] + bwa_index // channel: [optional] [ val(meta), /path/to/reference/bwaindex ] + dict // channel: [mandatory] [ val(meta), /path/to/reference/dictionary ] + groupreadsbyumi_strategy // string: [mandatory] grouping strategy - default: "Adjacency" + aligner // string: [mandatory] "bwa-mem" or "bwa-mem2" + duplex // bool: [mandatory] true or false depending on UMI structure + min_reads // [mandatory] One integer (for non-duplex) or a string of up-to three space-separated numbers for duplex sequencing + min_baseq // integer: [mandatory] + max_base_error_rate // integer: [mandatory] Maximum base error rate for consensus building main: @@ -47,11 +46,11 @@ workflow FASTQ_CREATE_UMI_CONSENSUS_FGBIO { // if the UMIs are present in read names instead of inline sequences // please make sure you adjust your config to include --extract-umis-from-read-names with ext.args // of the following step - FASTQTOBAM ( reads ) + FASTQTOBAM(reads) ch_versions = ch_versions.mix(FASTQTOBAM.out.versions) // in order to map uBAM using BWA MEM, we need to convert uBAM to FASTQ - BAM2FASTQ_PRE ( FASTQTOBAM.out.bam, false ) + BAM2FASTQ_PRE(FASTQTOBAM.out.bam, false) ch_versions = ch_versions.mix(BAM2FASTQ_PRE.out.versions) // the user can choose here to use either bwa-mem (default) or bwa-mem2 @@ -59,39 +58,38 @@ workflow FASTQ_CREATE_UMI_CONSENSUS_FGBIO { if (aligner == "bwa-mem") { - if(!bwa_index){ - BWAMEM1_INDEX ( fasta ) + if (!bwa_index) { + BWAMEM1_INDEX(fasta) ch_versions = ch_versions.mix(BWAMEM1_INDEX.out.versions) } // sets bwaindex to correct input - bwaindex = bwa_index ?: BWAMEM1_INDEX.out.index + bwaindex = bwa_index ?: BWAMEM1_INDEX.out.index // appropriately tagged interleaved FASTQ reads are mapped to the reference // the aligner should be set with the following parameters "-p -K 150000000 -Y" // to be configured in ext.args of your config - BWAMEM1_MEM_PRE ( BAM2FASTQ_PRE.out.fastq, bwaindex, fasta, false ) + BWAMEM1_MEM_PRE(BAM2FASTQ_PRE.out.fastq, bwaindex, fasta, false) ch_versions = ch_versions.mix(BWAMEM1_MEM_PRE.out.versions) aligned_bam = aligned_bam.mix(BWAMEM1_MEM_PRE.out.bam) - } else { + } + else { - if(!bwa_index){ - BWAMEM2_INDEX ( fasta ) - ch_versions = ch_versions.mix(BWAMEM2_INDEX.out.versions) + if (!bwa_index) { + BWAMEM2_INDEX(fasta) } // sets bwaindex to correct input - bwaindex = bwa_index ?: BWAMEM2_INDEX.out.index + bwaindex = bwa_index ?: BWAMEM2_INDEX.out.index // appropriately tagged interleaved FASTQ reads are mapped to the reference // the aligner should be set with the following parameters "-p -K 150000000 -Y" // to be configured in ext.args of your config - BWAMEM2_MEM_PRE ( BAM2FASTQ_PRE.out.fastq, bwaindex, fasta, false ) - ch_versions = ch_versions.mix(BWAMEM2_MEM_PRE.out.versions) + BWAMEM2_MEM_PRE(BAM2FASTQ_PRE.out.fastq, bwaindex, fasta, false) aligned_bam = BWAMEM2_MEM_PRE.out.bam } // in order to tag mates information in the BAM file // FGBIO tool ZipperBams is used to merge info from mapped and unmapped BAM files - ZIPPERBAMS_PRE ( FASTQTOBAM.out.bam, aligned_bam, fasta, dict ) + ZIPPERBAMS_PRE(FASTQTOBAM.out.bam, aligned_bam, fasta, dict) ch_versions = ch_versions.mix(ZIPPERBAMS_PRE.out.versions) // appropriately tagged reads are now grouped by UMI information @@ -101,60 +99,61 @@ workflow FASTQ_CREATE_UMI_CONSENSUS_FGBIO { // For multiplex PCR and similar data where reads' genomic positions are fixed by the primers // it is recommended to use --strategy Identity to reduce runtime at the expense of lower accuracy // For duplex UMIs reads MUST be grouped using --strategy paired - GROUPREADSBYUMI ( ZIPPERBAMS_PRE.out.bam, groupreadsbyumi_strategy ) + GROUPREADSBYUMI(ZIPPERBAMS_PRE.out.bam, groupreadsbyumi_strategy) ch_versions = ch_versions.mix(GROUPREADSBYUMI.out.versions) // prepare output channel independently on UMI structure consensus_bam = Channel.empty() - if (duplex){ + if (duplex) { // this is executed if the library contains duplex UMIs - CALLDUPLEXCONSENSUS ( GROUPREADSBYUMI.out.bam, min_reads, min_baseq ) + CALLDUPLEXCONSENSUS(GROUPREADSBYUMI.out.bam, min_reads, min_baseq) ch_versions = ch_versions.mix(CALLDUPLEXCONSENSUS.out.versions) - consensus_bam = CALLDUPLEXCONSENSUS.out.bam - - } else { + consensus_bam = CALLDUPLEXCONSENSUS.out.bam + } + else { // using the above created groups, a consensus across reads in the same group // can be called // this will emit a consensus BAM file - CALLUMICONSENSUS ( GROUPREADSBYUMI.out.bam, min_reads, min_baseq ) + CALLUMICONSENSUS(GROUPREADSBYUMI.out.bam, min_reads, min_baseq) ch_versions = ch_versions.mix(CALLUMICONSENSUS.out.versions) - consensus_bam = CALLUMICONSENSUS.out.bam + consensus_bam = CALLUMICONSENSUS.out.bam } - FILTERCONSENSUS ( consensus_bam, fasta, min_reads, min_baseq, max_base_error_rate ) + FILTERCONSENSUS(consensus_bam, fasta, min_reads, min_baseq, max_base_error_rate) ch_versions = ch_versions.mix(FILTERCONSENSUS.out.versions) // now the consensus uBAM needs to be converted into FASTQ again // to be aligned - BAM2FASTQ_POST ( FILTERCONSENSUS.out.bam, false ) + BAM2FASTQ_POST(FILTERCONSENSUS.out.bam, false) ch_versions = ch_versions.mix(BAM2FASTQ_POST.out.versions) if (aligner == "bwa-mem") { // index made available through previous steps - BWAMEM1_MEM_POST ( BAM2FASTQ_POST.out.fastq, bwaindex, fasta, false ) + BWAMEM1_MEM_POST(BAM2FASTQ_POST.out.fastq, bwaindex, fasta, false) ch_versions = ch_versions.mix(BWAMEM1_MEM_POST.out.versions) aligned_bam_post = BWAMEM1_MEM_POST.out.bam - } else { + } + else { // index made available through previous steps - BWAMEM2_MEM_POST ( BAM2FASTQ_POST.out.fastq, bwaindex, fasta, false ) - ch_versions = ch_versions.mix(BWAMEM2_MEM_POST.out.versions) + BWAMEM2_MEM_POST(BAM2FASTQ_POST.out.fastq, bwaindex, fasta, false) aligned_bam_post = BWAMEM2_MEM_POST.out.bam } // in order to tag mates information in the BAM file // FGBIO tool ZipperBams is used to merge info from mapped and unmapped BAM files - ZIPPERBAMS_POST ( consensus_bam, aligned_bam_post, fasta, dict ) + ZIPPERBAMS_POST(consensus_bam, aligned_bam_post, fasta, dict) ch_versions = ch_versions.mix(ZIPPERBAMS_POST.out.versions) // finally sort bam file - SORTBAM ( ZIPPERBAMS_POST.out.bam, fasta, '' ) + SORTBAM(ZIPPERBAMS_POST.out.bam, fasta, '') ch_versions = ch_versions.mix(SORTBAM.out.versions) emit: - ubam = FASTQTOBAM.out.bam // channel: [ val(meta), [ bam ] ] - groupbam = GROUPREADSBYUMI.out.bam // channel: [ val(meta), [ bam ] ] - consensusbam = consensus_bam // channel: [ val(meta), [ bam ] ] - mappedconsensusbam = SORTBAM.out.bam // channel: [ val(meta), [ bam ] ] - versions = ch_versions // channel: [ versions.yml ] + ubam = FASTQTOBAM.out.bam // channel: [ val(meta), [ bam ] ] + groupbam = GROUPREADSBYUMI.out.bam // channel: [ val(meta), [ bam ] ] + consensusbam = consensus_bam // channel: [ val(meta), [ bam ] ] + mappedconsensusbam = SORTBAM.out.bam // channel: [ val(meta), [ bam ] ] + versions = ch_versions // channel: [ versions.yml ] + topic_versions = channel.topic('versions') } diff --git a/subworkflows/nf-core/fastq_create_umi_consensus_fgbio/tests/main.nf.test.snap b/subworkflows/nf-core/fastq_create_umi_consensus_fgbio/tests/main.nf.test.snap index 92387333efed..e0052369d0b0 100644 --- a/subworkflows/nf-core/fastq_create_umi_consensus_fgbio/tests/main.nf.test.snap +++ b/subworkflows/nf-core/fastq_create_umi_consensus_fgbio/tests/main.nf.test.snap @@ -51,6 +51,9 @@ "versions.yml:md5,d4002928b733d6e0449fa2c1257f1c51", "versions.yml:md5,dabd25445072e5f00a20caa8aebeb1e7", "versions.yml:md5,fe5832993156e42eedd56f42642b90ff" + ], + "5": [ + ], "consensusbam": [ [ @@ -78,6 +81,9 @@ }, "test_single.bam:md5,a62aa9aa5eb8f37c2ae7a872b4c7e51f" ] + ], + "topic_versions": [ + ], "ubam": [ [ @@ -108,7 +114,7 @@ "nf-test": "0.9.2", "nextflow": "25.04.7" }, - "timestamp": "2025-09-23T11:24:13.918256252" + "timestamp": "2025-09-25T14:32:14.76841161" }, "single_umi - stub": { "content": [ @@ -162,6 +168,9 @@ "versions.yml:md5,d4002928b733d6e0449fa2c1257f1c51", "versions.yml:md5,dabd25445072e5f00a20caa8aebeb1e7", "versions.yml:md5,fe5832993156e42eedd56f42642b90ff" + ], + "5": [ + ], "consensusbam": [ [ @@ -189,6 +198,9 @@ }, "test_single.bam:md5,d41d8cd98f00b204e9800998ecf8427e" ] + ], + "topic_versions": [ + ], "ubam": [ [ @@ -219,7 +231,7 @@ "nf-test": "0.9.2", "nextflow": "25.04.7" }, - "timestamp": "2025-09-23T11:27:18.189799771" + "timestamp": "2025-09-25T14:36:21.890012018" }, "duplex_umi": { "content": [ @@ -273,6 +285,9 @@ "versions.yml:md5,d4002928b733d6e0449fa2c1257f1c51", "versions.yml:md5,dabd25445072e5f00a20caa8aebeb1e7", "versions.yml:md5,fe5832993156e42eedd56f42642b90ff" + ], + "5": [ + ], "consensusbam": [ [ @@ -300,6 +315,9 @@ }, "test_single.bam:md5,efb156a6d982a5a3714be7d89ed39e69" ] + ], + "topic_versions": [ + ], "ubam": [ [ @@ -330,6 +348,6 @@ "nf-test": "0.9.2", "nextflow": "25.04.7" }, - "timestamp": "2025-09-23T11:26:39.311886248" + "timestamp": "2025-09-25T14:35:32.224379292" } } \ No newline at end of file diff --git a/tests/config/nextflow.config b/tests/config/nextflow.config index e58f30886398..598bd1865b26 100644 --- a/tests/config/nextflow.config +++ b/tests/config/nextflow.config @@ -45,5 +45,5 @@ conda { createTimeout = "120 min" } includeConfig 'test_data.config' manifest { - nextflowVersion = '!>=24.10.2' + nextflowVersion = '!>=25.04.6' } diff --git a/tests/config/nf-test.config b/tests/config/nf-test.config index 336f2e178917..43c8fd0b2f72 100644 --- a/tests/config/nf-test.config +++ b/tests/config/nf-test.config @@ -97,5 +97,5 @@ conda { createTimeout = "120 min" } includeConfig 'test_data.config' manifest { - nextflowVersion = '!>=24.10.2' + nextflowVersion = '!>=25.04.6' }