Skip to content

Commit

Permalink
fix: condition checking for existence of merger model was inverted
Browse files Browse the repository at this point in the history
  • Loading branch information
rneher committed May 16, 2023
1 parent 13272fb commit 23f935f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions treetime/treetime.py
Original file line number Diff line number Diff line change
Expand Up @@ -816,9 +816,9 @@ def generate_subtree(self, parent):
# branches without mutations are ready to coalesce -- others have to mutate first
ready_to_coalesce = [b for b in branches_alive if mutations_per_branch.get(b.name,0)==0]
if hasattr(self, 'merger_model') and (self.merger_model is not None):
coalescent_rate = 0.5*len(ready_to_coalesce)*dummy_coalescent_rate + mutation_rate
else:
coalescent_rate = self.merger_model.branch_merger_rate(t) + mutation_rate
else:
coalescent_rate = 0.5*len(ready_to_coalesce)*dummy_coalescent_rate + mutation_rate

total_mutations = np.sum([mutations_per_branch.get(b.name,0) for b in branches_alive])
n_branches_w_mutations = len(branches_alive) - len(ready_to_coalesce)
Expand Down

0 comments on commit 23f935f

Please sign in to comment.