You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After reproducing nextstrain/augur#1032@corneliusroemer and I found that the issue was during _ml_t_joint. An internal node was suggested time points that were out of bounds of pre-calculated interpolation objects (integral_merger_rate, total_merger_rate). These time points were obtained from msgs_to_multiply and were outside of the x -axis upper bound for the interpolation objects. The upper bound of the interpolation objects integral_merger_rate and total_merger_rate was predefined using ttconf.BIG_NUMBER.
To avoid further out of bounds errors we introduced a new constant value BIGGEST_NUMBER = sys.float_info.max to use as an upper bound for the interpolation objects. We don't think that altering this range will have any numerical impact but please let us know if we have overlooked something @rneher.
Yes - we discovered it was actually due to not enough error handling in the clock_tree module. Due to too little data the calculation of the slope self.clock_model['slope'] was inaccurate (in this case negative), this was using during calc_rate_susceptibility and caused an error. We would need to add error handling for this case. However, you thought it might still make sense to raise this upper bound. But I can close this and make a new PR for that specific case if you no longer think raising the upper bound would be needed.
I have a case where this is 100% reproducible and it may be completely my fault. This is a small sample of sequences within a small time window (jan - may 2020).
The error looks like
6.67 ###TreeTime.run: ITERATION 2 out of 2 iterations
Traceback (most recent call last):
File "/home/michaeljon/.local/lib/python3.10/site-packages/treetime/treetime.py", line 57, in run
return self._run(**kwargs)
File "/home/michaeljon/.local/lib/python3.10/site-packages/treetime/treetime.py", line 332, in _run
self.calc_rate_susceptibility(params=tt_kwargs)
File "/home/michaeljon/.local/lib/python3.10/site-packages/treetime/clock_tree.py", line 874, in calc_rate_susceptibility
self.make_time_tree(**params)
File "/home/michaeljon/.local/lib/python3.10/site-packages/treetime/clock_tree.py", line 376, in make_time_tree
self._ml_t_joint()
File "/home/michaeljon/.local/lib/python3.10/site-packages/treetime/clock_tree.py", line 448, in _ml_t_joint
msgs_to_multiply.append(self.merger_model.node_contribution(node, time_points))
File "/home/michaeljon/.local/lib/python3.10/site-packages/treetime/merger_models.py", line 239, in node_contribution
y = (self.integral_merger_rate(t) - np.log(self.total_merger_rate(t)))*multiplicity
File "/home/michaeljon/.local/lib/python3.10/site-packages/scipy/interpolate/_polyint.py", line 80, in __call__
y = self._evaluate(x)
File "/home/michaeljon/.local/lib/python3.10/site-packages/scipy/interpolate/_interpolate.py", line 752, in _evaluate
below_bounds, above_bounds = self._check_bounds(x_new)
File "/home/michaeljon/.local/lib/python3.10/site-packages/scipy/interpolate/_interpolate.py", line 786, in _check_bounds
raise ValueError("A value ({}) in x_new is above "
ValueError: A value (10034530945.479671) in x_new is above the interpolation range's maximum value (10000000000.0).
ERROR: A value (10034530945.479671) in x_new is above the interpolation range's maximum value (10000000000.0).
ERROR in TreeTime.run: An error occurred which was not properly handled in TreeTime. If this error persists, please let us know by filing a new issue including the original command and the error above at: https://github.com/neherlab/treetime/issues
ERROR from TreeTime: An error occurred in TreeTime (see above). This may be due to an issue with TreeTime or Augur.
Please report you are calling TreeTime via Augur.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
After reproducing nextstrain/augur#1032 @corneliusroemer and I found that the issue was during
_ml_t_joint. An internal node was suggested time points that were out of bounds of pre-calculated interpolation objects (integral_merger_rate,total_merger_rate). These time points were obtained frommsgs_to_multiplyand were outside of the x -axis upper bound for the interpolation objects. The upper bound of the interpolation objectsintegral_merger_rateandtotal_merger_ratewas predefined usingttconf.BIG_NUMBER.To avoid further out of bounds errors we introduced a new constant value
BIGGEST_NUMBER = sys.float_info.maxto use as an upper bound for the interpolation objects. We don't think that altering this range will have any numerical impact but please let us know if we have overlooked something @rneher.Resolves nextstrain/augur#1032