File: simple.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 (24 lines) | stat: -rw-r--r-- 730 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
.. jupyter-execute::
    :hide-code:

    import set_working_directory

The simplest script
===================

.. sectionauthor:: Gavin Huttley

We use a canned nucleotide substitution model (the ``HKY85`` model) on just three primate species. As there is only one unrooted tree possible, the sequence names are all that's required to make the tree.

.. jupyter-execute::

    from cogent3 import load_aligned_seqs, make_tree
    from cogent3.evolve.models import get_model

    model = get_model("HKY85")
    aln = load_aligned_seqs("data/primate_cdx2_promoter.fasta")
    tree = make_tree(tip_names=aln.names)
    lf = model.make_likelihood_function(tree)
    lf.set_alignment(aln)
    lf.optimise(show_progress=False)
    lf