biocantor.gene.codon
Module Contents
Classes
NCBI maintains a set of translation tables: |
|
Enum-like class for dealing with Codons |
Attributes
- class biocantor.gene.codon.TranslationTable
Bases:
enum.IntEnum
NCBI maintains a set of translation tables:
https://www.ncbi.nlm.nih.gov/Taxonomy/Utils/wprintgc.cgi?chapter=tgencodes#SG11
For most purposes, the only two tables that are relevant are:
Table 1: The Standard Code (vertebrates)
Table 11: The Bacterial, Archaeal and Plant Plastid Code
The only difference between these two tables are the choice of initiator codons. While the standard start codon is ATG, in certain eukaryotes it is possible for TTG and CTG to be start codons.
In table 11, it is possible for any of the following codons to be considered initiator codons:
ATG, TTG, CTG, ATT, ATC, ATA, GTG
These alternative initiator codons do see usage regularly, with approximately 3% of E. coli using TTG.
For this enumeration, the above two tables are included, as well as the default ATG-only option. This is because for many uses, ATG is the only one worth considering.
- DEFAULT = 0
- STANDARD = 1
- PROKARYOTE = 11
- class biocantor.gene.codon.Codon(codon: Union[str, inscripta.biocantor.sequence.sequence.Sequence])
Enum-like class for dealing with Codons
- property is_stop_codon: bool
Whether the codon is a stop codon or not
- Returns
Whether the codon is a stop codon (True) or not (False)
- Return type
- property is_strict_codon: bool
Whether the codon is a strict ATGC containing codon or not
- Returns
Whether the codon is a strict ATGC codon (True) or not (False)
- Return type
- property is_canonical_start_codon: bool
Whether the codon is a canonical start codon or not
- Returns
Whether the codon is a canonical start codon (True) or not (False)
- Return type
- __slots__ = ['_val']
- _singletons_
- translate(strict: bool = True) str
Returns string symbol of translated amino acid
- Parameters
strict – Whether to only use strict ATGC codon translations, or allow translation using extended IUPAC sequence. Untranslatable amino acids, whether through strict or simply unknown, will be represented with an “X” Default True (strict ATGC only translation)
- synonymous_codons(include_self: bool = False) List[Codon]
Returns list of synonymous codons
- Parameters
include_self – Include this codon in returned list
- Returns
The synonymous codons for the current codon.
- Return type
List[Codon]
Notes
For extended IUPAC codons, this function will still try and translate the codon in an attempt to get synonymous codons. If it can, the function will send out all strict ATGC codons for that amino acid. If it can’t, it will send out either no codons or just self, if include_self is True.
- is_start_codon_in_specific_translation_table(translation_table: Optional[TranslationTable] = TranslationTable.DEFAULT) bool
Whether the codon is a start codon according to the given translation_table
- Parameters
translation_table – What translation table to check for start codon validation.
- Returns
Whether the codon is a start codon (True) or not (False)
- Return type
Notes
Prokaryotes have a wider pool of valid start codons than eukaryotes who use the canonical ATG only
- biocantor.gene.codon.START_CODONS_BY_TRANSLATION_TABLE