Making blast databases from fasta

makeblastdb -dbtype prot -in sequence_name.fasta

This script will return three files:

sequence_name.fasta.phr

sequence_name.fasta.pin

sequence_name.fasta.psq

You can then blastx your raw DNA reads against this database to pull out matches (with a custom script):

/project/directory/blast/launch_blast.py -1 RawReads_R1.fq -2 RawReads_R2.fq -b blastx -d /project/directory/blast/sequence_name.fasta

– before extracting matches based on significance (e-value, length, score). The extracted reads are then used to assemble the gene of interest ‘de novo’.

However, I recently tried running a script for blastx against newly made db files and kept returning the error:

BLAST Database error: No alias or index file found for protein database [/project/directory/sequence.fasta] in search path [/project/directory/::]

I was confused as this has been working up previously. After much wasted time I realised that I had changed my script to include the database name to:

makeblastdb -dbtype prot -in sequence_name.fasta -out sequence_name

This output db files named

sequence_name.phr

sequence_name.pin

sequence_name.psq

NB: The name of the database files did not include the .fasta

Hence blastx could not find my files.

 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s