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

Added Minimap2 alignment #1486

Open
wants to merge 22 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 14 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: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,8 @@ jobs:
- tags: "gatk4spark/applybqsr"
- tags: "gatk4spark/markduplicates"
- tags: "gawk"
- tags: "minimap2/index"
- tags: "minimap2/align"
- tags: "mosdepth"
- tags: "multiqc"
- tags: "samblaster"
Expand Down
4 changes: 4 additions & 0 deletions CITATIONS.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,10 @@

> Chen X, Schulz-Trieglaff O, Shaw R, et al.: Manta: rapid detection of structural variants and indels for germline and cancer sequencing applications. Bioinformatics. 2016 Apr 15;32(8):1220-2. doi: 10.1093/bioinformatics/btv710. PubMed PMID: 26647377.

- [Minimap2](https://github.com/lh3/minimap2)

> Li, H. Minimap2: pairwise alignment for nucleotide sequences. Bioinformatics. 2018 May 10;34:3094-3100. doi:10.1093/bioinformatics/bty191. PubMed PMID: 29750242; PubMed Central PMCID: PMC6137996.

- [Mosdepth](https://academic.oup.com/bioinformatics/article/34/5/867/4583630)

> Brent S Pedersen, Aaron R Quinlan, Mosdepth: quick coverage calculation for genomes and exomes, Bioinformatics, Volume 34, Issue 5, 01 March 2018, Pages 867–868. doi: 10.1093/bioinformatics/btx699. PubMed PMID: 29096012. PubMed Central PMCID: PMC6030888.
Expand Down
2 changes: 1 addition & 1 deletion conf/base.config
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ process {
cpus = { check_max( 12 * task.attempt, 'cpus' ) }
memory = { check_max( 4.GB * task.attempt, 'memory' ) }
}
withName: 'BWAMEM1_MEM|BWAMEM2_MEM' {
withName: 'BWAMEM1_MEM|BWAMEM2_MEM|MINIMAP2_ALIGN' {
cpus = { check_max( 24 * task.attempt, 'cpus' ) }
memory = { check_max( 30.GB * task.attempt, 'memory' ) }
}
Expand Down
7 changes: 6 additions & 1 deletion conf/modules/aligner.config
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,16 @@ process {
ext.when = { params.aligner == 'dragmap' }
}

withName: 'MINIMAP2_ALIGN' {
ext.args = { "-ax sr -R ${meta.read_group}" }
ext.when = { params.aligner == 'minimap2' }
}

withName: 'SENTIEON_BWAMEM' {
ext.when = { params.aligner == 'sentieon-bwamem' }
}

withName: 'BWAMEM.*_MEM|DRAGMAP_ALIGN|SENTIEON_BWAMEM' {
withName: 'BWAMEM.*_MEM|DRAGMAP_ALIGN|MINIMAP2_ALIGN|SENTIEON_BWAMEM' {
ext.prefix = { params.split_fastq > 1 ? "${meta.id}".concat('.').concat(reads.get(0).name.tokenize('.')[0]) : "${meta.id}.sorted" }
publishDir = [
mode: params.publish_dir_mode,
Expand Down
11 changes: 11 additions & 0 deletions conf/modules/prepare_genome.config
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,17 @@ process {
]
}

withName: 'MINIMAP2_INDEX' {
ext.args = { "-x sr" }
ext.when = { !params.minimap2 && params.step == "mapping" && params.aligner == "minimap2" }
publishDir = [
mode: params.publish_dir_mode,
path: { "${params.outdir}/reference/minimap2" },
pattern: "*mmi",
saveAs: { params.save_reference || params.build_only_index ? it : null }
]
}

withName: 'MSISENSORPRO_SCAN' {
ext.when = { params.tools && params.tools.split(',').contains('msisensorpro') }
publishDir = [
Expand Down
5 changes: 5 additions & 0 deletions docs/output.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ The pipeline is built using [Nextflow](https://www.nextflow.io/) and processes d
- [BWA](#bwa)
- [BWA-mem2](#bwa-mem2)
- [DragMap](#dragmap)
- [Minimap2](#minimap2)
- [Sentieon BWA mem](#sentieon-bwa-mem)
- [Mark Duplicates](#mark-duplicates)
- [GATK MarkDuplicates (Spark)](#gatk-markduplicates-spark)
Expand Down Expand Up @@ -174,6 +175,10 @@ These files are intermediate and by default not placed in the output-folder kept

These files are intermediate and by default not placed in the output-folder kept in the final files delivered to users. Set `--save_mapped` to enable publishing, furthermore add the flag `save_output_as_bam` for publishing in BAM format.

### Minimap2

[Minimap2](https://github.com/lh3/minimap2) is a versatile pairwise aligner for genomic and spliced nucleotide sequences. The aligned reads are then coordinate-sorted (or name-sorted if [`GATK MarkDuplicatesSpark`](https://gatk.broadinstitute.org/hc/en-us/articles/5358833264411-MarkDuplicatesSpark) is used for duplicate marking) with [samtools](https://www.htslib.org/doc/samtools.html).

#### Sentieon BWA mem

Sentieon [bwa mem](https://support.sentieon.com/manual/usages/general/#bwa-mem-syntax) is a subroutine for mapping low-divergent sequences against a large reference genome. It is part of the proprietary software package [DNAseq](https://www.sentieon.com/detailed-description-of-pipelines/#dnaseq) from [Sentieon](https://www.sentieon.com/).
Expand Down
3 changes: 2 additions & 1 deletion docs/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -845,8 +845,9 @@ For GATK.GRCh38 the links for each reference file and the corresponding processe
| known_indels | BaseRecalibrator(Spark), FilterVariantTranches | [GATKBundle](https://console.cloud.google.com/storage/browser/_details/genomics-public-data/resources/broad/hg38/v0/) | |
| known_indels_tbi | BaseRecalibrator(Spark), FilterVariantTranches | [GATKBundle](https://console.cloud.google.com/storage/browser/_details/genomics-public-data/resources/broad/hg38/v0/) | |
| known_snps | BaseRecalibrator(Spark), FilterVariantTranches, VariantRecalibrator | [GATKBundle](https://console.cloud.google.com/storage/browser/_details/genomics-public-data/resources/broad/hg38/v0/) | |
| known_snps_tbi | BaseRecalibrator(Spark), FilterVariantTranches, VariantRecalibrator | [GATKBundle](https://console.cloud.google.com/storage/browser/_details/genomics-public-data/resources/broad/hg38/v0/) |
| known_snps_tbi | BaseRecalibrator(Spark), FilterVariantTranches, VariantRecalibrator | [GATKBundle](https://console.cloud.google.com/storage/browser/_details/genomics-public-data/resources/broad/hg38/v0/) | |
| mappability | ControlFREEC | http://xfer.curie.fr/get/vyIi4w8EONl/out100m2_hg38.zip | http://boevalab.inf.ethz.ch/FREEC/tutorial.html |
| minimap2 | Minimap2 | minimap2 -x sr -d ${fasta.baseName} $fasta | |
EgorGuga marked this conversation as resolved.
Show resolved Hide resolved
| pon | Mutect2 | [GATKBundle](https://console.cloud.google.com/storage/browser/_details/genomics-public-data/resources/broad/hg38/v0/) | https://gatk.broadinstitute.org/hc/en-us/articles/360035890631-Panel-of-Normals-PON- |
| pon_tbi | Mutect2 | [GATKBundle](https://console.cloud.google.com/storage/browser/_details/genomics-public-data/resources/broad/hg38/v0/) | https://gatk.broadinstitute.org/hc/en-us/articles/360035890631-Panel-of-Normals-PON- |

Expand Down
9 changes: 5 additions & 4 deletions main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ params.known_snps = getGenomeAttribute('known_snps')
params.known_snps_tbi = getGenomeAttribute('known_snps_tbi')
params.known_snps_vqsr = getGenomeAttribute('known_snps_vqsr')
params.mappability = getGenomeAttribute('mappability')
params.minimap2 = getGenomeAttribute('minimap2')
params.ngscheckmate_bed = getGenomeAttribute('ngscheckmate_bed')
params.pon = getGenomeAttribute('pon')
params.pon_tbi = getGenomeAttribute('pon_tbi')
Expand Down Expand Up @@ -160,11 +161,11 @@ workflow NFCORE_SAREK {
: PREPARE_GENOME.out.bwamem2
dragmap = params.dragmap ? Channel.fromPath(params.dragmap).map{ it -> [ [id:'dragmap'], it ] }.collect()
: PREPARE_GENOME.out.hashtable
minimap2 = params.minimap2 ? Channel.fromPath(params.minimap2).collect()
: PREPARE_GENOME.out.minimap2

// Gather index for mapping given the chosen aligner
index_alignment = (aligner == "bwa-mem" || aligner == "sentieon-bwamem") ? bwa :
aligner == "bwa-mem2" ? bwamem2 :
dragmap
index_alignment = (params.aligner == "bwa-mem" || params.aligner == "sentieon-bwamem") ? bwa :
params.aligner == "bwa-mem2" ? bwamem2 : params.aligner == "dragmap" ? dragmap : minimap2

// TODO: add a params for msisensorpro_scan
msisensorpro_scan = PREPARE_GENOME.out.msisensorpro_scan
Expand Down
10 changes: 10 additions & 0 deletions modules.json
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,16 @@
"git_sha": "8731a6221dd10fd9039e18518b390b43e14ef9ae",
"installed_by": ["modules"]
},
"minimap2/align": {
"branch": "master",
"git_sha": "72e277acfd9e61a9f1368eafb4a9e83f5bcaa9f5",
"installed_by": ["modules"]
},
"minimap2/index": {
"branch": "master",
"git_sha": "72e277acfd9e61a9f1368eafb4a9e83f5bcaa9f5",
"installed_by": ["modules"]
},
"mosdepth": {
"branch": "master",
"git_sha": "e0616fba0919adb190bfe070d17fb12d76ba3a26",
Expand Down
9 changes: 9 additions & 0 deletions modules/nf-core/minimap2/align/environment.yml

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

63 changes: 63 additions & 0 deletions modules/nf-core/minimap2/align/main.nf

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

75 changes: 75 additions & 0 deletions modules/nf-core/minimap2/align/meta.yml

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

Loading
Loading