[BioPython] Parsing BLAST

C. G. cg5x6 at yahoo.com
Wed Aug 27 17:27:54 UTC 2008




--- On Wed, 8/27/08, Alex Garbino <agarbino at gmail.com> wrote:

> From: Alex Garbino <agarbino at gmail.com>
> Subject: [BioPython] Parsing BLAST
> To: biopython at lists.open-bio.org
> Date: Wednesday, August 27, 2008, 11:12 AM
> Hello,
> 
> I'm following the tutorials to do BLAST queries,
> however, I can't get
> the Blast object to work.
> 
> I've downloaded the blast search, saved it in XML, etc,
> as the
> tutorial does. However, when I get to the step where
> I'm trying to get
> actual data out, it fails (the for loops part).
> Here is a simplified version that illustrates the problem:
> 
> for x in blast_record.alignments:
>     print alignment.title
> 
> Traceback (most recent call last):
>   File "<input>", line 2, in <module>
> NameError: name 'alignment' is not defined
> 
> -----------------------

It's a Python coding error. Try:

     print x.title

Or change the name of your variable in the "for" loop to "alignment".



      



More information about the Biopython mailing list