Jun 07, 2024

Public workspaceMapping ONT Reads to Reference Sequences with Minimap2 and Samtools

  • 1University of Nebraska-Lincoln
Open access
Protocol CitationHung Luong, Hiep Vu 2024. Mapping ONT Reads to Reference Sequences with Minimap2 and Samtools. protocols.io https://dx.doi.org/10.17504/protocols.io.4r3l2q98jl1y/v1
License: This is an open access protocol distributed under the terms of the Creative Commons Attribution License,  which permits unrestricted use, distribution, and reproduction in any medium, provided the original author and source are credited
Protocol status: Working
We use this protocol and it's working
Created: June 07, 2024
Last Modified: June 07, 2024
Protocol Integer ID: 101443
Abstract
This simple protocol maps ONT raw reads to Reference Sequences by Minimap2 and Samtools.
Install requirement software
Install requirement software
git clone https://github.com/lh3/minimap2 cd minimap2 && make
conda create -n samtools
conda activate samtools
conda config --add channels bioconda
conda config --add channels conda-forge
conda install -c bioconda samtools
Align reads to reference sequences (two options as bellow)
Align reads to reference sequences (two options as bellow)
# Without index reference sequence
minimap2 -ax map-ont /path/to/list/references.fasta /path/to/raw/reads.fastq.gz > /path/to/output/folder/alignment_reads.sam
# Index reference sequences first
minimap2 -d /path/to/index/references.mmi /path/to/reference/sequences/references.fasta
# Align reads to reference sequences with ONT reads
minimap2 -ax map-ont /path/to/list/references.fasta /path/to/raw/reads.fastq.gz > /path/to/output/folder/alignment_reads.sam
Keep only mapped reads
Keep only mapped reads
samtools view -bS -F 4 /path/to/output/folder/alignment_reads.sam > /path/to/mapped/reads.bam
Sort out the mapped reads
Sort out the mapped reads
samtools sort /path/to/mapped/reads.bam -o /path/to/mapped/reads_sort.bam
Convert mapped reads to FASTQ or FASTA file for downstream analysis
Convert mapped reads to FASTQ or FASTA file for downstream analysis
samtools fastq /path/to/mapped/reads_sort.bam > /path/to/mapped/reads_sort.fastq