natsel_timehet – a test of branch heterogeneity

We employ codon models to test whether the mode of natural selection affecting human and chimpanzee lineages is distinctive. This is done by specifying the edges of interest (Yang 1998). (Note I’m setting optimise_motif_probs=False to speed up execution of the examples, not because it’s a good idea!)

from cogent3.app import io, evo

loader = io.load_aligned(format="fasta", moltype="dna")
aln = loader("data/primate_brca1.fasta")

hc_differ = evo.natsel_timehet(
    "GNC",
    tree="data/primate_brca1.tree",
    optimise_motif_probs=False,
    tip1="Human",
    tip2="Chimpanzee",
)
result = hc_differ(aln)
result
Statistics
LRdfpvalue
4.924810.0265
hypothesiskeylnLnfpDLCunique_Q
null'GNC-null'-6713.273323TrueTrue
alt'GNC-alt'-6710.810924TrueTrue
result.alt.lf

GNC-alt

log-likelihood = -6710.8109

number of free parameters = 24

Global params
A>CA>GA>TC>AC>GC>TG>AG>CG>TT>A
0.86203.53610.97901.66982.20596.26307.92091.22650.80241.2882
continuation
T>C
3.0675
Edge params
edgeparentlengthomega
Galagoroot0.52370.7906
HowlerMonroot0.13390.7906
Rhesusedge.30.06400.7906
Orangutanedge.20.02330.7906
Gorillaedge.10.00750.7906
Humanedge.00.01822.6351
Chimpanzeeedge.00.00852.6351
edge.0edge.10.00000.7906
edge.1edge.20.01000.7906
edge.2edge.30.03660.7906
edge.3root0.02380.7906
Motif params
AAAAACAAGAATACAACCACGACTAGAAGC
0.05560.02350.03440.05560.02280.00460.00080.02890.02310.0286
continuation
AGGAGTATAATCATGATTCAACACCAGCAT
0.01400.03810.01860.00700.01280.01920.01960.00520.02380.0221
continuation
CCACCCCCGCCTCGACGCCGGCGTCTACTC
0.01950.00620.00060.02630.00110.00090.00230.00320.01370.0078
continuation
CTGCTTGAAGACGAGGATGCAGCCGCGGCT
0.01250.01050.07550.01050.03030.03150.01580.00960.00140.0137
continuation
GGAGGCGGGGGTGTAGTCGTGGTTTACTAT
0.01610.00900.00670.01330.01480.00700.00690.02130.00230.0101
continuation
TCATCCTCGTCTTGCTGGTGTTTATTCTTG
0.02210.00820.00150.02510.00180.00400.02010.02120.00780.0108
continuation
TTT
0.0187