Use an empirical protein substitution model

Section author: Gavin Huttley

This file contains an example of importing an empirically determined protein substitution matrix such as Dayhoff et al 1978 and using it to create a substitution model. The globin alignment is from the PAML distribution.

Make a tree object. In this case from a string.

Import the alignment, explicitly setting the moltype to be protein

Open the file that contains the empirical matrix and parse the matrix and frequencies.

The PamlMatrixParser will import the matrix and frequency from files designed for Yang’s PAML package. This format is the lower half of the matrix in three letter amino acid name order white space delineated followed by motif frequencies in the same order.

Create an Empirical Protein Matrix Substitution model object. This will take the unscaled empirical matrix and use it and the motif frequencies to create a scaled Q matrix.

Make a parameter controller, likelihood function object and optimise.