[BioPython] Syntax error while parsing Blast output

Michiel De Hoon mdehoon at c2b2.columbia.edu
Wed Oct 24 00:19:47 UTC 2007


> > Interestingly, the code I presented was taken directly from the 
> > BioPython cookbook (including the "while 1" bit).
> 
> So it is.  Michiel - do you fancy tweaking that section of the tutorial?

That part of the tutorial is in the section "Deprecated BLAST parsers", which
will be removed once the plain-text Blast parser is removed from Biopython.
The description of NCBIStandalone.blastall says

"This command will generate BLAST output in XML format, ..."

So this is being described correctly in the documentation.

Nevertheless, it may be a good idea to remove the plain text Blast parser
completely from Biopython in the upcoming release (which will probably be
done this week), to avoid further confusion.

--Michiel.



Michiel de Hoon
Center for Computational Biology and Bioinformatics
Columbia University
1150 St Nicholas Avenue
New York, NY 10032



-----Original Message-----
From: biopython-bounces at lists.open-bio.org on behalf of Peter
Sent: Tue 10/23/2007 6:48 PM
To: David Garfield; biopython at lists.open-bio.org
Subject: Re: [BioPython] Syntax error while parsing Blast output
 
David Garfield wrote:
> Thanks, Peter.  You've found the problem exactly.
> 
> Somewhere in the subsequent versions since that document was released, 
> the output of NCBIStandalone has changed from text to XML and the 
> NCBIStandalone Iterators and Parser either no longer seem to work with 
> the output of NCBIStandalone.blastall or there is an option not 
> mentioned in the Cookbook to ensure that the output is in text rather 
> than XML.

Biopython 1.43 switched the default from text to XML, because we really 
wanted to encourage people to use the XML output by default as 
maintaining the text format parser is such an ongoing maintainance 
effort.  The release notes did mention this, but it was bound to catch 
someone out.

There is an option to override this...

from Bio.Blast import NCBIStandalone
help(NCBIStandalone.blastall)

You need the align_view option (what the NCBI refers to as the alignment 
view), corresponding to the -m command line option of the NCBI blastall 
tool.  Biopython currently defaults to seven to get XML output.

alignment view options:
0 = pairwise,
1 = query-anchored showing identities,
2 = query-anchored no identities,
3 = flat query-anchored, show identities,
4 = flat query-anchored, no identities,
5 = query-anchored no identities and blunt ends,
6 = flat query-anchored, no identities and blunt ends,
7 = XML Blast output,
8 = tabular,
9 tabular with comment lines
10 ASN, text
11 ASN, binary [Integer]

Peter

_______________________________________________
BioPython mailing list  -  BioPython at lists.open-bio.org
http://lists.open-bio.org/mailman/listinfo/biopython





More information about the Biopython mailing list