This is a test version of Biostars. For the public version, visit https://www.biostars.org.
BLAST multiple sequences against each other from one FASTA file

Hi,

I am a beginner to using BLAST locally on Mac OSX. I have downloaded ncbi-blast-2.2.31+.dmg and have installed it. I have a FASTA file with multiple protein sequences in it and am trying to BLAST each sequence against every other sequence within that FASTA file as I am looking for duplicates. I am also a beginner to programming and am struggling to get my head around using the Terminal. I'm not really sure where to start. I've tried making a BLAST db from my FASTA file using

makeblastdb -in sequence.fasta -dbtype prot -out sequence -title -sequence

and it seems to have worked but I can't find the results anywhere.

I'm not even sure this is the right path to take.

Can anyone please help set me on the right path?

Keely

fasta blast protein

Hey

How did you make blast db

1 answer

Once your blast database was created, you just have to run blastp the original fasta against the compiled database.

blastp -query sequence.fasta -db sequence -out result

Thanks Pierre, but when I try to do the blastp this is what I get:

blastp -query sequence.fasta -db sequence
BLAST Database error: No alias or index file found for protein database [sequence] in search path [/usr/local/ncbi/blast/bin::]

When I do:

blastp -query sequence.fasta -db sequence -out result

I get:

Command line argument error: Argument "out". File is not accessible:  `result'

Here is how my note on BLAST run,

Make a directory, enter the directory. Keep database file and input file inside it.

  1. Make index files for the database : makeblastdb -in indica.fasta -dbtype prot -out indica
  2. Blast your sequence against the database: blastp -query japonia.txt -db indica -out alignment.txt -outfmt 7

I made the database as follows:

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

Building a new DB, current time: 10/04/2015 18:20:03
New DB name:   /usr/local/ncbi/blast/bin/sequence
New DB title:  sequence.fasta
Sequence type: Protein
Keep Linkouts: T
Keep MBits: T
Maximum file size: 1000000000B

Adding sequences from FASTA; added 227 sequences in 0.0208449 seconds.

I then created a alignment.rtf file from textEdit and then tried to blast my sequence against the database and I get the same problem:

blastp -query sequence.fasta -db sequence -out alignment.rtf -outfmt 7
BLAST Database error: No alias or index file found for protein database [sequence] in search path [/usr/local/ncbi/blast/bin::]

specify full path to blast databse you just created

best practive is to put database files into ./db directory - in your case into /usr/local/ncbi/blast/db

  1. mkdir /usr/local/ncbi/blast/db
  2. makeblastdb -in sequence.fasta -dbtype prot -out /usr/local/ncbi/blast/db/sequence
  3. blastp -query sequence.fasta -db /usr/local/ncbi/blast/db/sequence

I tried making a directory called db to store the database, but it won't let me even though I have full administrator rights:

mkdir /usr/local/ncbi/blast/db
mkdir: /usr/local/ncbi/blast/db: Permission denied

Ok, then try to create directory in the home

mkdir -p ~/blast/db
makeblastdb -in sequence.fasta -dbtype prot -out ~/blast/db/sequence
blastp -query sequence.fasta -db ~/blast/db/sequence

Thank you! I think I've got it working now :)

Log in to answer this question.