Entering edit mode
2.8 years ago
Sasha
▴
10
Greetings, I am trying to parse by Blast results using "NCBIXML.parse", however when i run it it only analysis few results and not the whole file. If anybody knows the solution to it I would really appreciate it.
from Bio.Blast import NCBIXML
E_VALUE_THRESH = 1
with open("Coilia_nasus_results.xml","r") as result:
records= NCBIXML.parse(result)
item=next(records)
for alignment in item.alignments:
for hsp in alignment.hsps:
if hsp.expect < E_VALUE_THRESH:
print('****Alignment****')
print('sequence:', item.query)
print('length:', alignment.length)
print("e value:", hsp.expect)
print('score:', hsp.score)
print('gaps:', hsp.gaps)
print(hsp.sbjct)