[Biopython-dev] Re: Question to code

Iddo Friedberg idoerg at burnham.org
Wed Feb 16 12:39:05 EST 2005


Eirik,

It used to be a bug, but it shouldn't be anymore.
I'll check this later today. In the meantime, if you are still up, you may
want to retest this code with our latest CVS version.
http://biopython.org/cvs

Also, we are planning to roll a new Biopython (1.40) release Friday. So 
if you can wait until then... in any case, I'm
forwarding this to the developers list. I am not near a computer where I
can test this, and won't be for a few hours

Sorry for your trouble, but this is either solved or wil be solved soon.

Best,

Iddo

--
Iddo Friedberg, Ph.D.
The Burnham Institute
10901 N. Torrey Pines Rd.
La Jolla, CA 92037, USA
Tel: +1 (858) 646 3100 x3516
Fax: +1 (858) 646 3171
http://ffas.ljcrf.edu/~iddo
-------------------------------------
Automated Protein Function Prediction Meeting, June 24, 2005
http://ffas.burnham.org/AFP

On Wed, 16 Feb 2005, [ISO-8859-1] Eirik Sønneland wrote:

> Dear Freidberg,
> 
> I've been having problems parsing my output from NCBI using the example 
> code given in Biopython Cookbook. Therefore I tried to follow your code 
> described in "Genome Informatics 14(2003). Still I get an error message 
> connected to the parsing. Could you please give a hint on what is wrong? 
> Is this a bug?? Code and output as follows:
> 
> Code:
> 
> from Bio.Blast import NCBIWWW
> from Bio import Fasta
> 
> file_for_blast = open('Fastaformat.txt', 'r')
> f_iterator = Fasta.Iterator(file_for_blast)
> f_record = f_iterator.next()
> 
> b_results = NCBIWWW.blast('blastn', 'nr', f_record).read()
> 
> b_record = NCBIWWW.BlastParser().parse_str(b_results)
> 
> Output(Have cut out the beginning, only pasted the last part of output):
> 
> 
>  Score = 40.1 bits (20), Expect = 6.3
>  Identities = 20/20 (100%)
>  Strand = Plus / Minus
> 
>                                  
> Query: 29     ctgcagctcgggctcctgcc 48
>               ||||||||||||||||||||
> Sbjct: 150928 ctgcagctcgggctcctgcc 150909
> </PRE>
> 
> 
> <form>
> 
> <PRE>
> Lambda     K      H
>     1.37    0.711     1.31
> 
> Gapped
> Lambda     K      H
>     1.37    0.711     1.31
> 
> Matrix: blastn matrix:1 -3
> Gap Penalties: Existence: 5, Extension: 2
> Number of Sequences: 2894376
> Number of Hits to DB: 6,089,259
> Number of extensions: 328661
> Number of successful extensions: 6259
> Number of sequences better than 10.0: 2
> Number of HSP's better than 10.0 without gapping: 2
> Number of HSP's gapped: 6259
> Number of HSP's successfully gapped: 2
> Number of extra gapped extensions for HSPs above 10.0: 6255
> Length of query: 600
> Length of database: 13,294,103,689
> Length adjustment: 22
> Effective length of query: 578
> Effective length of database: 13,230,427,417
> Effective search space: 7647187047026
> Effective search space used: 7647187047026
> A: 0
> X1: 11 (21.8 bits)
> X2: 15 (30.0 bits)
> X3: 25 (50.0 bits)
> S1: 14 (25.0 bits)
> S2: 20 (40.1 bits)
> 
> 
> </form>
> 
> Traceback (most recent call last):
>   File "C:\Python24\MyWorkspace.py", line 50, in -toplevel-
>     b_record = NCBIWWW.BlastParser().parse_str(b_results)
>   File "C:\Python24\Lib\site-packages\Bio\ParserSupport.py", line 52, in 
> parse_str
>     return self.parse(File.StringHandle(string))
>   File "C:\Python24\Lib\site-packages\Bio\Blast\NCBIWWW.py", line 47, in 
> parse
>     self._scanner.feed(handle, self._consumer)
>   File "C:\Python24\Lib\site-packages\Bio\Blast\NCBIWWW.py", line 99, in 
> feed
>     self._scan_rounds(uhandle, consumer)
>   File "C:\Python24\Lib\site-packages\Bio\Blast\NCBIWWW.py", line 242, 
> in _scan_rounds
>     self._scan_alignments(uhandle, consumer)
>   File "C:\Python24\Lib\site-packages\Bio\Blast\NCBIWWW.py", line 322, 
> in _scan_alignments
>     raise SyntaxError, "Cannot resolve location at line:\n%s" % line1
> SyntaxError: Cannot resolve location at line:
> </form>
> 
>  >>>
> 
> Thanks!
> 
> Regards,
> Eirik
> 
> 





More information about the Biopython-dev mailing list