Applying a time-reversible nucleotide model

We display the available set of nucleotide substitution models.

from cogent3 import available_models

available_models("nucleotide")
Specify a model using 'Abbreviation' (case sensitive).
Model TypeAbbreviationDescription
nucleotideJC69Jukes and Cantor's 1969 model
nucleotideK80Kimura 1980
nucleotideF81Felsenstein's 1981 model
nucleotideHKY85Hasegawa, Kishino and Yano 1985 model
nucleotideTN93Tamura and Nei 1993 model
nucleotideGTRGeneral Time Reversible nucleotide substitution model.
nucleotidessGNstrand-symmetric general Markov nucleotide (non-stationary, non-reversible). Kaehler, 2017, Journal of Theoretical Biology 420: 144–51
nucleotideGNGeneral Markov Nucleotide (non-stationary, non-reversible). Kaehler, Yap, Zhang, Huttley, 2015, Sys Biol 64 (2): 281–93
nucleotideBHBarry and Hartigan Discrete Time substitution model Barry and Hartigan 1987. Biometrics 43: 261–76.
nucleotideDTDiscrete Time substitution model (non-stationary, non-reversible). motif_length=2 makes this a dinucleotide model, motif_length=3 a trinucleotide model.

10 rows x 3 columns

Using the GTR model

We specify the general time-reversible model (Lanave et al) by its abbreviation. By default, this model does not optimise the codon frequencies but uses the average estimated from the alignment. We configure the model to optimise the root motif probabilities.

from cogent3.app import io, evo

loader = io.load_aligned(format="fasta", moltype="dna")
aln = loader("data/primate_brca1.fasta")
model = evo.model(
    "GTR", tree="data/primate_brca1.tree", sm_args=dict(optimise_motif_probs=True)
)
result = model(aln)
result
GTR
keylnLnfpDLCunique_Q
'GTR'-6992.574119TrueTrue
result.lf

GTR

log-likelihood = -6992.5741

number of free parameters = 19

Global params
A/CA/GA/TC/GC/T
1.22965.24780.94722.33895.9666
Edge params
edgeparentlength
Galagoroot0.1727
HowlerMonroot0.0448
Rhesusedge.30.0215
Orangutanedge.20.0077
Gorillaedge.10.0025
Humanedge.00.0060
Chimpanzeeedge.00.0028
edge.0edge.10.0000
edge.1edge.20.0034
edge.2edge.30.0119
edge.3root0.0076
Motif params
ACGT
0.37920.17190.20660.2423