Learn R Programming

Biostrings (version 2.40.2)

GENETIC_CODE: The Standard Genetic Code and its known variants

Description

Two predefined objects (GENETIC_CODE and RNA_GENETIC_CODE) that represent The Standard Genetic Code.

Other genetic codes are stored in predefined table GENETIC_CODE_TABLE from which they can conveniently be extracted with getGeneticCode.

Usage

## The Standard Genetic Code: GENETIC_CODE RNA_GENETIC_CODE
## All the known genetic codes: GENETIC_CODE_TABLE getGeneticCode(id_or_name2, full.search=FALSE)

Arguments

id_or_name2
A single string that uniquely identifies the genetic code to extract. Should be one of the values in the id or name2 columns of GENETIC_CODE_TABLE.
full.search
By default, only the id and name2 columns of GENETIC_CODE_TABLE are searched for an exact match with id_or_name2. If full.search is TRUE, then the search is extended to the name column of GENETIC_CODE_TABLE and id_or_name2 only needs to be a substring of one of the names in that column (also case is ignored).

Value

GENETIC_CODE and RNA_GENETIC_CODE are both named character vectors of length 64 (the number of all possible tri-nucleotide sequences) where each element is a single letter representing either an amino acid or the stop codon "*" (aka termination codon).The names of the GENETIC_CODE vector are the DNA codons i.e. the tri-nucleotide sequences (directed 5' to 3') that are assumed to belong to the "coding DNA strand" (aka "sense DNA strand" or "non-template DNA strand") of the gene.The names of the RNA_GENETIC_CODE are the RNA codons i.e. the tri-nucleotide sequences (directed 5' to 3') that are assumed to belong to the mRNA of the gene.Note that the values in the GENETIC_CODE and RNA_GENETIC_CODE vectors are the same, only their names are different. The names of the latter are those of the former where all occurrences of T (thymine) have been replaced by U (uracil).GENETIC_CODE_TABLE is a data frame with 1 row per known genetic code and the 4 following columns:
  • name: The long and very descriptive name of the genetic code.
  • name2: The short name of the genetic code (not all genetic codes have one).
  • id: The id of the genetic code.
  • AAs: The genetic code itself represented in a compact form (i.e. 64 amino acid letters, 1 letter per codon, the codons are assumed to be ordered like in GENETIC_CODE).
getGeneticCode returns a named character vector of length 64 similar to GENETIC_CODE i.e. it contains 1-letter strings in the Amino Acid alphabet (see ?AA_ALPHABET) and its names are identical to names(GENETIC_CODE).

Details

Formally, a genetic code is a mapping between tri-nucleotide sequences called codons, and amino acids.

The Standard Genetic Code (aka The Canonical Genetic Code, or simply The Genetic Code) is the particular mapping that encodes the vast majority of genes in nature.

GENETIC_CODE and RNA_GENETIC_CODE are predefined named character vectors that represent this mapping.

All the known genetic codes are summarized in GENETIC_CODE_TABLE, which is a predefined data frame with 1 row per known genetic code. Use getGeneticCode to extract one genetic code at a time from this object.

References

All the known genetic codes are described here:

http://www.ncbi.nlm.nih.gov/Taxonomy/Utils/wprintgc.cgi

The "official names" of the various codes ("Standard", "SGC0", "Vertebrate Mitochondrial", "SGC1", etc..) and their ids (1, 2, etc...) were taken from the print-form ASN.1 version of the above document (version 3.9 at the time of this writting):

ftp://ftp.ncbi.nih.gov/entrez/misc/data/gc.prt

See Also

Examples

Run this code
## The Standard Genetic Code:

GENETIC_CODE

GENETIC_CODE[["ATG"]]  # codon ATG is translated into M (Methionine)

sort(table(GENETIC_CODE))  # the same amino acid can be encoded by 1
                           # to 6 different codons

RNA_GENETIC_CODE
all(GENETIC_CODE == RNA_GENETIC_CODE)  # TRUE

## All the known genetic codes:

GENETIC_CODE_TABLE[1:3 , ]

getGeneticCode("SGC0")  # The Standard Genetic Code, again
stopifnot(identical(getGeneticCode("SGC0"), GENETIC_CODE))

getGeneticCode("SGC1")  # Vertebrate Mitochondrial

getGeneticCode("ascidian", full.search=TRUE)  # Ascidian Mitochondrial

## Differences between a non-standard code and the Standard Code:
idx <- which(getGeneticCode("SGC1") != GENETIC_CODE)
rbind(SGC1=getGeneticCode("SGC1")[idx], Standard=GENETIC_CODE[idx])

Run the code above in your browser using DataLab