[BioPython] blast for more than one sequence

Peter (BioPython List) biopython at maubp.freeserve.co.uk
Wed Jul 26 15:51:03 UTC 2006


Muthuraman, Manickam wrote:
> 
> hai all
> 
> I have tried to blast through the internet, i can suceed with one
> sequence but i need to blast more than one sequences through
> internet.

I think you can only blast one sequence at a time.  If you really want
to do many at once, then I personally would use standalone blast and
give it the fasta file as input.

 > for example
 > m_cold.fasta has 5 sequences but the code which is been stated in book
 > can do only for the first sequence and rest it does not
 >
 > file_for_blast=open('m_cold.fasta','r')
 > f_iterator=Fasta.Iterator(file_for_blast)
 > #does the above line loop through the file and get each sequence for
 > blasting, if so let me know how

You could use the iterator to get each FASTA sequence in turn, and run a
separate blast for it.  Something like this...

from Bio import Fasta
from Bio.Blast import NCBIWWW

file_for_blast=open('m_cold.fasta','r')
f_iterator=Fasta.Iterator(file_for_blast)
for f_record in f_iterator :
     #do blast with f_record...
     #using NCBIWWW.qblast('blastn', 'nr', f_record)

Peter



More information about the Biopython mailing list