Skip to content
Draft
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
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/nf-test-gpu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/nf-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pytest-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/update-gpu-snapshot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/update-sentieon-snapshot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/wave.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
24 changes: 7 additions & 17 deletions modules/nf-core/bwamem2/index/main.nf
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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:
Expand All @@ -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
"""
}
7 changes: 0 additions & 7 deletions modules/nf-core/bwamem2/index/meta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
10 changes: 4 additions & 6 deletions modules/nf-core/bwamem2/index/tests/main.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -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() }
)
}
Expand All @@ -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() }
)
}
Expand Down
40 changes: 22 additions & 18 deletions modules/nf-core/bwamem2/index/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
Expand All @@ -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"
}
}
61 changes: 27 additions & 34 deletions modules/nf-core/bwamem2/mem/main.nf
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
"""
}
7 changes: 0 additions & 7 deletions modules/nf-core/bwamem2/mem/meta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Loading
Loading