DIAMOND is a program for high throughput pairwise alignment of DNA reads and protein sequences . 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.
- Buchfink, B., Xie, C., & Huson, D. H. (2015). Fast and sensitive protein alignment using DIAMOND. Nature methods, 12(1), 59-60.