[Biopython] Tutorial Question 7.4 alignment.title

Ara Kooser akooser at unm.edu
Fri Oct 8 03:06:00 UTC 2010


Hello all,

   I am a new user to Biopython. I've been working my way through the  
tutorial. I have a question about how the alignment.title works in the  
example given in section 7.4 of the tutorial. I wrote the following  
code:

from Bio.Blast import NCBIXML

E_VALUE_THRESH = 1e-30

result_handle = open("test.xml")
blast_records = NCBIXML.parse(result_handle)
blast_record = blast_records.next()

for alignment in blast_record.alignments:
      for hsp in alignment.hsps:
          if hsp.expect < E_VALUE_THRESH:
              print '****Alignment****'
              print 'sequence:', alignment.title
              print 'e value:', hsp.expect
              print 'length:', alignment.length
              print 'start:', hsp.query_start
              print 'end:',hsp.query_end

To look at a .xml file that was produced by BLAST. I was wondering if  
there was a way to break up the string for information produced by the:

              print 'sequence:', alignment.title

Basically I would like the organisms name first, followed by the locus  
number. I wasn't sure how to split up the print command.

I looked at the docs over at http://biopython.org/DIST/docs/api/ to  
see if there was a tag specifically for the locus number and organism  
name.

Thank you for your time and help.

Regards,
Ara 



More information about the Biopython mailing list