[BioPython] Help for BLAST

Sameet Mehta sameet at nccs.res.in
Tue Jul 27 00:56:00 EDT 2004


Hi,
I want to do a NCBIWWW BLAST, from a set of files that i havve.  The 
sequences are in FASTA format.  The Blast Runs perfectly, however, i have 
problems parsing the output.  I am doing the following :

>>> from Bio import Fasta
>>> from Bio.Blast import NCBIWWW
>>> file_to_blast = open('C:\Sameet\Data\H9.txt', 'r')
>>> f_iterator = Fasta.Iterator(file_to_blast)
>>> f_record = f_iterator.next()
>>> b_result = NCBIWWW.qblast('blastn', 'nr', f_record, descriptions=20, 
alignments=20)
>>> b_parser = NCBIWWW.BlastParser()
>>> b_record = b_parser.parse(b_result)

I am getting the follwing error
Traceback (most recent call last):
  File "<pyshell#8>", line 1, in -toplevel-
    b_record = b_parser.parse(b_result)
  File "C:\Python23\lib\site-packages\Bio\Blast\NCBIWWW.py", line 47, in 
parse
    self._scanner.feed(handle, self._consumer)
  File "C:\Python23\lib\site-packages\Bio\Blast\NCBIWWW.py", line 101, in 
feed
    self._scan_rounds(uhandle, consumer)
  File "C:\Python23\lib\site-packages\Bio\Blast\NCBIWWW.py", line 244, in 
_scan_rounds
    self._scan_alignments(uhandle, consumer)
  File "C:\Python23\lib\site-packages\Bio\Blast\NCBIWWW.py", line 327, in 
_scan_alignments
    self._scan_pairwise_alignments(uhandle, consumer)
  File "C:\Python23\lib\site-packages\Bio\Blast\NCBIWWW.py", line 350, in 
_scan_pairwise_alignments
    self._scan_one_pairwise_alignment(uhandle, consumer)
  File "C:\Python23\lib\site-packages\Bio\Blast\NCBIWWW.py", line 381, in 
_scan_one_pairwise_alignment
    self._scan_alignment_header(uhandle, consumer)
  File "C:\Python23\lib\site-packages\Bio\Blast\NCBIWWW.py", line 419, in 
_scan_alignment_header
    raise SyntaxError, "I missed the Length in an alignment header"
SyntaxError: I missed the Length in an alignment header

Am i missing something or doing something wrong.  I need this information 
urgently.  

Regards
sameet

--
National Centre for Cell Science, Pune



More information about the BioPython mailing list