codeine.TranslationTable¶
- class codeine.TranslationTable(table_id: int = 1, rna: bool = False)[source]¶
Bases:
objectTranslation table. Here we use the NCBI translation table IDs (see https://www.ncbi.nlm.nih.gov/Taxonomy/Utils/wprintgc.cgi) Uses DNA by default, but can switch to RNA by setting
rna=True.- Parameters:
table_id – Which translation table to use. Default is 1, which is the standard genetic code.
rna – Whether to use RNA. Default is no (False), i.e. use DNA.
Methods¶
|
Create a custom translation table. |
|
Format a sequence in the format specified by this codon table, i.e. convert to RNA/DNA and cast to upper case. |
|
Translate a DNA/RNA coding sequence into its amino-acid sequence. |
- classmethod TranslationTable.custom(codons_to_aa: Dict[str, str], name: str = 'Custom', rna: bool = False) TranslationTable[source]¶
Create a custom translation table.
This is useful for synthetic, partial, experimental, or externally defined translation tables, or for tables that have been discovered but not yet added to Codeine. Codons are normalised to DNA or RNA according to the
rnaargument.- Parameters:
codons_to_aa – Mapping from codons to amino-acid symbols.
name – Name of the custom translation table. Default is
'Custom'.rna – Whether the table should use RNA codons.
- Returns:
A custom translation table.
- Return type: