User Tools

Site Tools


diamond_blast

A quick guide to Diamond by Tommy Harding

1- Format database:

diamond  makedb --in <your_database_as_fasta_file> -d <output_file_prefix>
  • This will create a file with extension dmnd.


2- Run diamond:

diamond blastp --threads 8 -d <database> -q <query_file> -a <output_file_as_DIAMOND_alignment_archive> --salltitles --max-target-seqs 2000 --evalue 0.00001 --more-sensitive
  • Name the output file with the extension daa (DIAMOND alignment archive).


3- View results:

diamond view -o <output_file> -f tab -a <infile>
  • <infile> here is the DIAMOND alignment archive file created at step 2.
  • Name the output file with the extension tsv.
  • Alternatively, you can specify the information to list in the tabular output like this:
diamond view -o <output_file> -f 6 qseqid sseqid pident length mismatch gapopen qstart qend qlen sstart send slen evalue -a <infile>
  • I like to have the lengths of the query and subject sequences (qlen and slen respectively) which is not included in the default tabular format.


Steps 2 and 3 can be gathered in the same shell script. For example:

#!/bin/bash
#$ -S /bin/bash
. /etc/profile
#$ -o diamond_nr.out
#$ -e diamond_nr.err
#$ -cwd
#$ -pe threaded 8
diamond blastp --threads 8 -d <database> -q <query_file> -a <output_file> --salltitles --max-target-seqs 2000 --evalue 0.00001 --more-sensitive
diamond view -o <output_file> -f tab -a <infile>

For help:

diamond --help
diamond_blast.txt · Last modified: by 129.173.94.20