I am trying to create a script using biopython to parse the HIT_def identifier from NCBI tblastn. Not sure how to get the HIT_def into python. Attached is the xml and python code
result_handle = open("/Users/XCX/conesnail.xml")
from Bio.Blast import NCBIXML
blast_records = list(NCBIXML.parse(result_handle))
E_VALUE_THRESH = 0.01
for hit in "hit_def:"
if hsp.expect < E_VALUE_THRESH:
print('Identifier:', alignment.title)
The target ID maybe what I want. I have a list of peptides converted from the fasta reference file and each has an ID that matches the "Hit_def" attribute in the xml file that is output by tBLASTn. I want to get that attribute and print it to a text file so that ID can be compared to an excel spreadsheet containing all the peptides.
Its great you've provided a sample input file, but what do you want exactly as the output?
The target ID maybe what I want. I have a list of peptides converted from the fasta reference file and each has an ID that matches the "Hit_def" attribute in the xml file that is output by tBLASTn. I want to get that attribute and print it to a text file so that ID can be compared to an excel spreadsheet containing all the peptides.