Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bwamem2 for mt #600

Merged
merged 5 commits into from
Aug 20, 2024
Merged
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
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### `Added`

- A new parameter `mt_aligner` to control which aligner is used to align reads to mitochondria [#600](https://github.com/nf-core/raredisease/pull/600)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add that bwa meme can no longer be used to align mt

- A new parameter `par_bed` to pass a PAR bed files to deepvariant [#598](https://github.com/nf-core/raredisease/pull/598)
- A new functionality to pass gzipped resources to vcfanno_extra_resources [#589](https://github.com/nf-core/raredisease/pull/589)
- A new parameter `vcfanno_extra_resources` to pass an extra resource to vcfanno [#588](https://github.com/nf-core/raredisease/pull/588)
Expand All @@ -20,6 +21,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### `Changed`

- bwameme can no longer be used to align mitochondrial reads [#600](https://github.com/nf-core/raredisease/pull/600)
- Males' X and Y chromosomes will be treated as haploids during variant calling by deepvariant [#598](https://github.com/nf-core/raredisease/pull/598)
- Acceptable type for lane field in the samplesheet from number to string [#597](https://github.com/nf-core/raredisease/pull/597)
- Allow `0` as a valid value for `sex` in the samplesheet [#595](https://github.com/nf-core/raredisease/pull/595)
Expand All @@ -46,6 +48,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
| Old parameter | New parameter |
| --------------- | ------------------------ |
| | mbuffer_mem |
| | mt_aligner |
| | samtools_sort_threads |
| | skip_repeat_calling |
| | skip_snv_calling |
Expand Down
12 changes: 0 additions & 12 deletions conf/modules/align_MT.config
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,6 @@ process {
ext.prefix = { "${meta.id}_sorted" }
}

withName: '.*ALIGN_MT:BWAMEME_MEM_MT' {
ext.args = { "-7 -M -K 100000000 -R ${meta.read_group}" }
ext.args2 = { "-T ./samtools_sort_tmp" }
ext.prefix = { "${meta.id}_sorted" }
}

withName: '.*ALIGN_MT:BWA_MEM_MT' {
ext.args = { "-M -K 100000000 -R ${meta.read_group}" }
ext.args2 = { "-T ./samtools_sort_tmp" }
Expand Down Expand Up @@ -80,12 +74,6 @@ process {
ext.prefix = { "${meta.id}_sorted_shifted" }
}

withName: '.*ALIGN_MT_SHIFT:BWAMEME_MEM_MT' {
ext.args = { "-7 -M -K 100000000 -R ${meta.read_group}" }
ext.args2 = { "-T ./samtools_sort_tmp" }
ext.prefix = { "${meta.id}_sorted_shifted" }
}

withName: '.*ALIGN_MT_SHIFT:SENTIEON_BWAMEM_MT' {
ext.args = { "-M -K 10000000 -R ${meta.read_group}" }
ext.args2 = { "-T ./samtools_sort_tmp" }
Expand Down
1 change: 1 addition & 0 deletions nextflow.config
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ params {

// Alignment
aligner = 'bwamem2'
mt_aligner = 'bwamem2'
mbuffer_mem = 3072
samtools_sort_threads = 4
min_trimmed_length = 40
Expand Down
7 changes: 7 additions & 0 deletions nextflow_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -632,6 +632,13 @@
"fa_icon": "fas fa-align-center",
"enum": ["bwa", "bwamem2", "bwameme", "sentieon"]
},
"mt_aligner": {
"type": "string",
"default": "bwamem2",
"description": "Specifies the alignment algorithm to use - available options are 'bwamem2' and 'sentieon'.",
"fa_icon": "fas fa-align-center",
"enum": ["bwa", "bwamem2", "sentieon"]
},
"samtools_sort_threads": {
"type": "integer",
"default": 4,
Expand Down
10 changes: 2 additions & 8 deletions subworkflows/local/align.nf
Original file line number Diff line number Diff line change
Expand Up @@ -97,25 +97,19 @@ workflow ALIGN {
CONVERT_MT_BAM_TO_FASTQ.out.bam,
ch_genome_bwaindex,
ch_genome_bwamem2index,
ch_genome_bwamemeindex,
ch_genome_fasta,
ch_genome_dictionary,
ch_genome_fai,
val_mbuffer_mem,
val_sort_threads
ch_genome_fai
)

ALIGN_MT_SHIFT (
CONVERT_MT_BAM_TO_FASTQ.out.fastq,
CONVERT_MT_BAM_TO_FASTQ.out.bam,
ch_mtshift_bwaindex,
ch_mtshift_bwamem2index,
ch_mtshift_bwamemeindex,
ch_mtshift_fasta,
ch_mtshift_dictionary,
ch_mtshift_fai,
val_mbuffer_mem,
val_sort_threads
ch_mtshift_fai
)

ch_mt_marked_bam = ALIGN_MT.out.marked_bam
Expand Down
14 changes: 3 additions & 11 deletions subworkflows/local/alignment/align_MT.nf
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
include { BWA_MEM as BWA_MEM_MT } from '../../../modules/nf-core/bwa/mem/main'
include { SENTIEON_BWAMEM as SENTIEON_BWAMEM_MT } from '../../../modules/nf-core/sentieon/bwamem/main'
include { BWAMEM2_MEM as BWAMEM2_MEM_MT } from '../../../modules/nf-core/bwamem2/mem/main'
include { BWAMEME_MEM as BWAMEME_MEM_MT } from '../../../modules/nf-core/bwameme/mem/main'
include { GATK4_MERGEBAMALIGNMENT as GATK4_MERGEBAMALIGNMENT_MT } from '../../../modules/nf-core/gatk4/mergebamalignment/main'
include { PICARD_ADDORREPLACEREADGROUPS as PICARD_ADDORREPLACEREADGROUPS_MT } from '../../../modules/nf-core/picard/addorreplacereadgroups/main'
include { PICARD_MARKDUPLICATES as PICARD_MARKDUPLICATES_MT } from '../../../modules/nf-core/picard/markduplicates/main'
Expand All @@ -18,32 +17,25 @@ workflow ALIGN_MT {
ch_ubam // channel: [mandatory] [ val(meta), path(bam) ]
ch_bwaindex // channel: [mandatory for sentieon] [ val(meta), path(index) ]
ch_bwamem2index // channel: [mandatory for bwamem2] [ val(meta), path(index) ]
ch_bwamemeindex // channel: [mandatory for bwameme] [ val(meta), path(index) ]
ch_fasta // channel: [mandatory] [ val(meta), path(fasta) ]
ch_dict // channel: [mandatory] [ val(meta), path(dict) ]
ch_fai // channel: [mandatory] [ val(meta), path(fai) ]
val_mbuffer_mem // integer: [mandatory] default: 3072
val_sort_threads // integer: [mandatory] default: 4

main:
ch_versions = Channel.empty()

if (params.aligner.equals("bwamem2")) {
if (params.mt_aligner.equals("bwamem2")) {
BWAMEM2_MEM_MT (ch_fastq, ch_bwamem2index, ch_fasta, true)
ch_align = BWAMEM2_MEM_MT.out.bam
ch_versions = ch_versions.mix(BWAMEM2_MEM_MT.out.versions.first())
} else if (params.aligner.equals("sentieon")) {
} else if (params.mt_aligner.equals("sentieon")) {
SENTIEON_BWAMEM_MT ( ch_fastq, ch_bwaindex, ch_fasta, ch_fai )
ch_align = SENTIEON_BWAMEM_MT.out.bam_and_bai.map{ meta, bam, bai -> [meta, bam] }
ch_versions = ch_versions.mix(SENTIEON_BWAMEM_MT.out.versions.first())
} else if (params.aligner.equals("bwa")) {
} else if (params.mt_aligner.equals("bwa")) {
BWA_MEM_MT ( ch_fastq, ch_bwaindex, ch_fasta, true )
ch_align = BWA_MEM_MT.out.bam
ch_versions = ch_versions.mix(BWA_MEM_MT.out.versions.first())
} else if (params.aligner.equals("bwameme")) {
BWAMEME_MEM_MT (ch_fastq, ch_bwamemeindex, ch_fasta, true, val_mbuffer_mem, val_sort_threads)
ch_align = BWAMEME_MEM_MT.out.bam
ch_versions = ch_versions.mix(BWAMEME_MEM_MT.out.versions.first())
}
ch_align
.join(ch_ubam, failOnMismatch:true, failOnDuplicate:true)
Expand Down