Skip to content

Commit

Permalink
Merge branch 'development'
Browse files Browse the repository at this point in the history
  • Loading branch information
Luca Venturini authored and Luca Venturini committed Oct 7, 2015
2 parents caf2165 + 8636ff8 commit 9aeda78
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
4 changes: 1 addition & 3 deletions mikado_lib/loci_objects/transcript.py
Original file line number Diff line number Diff line change
Expand Up @@ -1271,9 +1271,7 @@ def __recalculate_hit(self, hit, boundary):
pass
else:
hsp_dict_list.append(hsp)
if (hsp["hsp_evalue"] < best_hsp[0] or
(hsp["hsp_evalue"] == best_hsp[0] and
hsp["hsp_bits"] > best_hsp[1])):
if (hsp["hsp_evalue"] < best_hsp[0]):
best_hsp = (hsp["hsp_evalue"], hsp["hsp_bits"])

q_intervals.append((hsp["query_hsp_start"], hsp["query_hsp_end"]))
Expand Down
11 changes: 6 additions & 5 deletions mikado_lib/serializers/blast_serializer.py
Original file line number Diff line number Diff line change
Expand Up @@ -1060,9 +1060,7 @@ def prepare_hit(cls, hit, query_id, target_id, **kwargs):
hsp_dict["hsp_length"] = hsp.align_length
hsp_dict["hsp_bits"] = hsp.bits
hsp_dict["hsp_evalue"] = hsp.expect
if (hsp_dict["hsp_evalue"] < best_hsp[0] or
(hsp_dict["hsp_evalue"] == best_hsp[0] and
hsp_dict["hsp_bits"] > best_hsp[1])):
if (hsp_dict["hsp_evalue"] < best_hsp[0]):
best_hsp = (hsp_dict["hsp_evalue"], hsp_dict["hsp_bits"])

hsp_dict["query_id"] = query_id
Expand All @@ -1086,7 +1084,10 @@ def prepare_hit(cls, hit, query_id, target_id, **kwargs):
hit_dict["target_end"] = t_merged_intervals[-1][1]
hit_dict["global_identity"] = len(identical_positions) * 100 / q_aligned
hit_dict["global_positives"] = len(positives) * 100 / q_aligned
assert hit_dict["evalue"] == best_hsp[0]
assert hit_dict["bits"] == best_hsp[1]
if hit_dict["evalue"] != best_hsp[0] or hit_dict["bits"] != best_hsp[1]:
raise ValueError("Discrepant evalue/bits for hsps and hit; best: {0}, reported {1}".format(
best_hsp,
(hit_dict["evalue"], hit_dict["bits"])
))

return hit_dict, hsp_dict_list

0 comments on commit 9aeda78

Please sign in to comment.