natsel_neutral – a test for selective neutrality#
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_name="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
| LR | df | pvalue |
|---|---|---|
| 4.5034 | 1 | 0.0338 |
| hypothesis | key | lnL | nfp | DLC | unique_Q |
|---|---|---|---|---|---|
| null | 'GNC-null' | -6715.5260 | 22 | True | True |
| alt | 'GNC-alt' | -6713.2743 | 23 | True | True |
result.alt.lf
GNC-alt
log-likelihood = -6713.2743
number of free parameters = 23
| A>C | A>G | A>T | C>A | C>G | C>T | G>A | G>C | G>T | T>A | T>C | omega |
|---|---|---|---|---|---|---|---|---|---|---|---|
| 0.86 | 3.54 | 0.98 | 1.67 | 2.20 | 6.26 | 7.92 | 1.23 | 0.80 | 1.29 | 3.07 | 0.82 |
| edge | parent | length |
|---|---|---|
| Galago | root | 0.52 |
| HowlerMon | root | 0.13 |
| Rhesus | edge.3 | 0.06 |
| Orangutan | edge.2 | 0.02 |
| Gorilla | edge.1 | 0.01 |
| Human | edge.0 | 0.02 |
| Chimpanzee | edge.0 | 0.01 |
| edge.0 | edge.1 | 0.00 |
| edge.1 | edge.2 | 0.01 |
| edge.2 | edge.3 | 0.04 |
| edge.3 | root | 0.02 |
| AAA | AAC | AAG | AAT | ACA | ACC | ACG | ACT | AGA | AGC | AGG | AGT | ATA |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0.06 | 0.02 | 0.03 | 0.06 | 0.02 | 0.00 | 0.00 | 0.03 | 0.02 | 0.03 | 0.01 | 0.04 | 0.02 |
| ATC | ATG | ATT | CAA | CAC | CAG | CAT | CCA | CCC | CCG | CCT | CGA | CGC |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0.01 | 0.01 | 0.02 | 0.02 | 0.01 | 0.02 | 0.02 | 0.02 | 0.01 | 0.00 | 0.03 | 0.00 | 0.00 |
| CGG | CGT | CTA | CTC | CTG | CTT | GAA | GAC | GAG | GAT | GCA | GCC | GCG |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0.00 | 0.00 | 0.01 | 0.01 | 0.01 | 0.01 | 0.08 | 0.01 | 0.03 | 0.03 | 0.02 | 0.01 | 0.00 |
| GCT | GGA | GGC | GGG | GGT | GTA | GTC | GTG | GTT | TAC | TAT | TCA | TCC |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0.01 | 0.02 | 0.01 | 0.01 | 0.01 | 0.01 | 0.01 | 0.01 | 0.02 | 0.00 | 0.01 | 0.02 | 0.01 |
| TCG | TCT | TGC | TGG | TGT | TTA | TTC | TTG | TTT |
|---|---|---|---|---|---|---|---|---|
| 0.00 | 0.03 | 0.00 | 0.00 | 0.02 | 0.02 | 0.01 | 0.01 | 0.02 |