layout | element | title | language |
---|---|---|---|
page |
notes |
Running BLAST |
Python |
from Bio.Blast import NCBIWWW, NCBIXML
number result_handle = NCBIWWW.qblast("blastn", "nr", "8332116")
blast_record = NCBIXML.read(result_handle)
E_VALUE_THRESH = 0.004 for alignment in blast_record.alignments: for hsp in alignment.hsps: if hsp.expect < E_VALUE_THRESH: print print 'Alignment' print 'sequence:', alignment.title print 'length:', alignment.length print 'e value:', hsp.expect print hsp.query[0:75] + '...' print hsp.match[0:75] + '...' print hsp.sbjct[0:75] + '...'