Skip to content

Commit

Permalink
HSP uniqueness could fail in rare cases
Browse files Browse the repository at this point in the history
Add evalue to uniqueness constraint to prevent rare cases where the existing keys were not enough to guarantee uniqueness.

Users could also filter input hits to a lower evalue and prevent this issue.
  • Loading branch information
ljyanesm committed Nov 9, 2021
1 parent e9e9a0f commit 627da29
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Mikado/serializers/blast_serializer/hsp.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ class Hsp(DBBASE):
"counter", "query_id", "target_id", unique=True)
uni_constraint = UniqueConstraint("query_id", "target_id",
"query_hsp_start", "query_hsp_end",
"target_hsp_start", "target_hsp_end")
"target_hsp_start", "target_hsp_end", "hsp_evalue")

__table_args__ = (pk_constraint, query_index, target_index, combined_index, hsp_evalue_index, uni_constraint)

Expand Down

0 comments on commit 627da29

Please sign in to comment.