Skip to content
Snippets Groups Projects
Commit 3afd902d authored by Bienchen's avatar Bienchen
Browse files

Handling non-matching hits in BLAST

parent 01aae1eb
Branches
Tags
No related merge requests found
...@@ -83,7 +83,13 @@ def ParseBlastOutput(string, seqid_thres=0, evalue_thres=float("infinity")): ...@@ -83,7 +83,13 @@ def ParseBlastOutput(string, seqid_thres=0, evalue_thres=float("infinity")):
bit_score=float(_GetValue(hsp, 'Hsp_bit-score')) bit_score=float(_GetValue(hsp, 'Hsp_bit-score'))
score=float(_GetValue(hsp, 'Hsp_score')) score=float(_GetValue(hsp, 'Hsp_score'))
evalue=float(_GetValue(hsp, 'Hsp_evalue')) evalue=float(_GetValue(hsp, 'Hsp_evalue'))
identity=float(_GetValue(hsp, 'Hsp_identity')) try:
identity=float(_GetValue(hsp, 'Hsp_identity'))
except AssertionError:
# The Hsp_identity tag is not a 'must' in the BLAST XML format. It
# describes the number of matching characters. Hence we assume, if it is
# missing, there are 0 matches.
identity=0
hsp_align_len=float(_GetValue(hsp, 'Hsp_align-len')) hsp_align_len=float(_GetValue(hsp, 'Hsp_align-len'))
seqid=identity/hsp_align_len seqid=identity/hsp_align_len
query_offset=_GetInt(hsp, 'Hsp_query-from')-1 query_offset=_GetInt(hsp, 'Hsp_query-from')-1
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment