File: align-protein.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 (55 lines) | stat: -rw-r--r-- 1,417 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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
.. jupyter-execute::
    :hide-code:

    import set_working_directory

Using a protein model
=====================

We use apps to load unaligned DNA sequences and to translate them into amino acids.

.. jupyter-execute::
    :raises:

    from cogent3 import get_app

    loader = get_app("load_unaligned", format="fasta")
    to_aa = get_app("translate_seqs")
    process = loader + to_aa
    seqs = process("data/SCA1-cds.fasta")

Protein alignment with default settings
---------------------------------------

The default setting for "protein" is a WG01 model.

.. jupyter-execute::
    :raises:

    from cogent3 import get_app

    aa_aligner = get_app("progressive_align", "protein")
    aligned = aa_aligner(seqs)
    aligned

Specify a different distance measure for estimating the guide tree
------------------------------------------------------------------

The distance measures available are percent or paralinear.

.. note:: An estimated guide tree has its branch lengths scaled so they are consistent with usage in a codon model.

.. jupyter-execute::
    :raises:

    aa_aligner = get_app("progressive_align", "protein", distance="paralinear")
    aligned = aa_aligner(seqs)
    aligned

Alignment settings and file provenance are recorded in the ``info`` attribute
-----------------------------------------------------------------------------

.. jupyter-execute::
    :raises:

    aligned.info