[BioPython] Parser

Peter biopython at maubp.freeserve.co.uk
Wed Feb 20 12:22:48 UTC 2008


On Wed, Feb 20, 2008 at 7:40 AM, smriti Sebastian
<smriti.sebastuan at gmail.com> wrote:
> dir(line) is not giving descriptions in it.But if we check the
> NCBIStandalone.py file it has an attribute called descriptions.
> I am attaching the file

The b_record object is a Bio.Blast.Record.PSIBlast instance, which has
different attributes to the "normal blast" object.  In particular, the
list "rounds" of Bio.Blast.Record.Round objects, and the
boolean/integer "converged".  Try:

help(Bio.Blast.Record.PSIBlast)
help(Bio.Blast.Record.Round)

I'm not sure exactly what you want to achieve, but perhaps something
like this would be a start:

#!usr/bin/python
fh=open('psi_out','r')
import Bio
from Bio.Blast import *
import Bio.Blast.NCBIStandalone
b_parser=Bio.Blast.NCBIStandalone.PSIBlastParser()
b_record=b_parser.parse(fh)

E_VALUE_THRESH=0.04
for round in b_record.rounds:
    print round
    for aln in round.alignments :
        print aln

Peter



More information about the Biopython mailing list