A quick guide to Diamond by Tommy Harding

1- Format database:

diamond  makedb --in <your_database_as_fasta_file> -d <output_file_prefix>


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


3- View results:

diamond view -o <output_file> -f tab -a <infile>
diamond view -o <output_file> -f 6 qseqid sseqid pident length mismatch gapopen qstart qend qlen sstart send slen evalue -a <infile>


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