Using genetic codes

Selecting codes in methods that support them

In cases where a cogent3 object method has a gc argument, you can just use the number under “Code ID” column.

For example, I’ve created a partial codon in "s1"

We specify the genetic code, and we allow incomplete codons. In this case, if a codon contains a gap, they are converted to ? in the translation.

Translate DNA sequences

Conversion to a ProteinSequence from a DnaSequence is shown in Translate a DnaSequence to protein.

Translate all six frames

Find out how many stops in a frame

Translate a codon

or get the codons for a single amino acid

Look up the amino acid corresponding to a single codon

Get all the codons for one amino acid

Get all the codons for a group of amino acids

Converting the CodonAlphabet to codon series

Obtaining the codons from a DnaSequence object

Use the method get_in_motif_size

Translating a DNA sequence

The defaults for get_translation() include using the standard genetic code and trimming a terminating stop if it exists.

Translating a DNA sequence containing stop codons

Making a sequence that contains both internal and terminating stop codons.

Translating this will fail with default settings.

Unless you explicitly allow stop codons