File: sample-trim-stops.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 (16 lines) | stat: -rw-r--r-- 691 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
Remove trailing stop codons from sequences in an alignment
----------------------------------------------------------

For evolutionary analyses that use codon models, we need to exclude terminating stop codons. To account for the difference in stop codons in different genetic codes, we can provide an argument for the genetic code. For a list of all genetic codes, see :ref:`here <genetic-codes>`. 

.. jupyter-execute::
    :raises:

    from cogent3 import get_app, make_aligned_seqs

    aln = make_aligned_seqs(
        data={"seq1": "ACGTAA---", "seq2": "ACGACA---", "seq3": "ACGCAATGA"},
        moltype="dna",
    )
    no_stops = get_app("trim_stop_codons", gc=1)
    no_stops(aln)