[BioPython] More objects on BLAST parser

Kevin Berney kevin_berney at yahoo.com
Tue Jun 8 00:21:26 EDT 2004


Hello,
This one i think i can answer.


look at section 3.1.3 of 
http://biopython.org/docs/tutorial/Tutorial004.html#toc10

a more general answer however, revolces around using
the python command: dir() 

if you are running this from a python shell you can
look at the object b_record with the command

dir(b_record)

this should give you a list of all the objects
contained within the b_record class including the list
"alignments" looped through in the code below.

hmm. i'm going to say one more thing and then stop.  A
dir() of a builtin class is likely to be uninformative

dir(b_record.alignments) 

will return a listing of all objects in the builtin
list class.  However because it is a list of objects
of a non builtin type,

dir(b_records.alignments[0])

will return the dir of the first object in the list. 
This will include such things as the title, length and
list of hsps referenced below.

anyway, hopefully this was helpful,

Kevin Berney



--- Sebastian Bassi <sbassi at asalup.org> wrote:
> Hello,
> 
> I am working with this code:
> 
> from Bio.Blast import NCBIStandalone
> b_parser = NCBIStandalone.BlastParser()
>
bl=open("C:\\bioinfo-adv\\primervsclones\\MS1248-For","r")
> b_record= b_parser.parse(bl)
> for alignment in b_record.alignments:
>      for hsp in alignment.hsps:
>          print alignment.title
>          print alignment.length
>          print hsp.expect
> bl.close()
> 
> Works great. Now I need to know what other objects
> could I retrieve with 
> this parser. For example I'd like to retrieve:
> The lenght of the input/query sequence.
> The lenght of the hit sequence.
> The identities (like 20/21).
> The name of the query sequence.
> 
> Another question: Is there a way (looking at the
> source code) to know 
> all the available objects?
> 
> 
> -- 
> Best regards,
> 
> //=\ Sebastian Bassi - Diplomado en Ciencia y
> Tecnologia, UNQ   //=\
> \=// IT Manager Advanta Seeds - Balcarce Research
> Center -      \=//
> //=\ Pro secretario ASALUP - www.asalup.org - PGP
> key available //=\
> \=// E-mail: sbassi at genesdigitales.com - ICQ UIN:
> 3356556 -     \=//
> 
>                  http://Bioinformatica.info
> 
> _______________________________________________
> BioPython mailing list  -  BioPython at biopython.org
> http://biopython.org/mailman/listinfo/biopython



	
		
__________________________________
Do you Yahoo!?
Friends.  Fun.  Try the all-new Yahoo! Messenger.
http://messenger.yahoo.com/ 


More information about the BioPython mailing list