Skip to content

Commit

Permalink
ensure probability of gene in bmr_pmf is nonzero to avoid computing l…
Browse files Browse the repository at this point in the history
…og(0) and encountering warning
  • Loading branch information
ashuaibi7 committed Dec 4, 2024
1 parent 77cca09 commit 0eba595
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/dialect/models/gene.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def compute_log_likelihood(self, pi):
log_likelihood = sum(
np.log(self.bmr_pmf.get(c, 0) * (1 - pi) + self.bmr_pmf.get(c - 1, 0) * pi)
for c in self.counts
if c in self.bmr_pmf
if c in self.bmr_pmf and self.bmr_pmf[c] > 0
)
return log_likelihood

Expand Down

0 comments on commit 0eba595

Please sign in to comment.