natsel_zhang
– a branch-site test
This is the hypothesis test presented in Zhang et al. It evaluates the hypothesis that a set of sites have undergone positive natural selection on a pre-specified set of lineages.
For this model class, there are groups of branches for which all positions are evolving neutrally but some proportion of those neutrally evolving sites change to adaptively evolving on so-called foreground edges. For the current example, we’ll define the Chimpanzee and Human branches as foreground and everything else as background. The following table defines the parameter scopes.
<IPython.core.display.HTML object>
Note
Our implementation is not as parametrically succinct as that of Zhang et al, we have 1 additional bin probability.
Statistics
LR | df | pvalue |
4.9549 | 3 | 0.1751 |
hypothesis | key | lnL | nfp | DLC | unique_Q |
null | 'GNC-null' | -6708.3129 | 24 | True | True |
alt | 'GNC-alt' | -6705.8354 | 27 | True | True |
GNC-alt
log-likelihood = -6705.8354
number of free parameters = 27
Global params
A>C | A>G | A>T | C>A | C>G | C>T | G>A | G>C | G>T | T>A |
0.8554 | 3.5341 | 0.9744 | 1.6586 | 2.1936 | 6.2583 | 8.0098 | 1.2418 | 0.7941 | 1.2667 |
Bin params
bin | bprobs |
0 | 0.0505 |
1 | 0.0001 |
2a | 0.0430 |
2b | 0.9064 |
Edge params
edge | parent | length |
Galago | root | 0.5419 |
HowlerMon | root | 0.1359 |
Rhesus | edge.3 | 0.0648 |
Orangutan | edge.2 | 0.0235 |
Gorilla | edge.1 | 0.0075 |
Human | edge.0 | 0.0182 |
Chimpanzee | edge.0 | 0.0085 |
edge.0 | edge.1 | 0.0000 |
edge.1 | edge.2 | 0.0099 |
edge.2 | edge.3 | 0.0365 |
edge.3 | root | 0.0234 |
Edge bin params
edge | bin | omega |
Galago | 0 | 1.000000986577453e-06 |
Galago | 1 | 1.0 |
Galago | 2a | 1.000000986577453e-06 |
Galago | 2b | 1.0 |
HowlerMon | 0 | 1.000000986577453e-06 |
HowlerMon | 1 | 1.0 |
HowlerMon | 2a | 1.000000986577453e-06 |
HowlerMon | 2b | 1.0 |
Rhesus | 0 | 1.000000986577453e-06 |
Rhesus | 1 | 1.0 |
Rhesus | 2a | 1.000000986577453e-06 |
Rhesus | 2b | 1.0 |
Orangutan | 0 | 1.000000986577453e-06 |
Orangutan | 1 | 1.0 |
Orangutan | 2a | 1.000000986577453e-06 |
Orangutan | 2b | 1.0 |
Gorilla | 0 | 1.000000986577453e-06 |
Gorilla | 1 | 1.0 |
Gorilla | 2a | 1.000000986577453e-06 |
Gorilla | 2b | 1.0 |
Human | 0 | 1.000000986577453e-06 |
Human | 1 | 1.0 |
Human | 2a | 3.653259408696248 |
Human | 2b | 3.653259408696248 |
Chimpanzee | 0 | 1.000000986577453e-06 |
Chimpanzee | 1 | 1.0 |
Chimpanzee | 2a | 3.653259408696248 |
Chimpanzee | 2b | 3.653259408696248 |
edge.0 | 0 | 1.000000986577453e-06 |
edge.0 | 1 | 1.0 |
edge.0 | 2a | 1.000000986577453e-06 |
edge.0 | 2b | 1.0 |
edge.1 | 0 | 1.000000986577453e-06 |
edge.1 | 1 | 1.0 |
edge.1 | 2a | 1.000000986577453e-06 |
edge.1 | 2b | 1.0 |
edge.2 | 0 | 1.000000986577453e-06 |
edge.2 | 1 | 1.0 |
edge.2 | 2a | 1.000000986577453e-06 |
edge.2 | 2b | 1.0 |
edge.3 | 0 | 1.000000986577453e-06 |
edge.3 | 1 | 1.0 |
edge.3 | 2a | 1.000000986577453e-06 |
edge.3 | 2b | 1.0 |
Motif params
AAA | AAC | AAG | AAT | ACA | ACC | ACG | ACT | AGA | AGC |
0.0556 | 0.0235 | 0.0344 | 0.0556 | 0.0228 | 0.0046 | 0.0008 | 0.0289 | 0.0231 | 0.0286 |
continuation
AGG | AGT | ATA | ATC | ATG | ATT | CAA | CAC | CAG | CAT |
0.0140 | 0.0381 | 0.0186 | 0.0070 | 0.0128 | 0.0192 | 0.0196 | 0.0052 | 0.0238 | 0.0221 |
continuation
CCA | CCC | CCG | CCT | CGA | CGC | CGG | CGT | CTA | CTC |
0.0195 | 0.0062 | 0.0006 | 0.0263 | 0.0011 | 0.0009 | 0.0023 | 0.0032 | 0.0137 | 0.0078 |
continuation
CTG | CTT | GAA | GAC | GAG | GAT | GCA | GCC | GCG | GCT |
0.0125 | 0.0105 | 0.0755 | 0.0105 | 0.0303 | 0.0315 | 0.0158 | 0.0096 | 0.0014 | 0.0137 |
continuation
GGA | GGC | GGG | GGT | GTA | GTC | GTG | GTT | TAC | TAT |
0.0161 | 0.0090 | 0.0067 | 0.0133 | 0.0148 | 0.0070 | 0.0069 | 0.0213 | 0.0023 | 0.0101 |
continuation
TCA | TCC | TCG | TCT | TGC | TGG | TGT | TTA | TTC | TTG |
0.0221 | 0.0082 | 0.0015 | 0.0251 | 0.0018 | 0.0040 | 0.0201 | 0.0212 | 0.0078 | 0.0108 |
Getting the posterior probabilities of site-class membership
| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 |
0 | 0.0721 | 0.0406 | 0.0000 | 0.0637 | 0.0557 | 0.0760 | 0.0408 | 0.0577 | 0.0493 | 0.0390 | 0.0372 | 0.0760 | 0.0456 | 0.0000 | 0.0757 | 0.2487 | 0.0390 | 0.0337 | 0.0557 | 0.0589 |
1 | 0.0001 | 0.0001 | 0.0001 | 0.0001 | 0.0001 | 0.0001 | 0.0001 | 0.0001 | 0.0001 | 0.0001 | 0.0001 | 0.0001 | 0.0001 | 0.0001 | 0.0001 | 0.0001 | 0.0001 | 0.0001 | 0.0001 | 0.0001 |
2a | 0.0605 | 0.0350 | 0.0000 | 0.0538 | 0.0473 | 0.0637 | 0.0352 | 0.0490 | 0.0421 | 0.0338 | 0.0322 | 0.0637 | 0.0391 | 0.0000 | 0.0634 | 0.2153 | 0.0338 | 0.0293 | 0.0473 | 0.0499 |
2b | 0.8673 | 0.9243 | 0.9999 | 0.8825 | 0.8970 | 0.8601 | 0.9239 | 0.8932 | 0.9085 | 0.9271 | 0.9304 | 0.8601 | 0.9152 | 0.9999 | 0.8607 | 0.5358 | 0.9271 | 0.9368 | 0.8970 | 0.8911 |