Mapping ONT Reads to Reference Sequences with Minimap2 and Samtools
Hung Luong, Hiep Vu
Abstract
This simple protocol maps ONT raw reads to Reference Sequences by Minimap2 and Samtools.
Steps
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)
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
samtools view -bS -F 4 /path/to/output/folder/alignment_reads.sam > /path/to/mapped/reads.bam
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
samtools fastq /path/to/mapped/reads_sort.bam > /path/to/mapped/reads_sort.fastq