Skip to content
Open
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
38 changes: 20 additions & 18 deletions modules/nf-core/bwa/index/main.nf
Original file line number Diff line number Diff line change
@@ -1,44 +1,46 @@
process BWA_INDEX {
tag "$fasta"
tag "${fasta}"
// NOTE requires 5.37N memory where N is the size of the database
// source: https://bio-bwa.sourceforge.net/bwa.shtml#8
memory { 6.B * fasta.size() }

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/d7/d7e24dc1e4d93ca4d3a76a78d4c834a7be3985b0e1e56fddd61662e047863a8a/data' :
'community.wave.seqera.io/library/bwa_htslib_samtools:83b50ff84ead50d0' }"
container "${workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container
? 'https://community-cr-prod.seqera.io/docker/registry/v2/blobs/sha256/d7/d7e24dc1e4d93ca4d3a76a78d4c834a7be3985b0e1e56fddd61662e047863a8a/data'
: 'community.wave.seqera.io/library/bwa_htslib_samtools:83b50ff84ead50d0'}"

input:
tuple val(meta), path(fasta)

output:
tuple val(meta), path("bwa"), emit: index
tuple val(meta), path("${prefix}"), emit: index
tuple val("${task.process}"), val('bwa'), eval('bwa 2>&1 | sed -n "s/^Version: //p"'), topic: versions, emit: versions_bwa

when:
task.ext.when == null || task.ext.when

script:
def prefix = task.ext.prefix ?: "${fasta.baseName}"
def args = task.ext.args ?: ''
prefix = task.ext.prefix ?: meta.id ? "${meta.id}" : "${fasta.baseName}"
def args = task.ext.args ?: ''
def suffix = task.ext.suffix ?: "${fasta.baseName}"
"""
mkdir bwa
mkdir ${prefix}
bwa \\
index \\
$args \\
-p bwa/${prefix} \\
$fasta
${args} \\
-p ${prefix}/${suffix} \\
${fasta}
"""

stub:
def prefix = task.ext.prefix ?: "${fasta.baseName}"
prefix = task.ext.prefix ?: meta.id ? "${meta.id}" : "${fasta.baseName}"
def suffix = task.ext.suffix ?: "${fasta.baseName}"
"""
mkdir bwa
touch bwa/${prefix}.amb
touch bwa/${prefix}.ann
touch bwa/${prefix}.bwt
touch bwa/${prefix}.pac
touch bwa/${prefix}.sa
mkdir ${prefix}
touch ${prefix}/${suffix}.amb
touch ${prefix}/${suffix}.ann
touch ${prefix}/${suffix}.bwt
touch ${prefix}/${suffix}.pac
touch ${prefix}/${suffix}.sa
"""
}
12 changes: 7 additions & 5 deletions modules/nf-core/bwa/index/meta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@ output:
type: map
description: |
Groovy Map containing reference information.
e.g. [ id:'test', single_end:false ]
- bwa:
type: map
e.g. [ id:'test' ]
- ${prefix}:
type: directory
description: |
Groovy Map containing reference information.
Directory containing bwa index files.
e.g. [ id:'test', single_end:false ]
pattern: "*.{amb,ann,bwt,pac,sa}"
pattern: "${prefix}/*.{amb,ann,bwt,pac,sa}"
ontologies:
- edam: "http://edamontology.org/data_3210" # Genome index
versions_bwa:
Expand Down Expand Up @@ -69,3 +69,5 @@ authors:
maintainers:
- "@maxulysse"
- "@gallvp"
contributor:
- "@pmoris"
4 changes: 1 addition & 3 deletions modules/nf-core/parabricks/fq2bam/tests/nextflow.config
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
process {

withName: 'PARABRICKS_FQ2BAM' {
ext.args = params.module_args
}

withName: 'BWA_INDEX' {
ext.prefix = params.bwa_prefix
ext.suffix = params.bwa_prefix
}

}
2 changes: 1 addition & 1 deletion modules/nf-core/svaba/tests/nextflow.config
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
process {
withName: BWA_INDEX {
// Note that this tool requires the bwa index files to be of the format genome.fasta.amb
ext.prefix = { "${fasta}" }
ext.suffix = { "${fasta}" }
}
}
24 changes: 12 additions & 12 deletions subworkflows/nf-core/fastq_align_bwa/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"id": "test",
"single_end": false
},
"test.bam:md5,5dbdcfdba65fac634dcbb6984cffe2c4"
"test.bam:md5,58251bd54a233f5a794aaac72b3d189b"
]
],
"1": [
Expand All @@ -17,7 +17,7 @@
"id": "test",
"single_end": false
},
"test.sorted.bam:md5,ba4b90f87517a16a6ae6142f37a75d79"
"test.sorted.bam:md5,ecabaa3ae3ea323628ca98f1d2ffc9e3"
]
],
"2": [
Expand Down Expand Up @@ -77,7 +77,7 @@
"id": "test",
"single_end": false
},
"test.sorted.bam:md5,ba4b90f87517a16a6ae6142f37a75d79"
"test.sorted.bam:md5,ecabaa3ae3ea323628ca98f1d2ffc9e3"
]
],
"bam_orig": [
Expand All @@ -86,7 +86,7 @@
"id": "test",
"single_end": false
},
"test.bam:md5,5dbdcfdba65fac634dcbb6984cffe2c4"
"test.bam:md5,58251bd54a233f5a794aaac72b3d189b"
]
],
"csi": [
Expand Down Expand Up @@ -126,9 +126,9 @@
],
"meta": {
"nf-test": "0.9.3",
"nextflow": "25.10.3"
"nextflow": "25.10.4"
},
"timestamp": "2026-02-03T11:20:05.312197328"
"timestamp": "2026-02-12T11:41:40.244336788"
},
"fastq_align_bwa_single_end": {
"content": [
Expand All @@ -139,7 +139,7 @@
"id": "test",
"single_end": true
},
"test.bam:md5,f7af092ddd5203f647ba96b926392c3e"
"test.bam:md5,8adf507b66fcc54f37bbd356fcef8e04"
]
],
"1": [
Expand All @@ -148,7 +148,7 @@
"id": "test",
"single_end": true
},
"test.sorted.bam:md5,c406a43adde2d9673e71d8a8c7db7cfd"
"test.sorted.bam:md5,710bd6acfd07f0d191dc73b81402bda7"
]
],
"2": [
Expand Down Expand Up @@ -208,7 +208,7 @@
"id": "test",
"single_end": true
},
"test.sorted.bam:md5,c406a43adde2d9673e71d8a8c7db7cfd"
"test.sorted.bam:md5,710bd6acfd07f0d191dc73b81402bda7"
]
],
"bam_orig": [
Expand All @@ -217,7 +217,7 @@
"id": "test",
"single_end": true
},
"test.bam:md5,f7af092ddd5203f647ba96b926392c3e"
"test.bam:md5,8adf507b66fcc54f37bbd356fcef8e04"
]
],
"csi": [
Expand Down Expand Up @@ -257,8 +257,8 @@
],
"meta": {
"nf-test": "0.9.3",
"nextflow": "25.10.3"
"nextflow": "25.10.4"
},
"timestamp": "2026-02-03T11:19:56.892854959"
"timestamp": "2026-02-12T11:41:30.707612915"
}
}