natsel_neutral – a test for selective neutrality#

Note

These docs now use the new_type core objects via the following setting.

import os

# using new types without requiring an explicit argument
os.environ["COGENT3_NEW_TYPE"] = "1"

We employ codon models to test hypotheses regarding the mode of natural selection that has operated on a gene.

Noting that ω (omega) is the ratio of nonsynonymous substitutions to synonymous substitutions, ω=1 is indicative a gene is evolving neutrally.

Warning

I’m setting optimise_motif_probs=False to speed up execution of the examples, not because it’s a good idea!

from cogent3 import get_app

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

omega_eq_1 = get_app("natsel_neutral",
    "GNC", tree="data/primate_brca1.tree", optimise_motif_probs=False
)
result = omega_eq_1(aln)
type(result)
cogent3.app.result.hypothesis_result
result
Statistics
LRdfpvalue
4.503410.0338
hypothesiskeylnLnfpDLCunique_Q
null'GNC-null'-6715.526022TrueTrue
alt'GNC-alt'-6713.274323TrueTrue
result.alt.lf

GNC-alt

log-likelihood = -6713.2743

number of free parameters = 23

Global params
A>CA>GA>TC>AC>GC>TG>AG>CG>TT>AT>Comega
0.863.540.981.672.206.267.921.230.801.293.070.82
Edge params
edgeparentlength
Galagoroot0.52
HowlerMonroot0.13
Rhesusedge.30.06
Orangutanedge.20.02
Gorillaedge.10.01
Humanedge.00.02
Chimpanzeeedge.00.01
edge.0edge.10.00
edge.1edge.20.01
edge.2edge.30.04
edge.3root0.02
Motif params
AAAAACAAGAATACAACCACGACTAGAAGCAGGAGTATA
0.060.020.030.060.020.000.000.030.020.030.010.040.02
continuation
ATCATGATTCAACACCAGCATCCACCCCCGCCTCGACGC
0.010.010.020.020.010.020.020.020.010.000.030.000.00
continuation
CGGCGTCTACTCCTGCTTGAAGACGAGGATGCAGCCGCG
0.000.000.010.010.010.010.080.010.030.030.020.010.00
continuation
GCTGGAGGCGGGGGTGTAGTCGTGGTTTACTATTCATCC
0.010.020.010.010.010.010.010.010.020.000.010.020.01
continuation
TCGTCTTGCTGGTGTTTATTCTTGTTT
0.000.030.000.000.020.020.010.010.02