[BioPython] Problem to obtain Hit length parsing with NCBIXML

Gabino Sanchez-Perez Gabino.Sanchez-Perez at Dal.Ca
Wed Aug 15 08:23:26 EDT 2007


It works! I was confounded because I was looking for the length of the  
alignment (that now I see that is in hsp.sbjct) and I thought it was  
in alignment.length (Hit length).

Thank you very much for the help

Gabino

> This should work:
>
>>>> for alignment in brecord.alignments:
> ...      print alignment.length
>
> If it doesn't, please send us the exact code you are using, and the exact
> error message that you got.
>
> --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 Gabino Sanchez-Perez
> Sent: Tue 8/14/2007 7:57 PM
> To: biopython at lists.open-bio.org
> Subject: [BioPython] Problem to obtain Hit length parsing with NCBIXML
>
> Hi
>
> I'm parsing a blastp output in XML format using NCBIXML, but my problem is
> that
> I don't know how to get the Hit length (not alignment length), even though is
> defined in the parser:
>
>     def _end_Hit_len(self):
>         self._hit.length = int(self._value)
>
> So in my script when I iterate
>
>  for alignment in brecord.alignments:
>       for hsp in alignment.hits:
>
> it seems that is not defined and the error message is that hit.length does
> not
> exist.
>
> Thanks in advance
>
> Gabino
> _______________________________________________
> BioPython mailing list  -  BioPython at lists.open-bio.org
> http://lists.open-bio.org/mailman/listinfo/biopython
>
>






More information about the BioPython mailing list