Mapping ONT Reads to Reference Sequences with Minimap2 and Samtools

Hung Luong, Hiep Vu

Published: 2024-06-08 DOI: 10.17504/protocols.io.4r3l2q98jl1y/v1

Abstract

This simple protocol maps ONT raw reads to Reference Sequences by Minimap2 and Samtools.

Steps

Install requirement software

1.

git clone https://github.com/lh3/minimap2

cd minimap2 && make

2.

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)

3.

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

4.

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

5.

samtools view -bS -F 4 /path/to/output/folder/alignment_reads.sam > /path/to/mapped/reads.bam

Sort out the mapped reads

6.

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

7.

samtools fastq /path/to/mapped/reads_sort.bam > /path/to/mapped/reads_sort.fastq

推荐阅读

Nature Protocols
Protocols IO
Current Protocols
扫码咨询