skbio.sequence.GeneticCode

class skbio.sequence.GeneticCode(code_sequence, id=None, name=None, start_codon_sequence=None)[source]

Class to hold codon to amino acid mapping, and vice versa.

Parameters:

code_sequence : str

64-character string containing NCBI representation.

id : str, optional

identifier for the object.

name : str, optional

name for the object.

start_codon_sequence : str, optional

starting point for the codon sequence.

Returns:

GeneticCode

initialized GeneticCode object.

Raises:

GeneticCodeInitError

If the length of code_sequence is different to 64.

Examples

>>> from skbio.sequence import GeneticCode
>>> sgc = GeneticCode('FFLLSSSSYY**CC*WLLLLPPPPHHQQRRRRIIIMTTTTNNKKSSR'
...                   'RVVVVAAAADDEEGGGG')

Note

* is used to denote termination as per the NCBI standard. Although the genetic code objects convert DNA to RNA and vice versa, lists of codons that they produce will be provided in DNA format.

Attributes

blocks Returns list of lists of codon blocks in the genetic code.
code_sequence  
id  
name  
start_codon_sequence  
start_codons  
codons  
synonyms  
sense_codons  
anticodons  

Methods

changes(other) Returns dictionary of codons that differ
get_stop_indices(nucleotide_sequence[, start]) returns indexes for stop codons in the specified frame
is_start(codon) Checks if codon is a start codon
is_stop(codon) Checks if codon is a stop codon
translate_six_frames(nucleotide_sequence) Translate nucleotide to protein sequences for all six reading frames
translate(nucleotide_sequence[, start]) Translate nucleotide to protein sequence
__repr__() Returns reconstructable representation of the GeneticCode
__getitem__(item) Returns amino acid corresponding to codon, or codons for an aa.
__str__() Returns code_sequence that constructs the GeneticCode
__eq__(other) Allows two GeneticCode objects to be compared to each other.