Rate Matrix Scaling

PalantiR scales codon substitution rates to assign particular meanings to branches on a phylogeny.

Scaling types

There are four scaling schemes implemented:

  • synonymous is the default scaling. This forces the branch length to be proportional to the expected number of synonymous substitutions per site.
  • non-synonymous scaling forces the branch length to be equivalent to the expected number of non-synonymous substitutions per site.
  • substitution scaling forces the branch length to be equivalent to the expected number of both types of substitutions per site.
  • none can be specified to leave the substitution rates unscaled.

Scaling type is specified as an optional parameter to substitution model constructors, e.g.:

use_genetic_code("Standard nuclear")
MutationSelection(..., scaling_type = "synonymous")

Implementation

Scaling rate is calculated as:

\[ S(Q, \pi, t) = \sum \sum_{ij}\pi_i Q_{ij}^{(t)} \]

  • \(Q\) is the substitution rate matrix
  • \(\pi\) is the equilibrium distribution for \(Q\)
  • \(t\) is the scaling type (outlined above)

The inner summation is over all the substitutions from each state (codon) \(i\) to each state \(j\). \(Q^{(t)}\) means substitution rate for a substitution of type \(t\) (e.g. synonymous substitution).

At equilibrium the identity is exact: with the default synonymous scaling, a branch of length one carries one expected synonymous substitution per codon. On branches where the model changes and the process is temporarily out of equilibrium, the branch-length currency is maintained by the rescaling machinery described in Temporal Heterogeneity Rescaling.