File: evo-natsel_timehet.rst

package info (click to toggle)
python-cogent 2024.5.7a1%2Bdfsg-3
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 74,600 kB
  • sloc: python: 92,479; makefile: 117; sh: 16
file content (32 lines) | stat: -rw-r--r-- 984 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
.. jupyter-execute::
    :hide-code:

    import set_working_directory

``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 <https://www.ncbi.nlm.nih.gov/pubmed/9580986>`__).

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

.. jupyter-execute::

    from cogent3 import get_app

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

    hc_differ = get_app("natsel_timehet",
        "GNC",
        tree="data/primate_brca1.tree",
        optimise_motif_probs=False,
        tip1="Human",
        tip2="Chimpanzee",
    )
    result = hc_differ(aln)
    result

.. jupyter-execute::

    result.alt.lf