Skip to content

Commit

Permalink
only skip dist est if containment/jaccard are 0 or 1 (#2060)
Browse files Browse the repository at this point in the history
  • Loading branch information
bluegenes authored May 20, 2022
1 parent 3827367 commit 1ba1e7c
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/sourmash/distance_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,10 +235,10 @@ def containment_to_distance(
"""
sol1, sol2, point_estimate = None, None, None
n_unique_kmers = handle_seqlen_nkmers(ksize, sequence_len_bp = sequence_len_bp, n_unique_kmers=n_unique_kmers)
if containment <= 0.0001:
# point_estimate = 1.0
if containment == 0:
#point_estimate = 1.0
point_estimate = sol1 = sol2 = 1.0
elif containment >= 0.9999:
elif containment == 1:
#point_estimate = 0.0
point_estimate = sol1 = sol2 = 0.0
else:
Expand Down Expand Up @@ -325,10 +325,10 @@ def jaccard_to_distance(
"""
error_lower_bound = None
n_unique_kmers = handle_seqlen_nkmers(ksize, sequence_len_bp=sequence_len_bp, n_unique_kmers=n_unique_kmers)
if jaccard <= 0.0001:
if jaccard == 0:
point_estimate = 1.0
error_lower_bound = 0.0
elif jaccard >= 0.9999:
elif jaccard == 1:
point_estimate = 0.0
error_lower_bound = 0.0
else:
Expand Down

0 comments on commit 1ba1e7c

Please sign in to comment.