From 23f935fb6be29864c788108d5ab9ab1fccb3823d Mon Sep 17 00:00:00 2001 From: Richard Neher Date: Tue, 16 May 2023 15:42:58 +0200 Subject: [PATCH] fix: condition checking for existence of merger model was inverted --- treetime/treetime.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/treetime/treetime.py b/treetime/treetime.py index 1ce20bd2..fdcb2ae5 100644 --- a/treetime/treetime.py +++ b/treetime/treetime.py @@ -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)