[Biopython] (no subject)

David Winter winda002 at student.otago.ac.nz
Wed May 27 01:18:57 UTC 2009


Stefanie Lück wrote:
 > Hi!
 >
 > Is there a way to get the query start information of the hit in the 
xml output?
 > Alternatively I can find the hit on the query

Hi Stefanie,

The query_start is in the "hsp" instance for each alignment in each
blast record, if you have a record called b_record you can do this:

 >>>for alignment in b_record.alignments:
 >>>    for hsp in alignment.hsps:
 >>>        print "hit '%s' matches query '%s' starting a query position 
%i"  % (alignment.title, b_record.query, hsp.query_start )
hit 'gene1' matches query 'my_query1' from query position 841
hit 'gene2' matches query 'my_query1' from query position 190

There is a nice diagram of all the 'stuff' in the blast record class in
the tutorial here:
http://www.biopython.org/DIST/docs/tutorial/Tutorial.html#fig:blastrecord

Hope that helps you do what you want to,
David



More information about the Biopython mailing list