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

Add dragmap aligner #464

Merged
merged 8 commits into from
Mar 25, 2022
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
16 changes: 16 additions & 0 deletions conf/modules.config
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,15 @@ process {
]
}

withName: 'DRAGMAP_HASHTABLE' {
publishDir = [
path: { "${params.outdir}/reference/dragmap" },
enabled: "params.save_reference",
pattern: "dragmap"
]

}

withName: 'CREATE_INTERVALS_BED' {
publishDir = [
enabled: "${params.save_reference}",
Expand Down Expand Up @@ -256,6 +265,13 @@ process {
// Only name sort if Spark for Markduplicates + duplicate marking is not skipped
ext.args2 = { params.use_gatk_spark && params.use_gatk_spark.contains('markduplicates') && (!params.skip_tools || (params.skip_tools && !params.skip_tools.contains('markduplicates'))) ? '-n' : '' }
ext.prefix = { params.split_fastq > 1 ? "${meta.id}".concat('.').concat(reads.get(0).name.findAll(/part_([0-9]+)?/).last()) : "" }

withName: "DRAGMAP_ALIGN" {
publishDir = [ enabled: false ]
ext.prefix = { params.split_fastq > 1 ? "${meta.id}".concat(reads.get(0).name.findAll(/part_([0-9]+)?/).last().concat('.')) : "${meta.id}" }
}

withName: 'INDEX_MAPPING' {
publishDir = [
enabled: false
]
Expand Down
6 changes: 6 additions & 0 deletions docs/output.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,12 @@ Such files are intermediate and not kept in the final files delivered to users.

Such files are intermediate and not kept in the final files delivered to users.

#### DRAGMAP

[DRAGMAP](https://github.com/Illumina/dragmap) is an open-source software implementation of the DRAGEN mapper, which the Illumina team created so that we would have an open-source way to produce the same results as their proprietary DRAGEN hardware.

Such files are intermediate and not kept in the final files delivered to users.

### Mark Duplicates

#### GATK MarkDuplicates
Expand Down
6 changes: 6 additions & 0 deletions modules.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,12 @@
"deepvariant": {
"git_sha": "c450b08a75cda8878876ccbbe42493d6774397bd"
},
"dragmap/align": {
"git_sha": "e745e167c1020928ef20ea1397b6b4d230681b4d"
},
"dragmap/hashtable": {
"git_sha": "e745e167c1020928ef20ea1397b6b4d230681b4d"
},
"ensemblvep": {
"git_sha": "e745e167c1020928ef20ea1397b6b4d230681b4d"
},
Expand Down
64 changes: 64 additions & 0 deletions modules/nf-core/modules/dragmap/align/main.nf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

42 changes: 42 additions & 0 deletions modules/nf-core/modules/dragmap/align/meta.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

36 changes: 36 additions & 0 deletions modules/nf-core/modules/dragmap/hashtable/main.nf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

30 changes: 30 additions & 0 deletions modules/nf-core/modules/dragmap/hashtable/meta.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions nextflow_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -204,10 +204,11 @@
"fa_icon": "fas fa-puzzle-piece",
"enum": [
"bwa-mem",
"bwa-mem2"
"bwa-mem2",
"dragmap"
],
"description": "Specify aligner to be used to map reads to reference genome.",
"help_text": "> **WARNING** Current indices for `bwa` in AWS iGenomes are not compatible with `bwa-mem2`.\n> Use `--bwa=false` to have `Sarek` build them automatically.\n\n> **WARNING** BWA-mem2 is in active development\n> Sarek might not be able to require the right amount of resources for it at the moment\n> We recommend to use pre-built indexes",
"help_text": "> **WARNING** Current indices for `bwa` in AWS iGenomes are not compatible with `bwa-mem2` and `dragmap`.\n> Use `--bwa=false` to have `Sarek` build them automatically.\n\n> **WARNING** BWA-mem2 is in active development\n> Sarek might not be able to require the right amount of resources for it at the moment\n> We recommend to use pre-built indexes",
"hidden": true
},
"markdup_java_options": {
Expand Down
7 changes: 6 additions & 1 deletion subworkflows/local/prepare_genome.nf
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@

include { BWA_INDEX as BWAMEM1_INDEX } from '../../modules/nf-core/modules/bwa/index/main'
include { BWAMEM2_INDEX } from '../../modules/nf-core/modules/bwamem2/index/main'
include { DRAGMAP_HASHTABLE } from '../../modules/nf-core/modules/dragmap/hashtable/main'
include { CREATE_INTERVALS_BED } from '../../modules/local/create_intervals_bed/main'
include { GATK4_CREATESEQUENCEDICTIONARY } from '../../modules/nf-core/modules/gatk4/createsequencedictionary/main'
include { MSISENSORPRO_SCAN } from '../../modules/nf-core/modules/msisensorpro/scan/main'
include { SAMTOOLS_FAIDX } from '../../modules/nf-core/modules/samtools/faidx/main'
Expand All @@ -33,8 +35,11 @@ workflow PREPARE_GENOME {

BWAMEM1_INDEX(fasta) // If aligner is bwa-mem
BWAMEM2_INDEX(fasta) // If aligner is bwa-mem2
DRAGMAP_HASHTABLE(fasta)
// if we use mix here, bwa becomes a channel that is comsumed
ch_bwa = params.aligner == "bwa-mem" ? BWAMEM1_INDEX.out.index : BWAMEM2_INDEX.out.index
ch_bwa = params.aligner == "bwa-mem" ?
BWAMEM1_INDEX.out.index : params.aligner == "dragmap" ?
DRAGMAP_HASHTABLE.out.hashmap : BWAMEM2_INDEX.out.index

GATK4_CREATESEQUENCEDICTIONARY(fasta)
MSISENSORPRO_SCAN(fasta.map{ it -> [[id:it[0].baseName], it] })
Expand Down
24 changes: 24 additions & 0 deletions tests/test_aligner.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,27 @@
- path: results/reports/qualimap/test/test.recal
- path: results/reports/samtools_stats/test/test.md.cram.stats
- path: results/reports/samtools_stats/test/test.recal.cram.stats
- name: Run dragmap
command: nextflow run main.nf -profile test,docker --aligner dragmap
tags:
- aligner
- dragmap
- preprocessing
files:
- path: results/multiqc
- path: results/preprocessing/test/markduplicates/test.md.cram
- path: results/preprocessing/test/markduplicates/test.md.cram.crai
- path: results/preprocessing/test/recal_table/test.recal.table
- path: results/preprocessing/test/recalibrated/test.recal.cram
- path: results/preprocessing/test/recalibrated/test.recal.cram.crai
- path: results/preprocessing/csv/markduplicates.csv
- path: results/preprocessing/csv/markduplicates_test.csv
- path: results/preprocessing/csv/markduplicates_no_table.csv
- path: results/preprocessing/csv/markduplicates_no_table_test.csv
- path: results/preprocessing/csv/recalibrated.csv
- path: results/preprocessing/csv/recalibrated_test.csv
- path: results/reports/fastqc/test-test_L1
- path: results/reports/qualimap/test/test.mapped
- path: results/reports/qualimap/test/test.recal
- path: results/reports/samtools_stats/test/test.md.cram.stats
- path: results/reports/samtools_stats/test/test.recal.cram.stats