[BioPython] import Standalone problems
Peter
biopython at maubp.freeserve.co.uk
Tue Jul 18 20:40:26 UTC 2006
Rohini Damle wrote:
> Hi,
> I have a XML file with 4 blast records (for proteins P1, P2, P3, P4)
> I am trying to extract alignment information for each of them.
> So I wrote the following code:
>
> for b_record in b_iterator :
>
> E_VALUE_THRESH =20
> for alignment in b_record.alignments:
> for hsp in alignment.hsps:
> if hsp.expect< E_VALUE_THRESH:
>
> print '****Alignment****'
> print 'sequence:', alignment.title.split()[0]
>
> With this code, I am getting information for P1,
> then information for P1 + P2
> then for P1+P2 +P3
> and finally for P1+P2+P3+P4
> why this is so?
> is there something wrong with the looping?
I'm aware of something funny with the XML parsing, Bug 1970, which might
well be the same issue:
http://bugzilla.open-bio.org/show_bug.cgi?id=1970
I confess I haven't looked into exactly what is going wrong here - too
many other demands on my time to learn about XML and how BioPython
parses it.
Does the work around on the bug report help? Depending on which version
of standalone blast you have installed, you might have better luck with
plain text output - the trouble is this is a moving target and the NBCI
keeps tweaking it.
Peter
More information about the Biopython
mailing list