Skip to content

Commit

Permalink
version bump for bug fix release
Browse files Browse the repository at this point in the history
  • Loading branch information
rneher committed Feb 9, 2020
1 parent 1f8bb25 commit 04a1ff8
Showing 3 changed files with 15 additions and 1 deletion.
13 changes: 13 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
# 0.7.3 -- bug fix in average rate calculation

This release fixes a problem that surfaced when inferring GTR models from trees of very similar sequences but quite a few gaps. This resulted in mutation counts like so:

A: [[ 0. 1. 8. 3. 0.]
C: [ 1. 0. 2. 7. 0.]
G: [ 9. 0. 0. 2. 0.]
T: [ 1. 23. 6. 0. 0.]
-: [46. 22. 28. 38. 0.]]

As a result, the rate "to gap" is inferred quite high, while the equilibrium gap fraction is low. Since we cap the equilibrium gap fraction from below to avoid reconstruction problems when branches are very short, this resulted in an average rate that had substantial contribution from and assumed 1% equilibrum gap frequency where gaps mutate at 20times the rate as others. Since gaps are ignored in distance calculations anyway, it is more sensible to exclude these transitions from the calculation of the average rate. This is now happening in line 7 of treetime/gtr.py. The average rate is restricted to mutation substitutions from non-gap states to any state.


# 0.7.2 -- weights in discrete trait reconstruction
This release implements a more consistent handling of weights (fixed equilibrium frequencies) in discrete state reconstruction.
It also fixes a number of problems in who the arguments were processed.
2 changes: 1 addition & 1 deletion treetime/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from __future__ import print_function, division, absolute_import
version="0.7.2"
version="0.7.3"

class TreeTimeError(Exception):
"""TreeTimeError class"""
1 change: 1 addition & 0 deletions treetime/wrappers.py
Original file line number Diff line number Diff line change
@@ -738,6 +738,7 @@ def reconstruct_discrete_traits(tree, traits, missing_data='?', pc=1.0, sampling
raise TreeTimeError("More than half of discrete states missing from the weights file")

unique_states=sorted(unique_states)
# note that gap character '-' is chr(45) and will never be included here
alphabet = [chr(65+i) for i,state in enumerate(unique_states) if state!=missing_data]
letter_to_state = {a:unique_states[i] for i,a in enumerate(alphabet)}

0 comments on commit 04a1ff8

Please sign in to comment.