Aligning DNA reads against a local database using DIAMOND

2 mins read
pairwise alignment using DIAMOND

DIAMOND is a program for high throughput pairwise alignment of DNA reads and protein sequences [1]. It is used for the high-performance analysis of large sequence data. In this article, we will make a local database of protein sequences and align protein sequences against the reference database.

Creating a reference database

Keep all FASTA sequences in a file, let’s name it as ‘db.fa’. Now make a reference database of these sequences using the following command.

$ diamond makedb --in db.fa -d nr_db

Here, -d defines the output DIAMOND database file.

If you wish to provide taxonomy features as well, then you can use the following arguments.

--taxonmap <gzip file> to map NCBI protein accession numbers to taxon ids. The gzip file can be downloaded from here.

--taxonnodes <gzip file> to map taxon nodes. The gzip file can be downloaded from here.

--taxonnames <gzip file> to map taxon names. The gzip file can be downloaded from here.

Now, the reference database is created as ‘nr_db.dmnd’.

Aligning DNA reads

Save all DNA reads in FASTA format, let’s name it as ‘dna_reads.fna’. Align the DNA reads pairwise using the ‘blastx’ module of DIAMOND. If you are aligning protein sequences, then use ‘blastp’ instead of ‘blastx’.

$ diamond blastx -d nr_db -q dna_reads.fna -o aligned_reads.m8 --sensitive --outfmt 0

The default output is the BLAST tabular format. You can set the output format, go through the command line options mentioned here. You can set the sensitivity, output format, gap penalty, and other parameters.


  1. Buchfink, B., Xie, C., & Huson, D. H. (2015). Fast and sensitive protein alignment using DIAMOND. Nature methods12(1), 59-60.
Muniba is a Bioinformatician based in the South China University of Technology. She has cutting edge knowledge of bioinformatics tools, algorithms, and drug designing. When she is not reading she is found enjoying with the family. Know more about Muniba

Leave a Reply

Installing galaxy on Ubuntu
Previous Story

Installing GalaxyPepDock & Galaxy-Server on Ubuntu

MAIRA-metagenomics analysis
Next Story

MAIRA: New Program for Metagenomic Sequencing Data Analysis

Latest from Sequence Analysis

0 $0.00