Skip to content

Commit

Permalink
fix: fix default value of clock-filter in run function and add check
Browse files Browse the repository at this point in the history
  • Loading branch information
rneher committed Mar 5, 2024
1 parent 8029942 commit 624653a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion treetime/treetime.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def run(self, raise_uncaught_exceptions=False, **kwargs):
sys.exit(2)


def _run(self, root=None, infer_gtr=True, relaxed_clock=None, clock_filter_method='residuals',
def _run(self, root=None, infer_gtr=True, relaxed_clock=None, clock_filter_method='residual',
n_iqd = None, resolve_polytomies=True, max_iter=0, Tc=None, fixed_clock_rate=None,
time_marginal='never', sequence_marginal=False, branch_length_mode='auto',
vary_rate=False, use_covariation=False, tracelog_file=None,
Expand Down Expand Up @@ -423,6 +423,8 @@ def clock_filter(self, reroot='least-squares', method='residual',
bad_branch_count = residual_filter(self, n_iqd)
elif method=='local':
bad_branch_count = local_filter(self, n_iqd)
else:
raise ValueError(f"TreeTime.clock_filter: unknown clock-filter method '{method}'. Implemented methods are: 'residual', 'local'")

if bad_branch_count>0.34*self.tree.count_terminals():
self.logger("TreeTime.clock_filter: More than a third of leaves have been excluded by the clock filter. Please check your input data.", 0, warn=True)
Expand Down

0 comments on commit 624653a

Please sign in to comment.