.\" Automatically generated by Pod::Man 4.11 (Pod::Simple 3.35) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Bio::Tools::CodonTable 3pm" .TH Bio::Tools::CodonTable 3pm "2020-10-28" "perl v5.30.3" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Bio::Tools::CodonTable \- Codon table object .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 3 \& # This is a read\-only class for all known codon tables. The IDs are \& # the ones used by nucleotide sequence databases. All common IUPAC \& # ambiguity codes for DNA, RNA and amino acids are recognized. \& \& use Bio::Tools::CodonTable; \& \& # defaults to ID 1 "Standard" \& $myCodonTable = Bio::Tools::CodonTable\->new(); \& $myCodonTable2 = Bio::Tools::CodonTable\->new( \-id => 3 ); \& \& # change codon table \& $myCodonTable\->id(5); \& \& # examine codon table \& print join (\*(Aq \*(Aq, "The name of the codon table no.", $myCodonTable\->id(4), \& "is:", $myCodonTable\->name(), "\en"); \& \& # print possible codon tables \& $tables = Bio::Tools::CodonTable\->tables; \& while ( ($id,$name) = each %{$tables} ) { \& print "$id = $name\en"; \& } \& \& # translate a codon \& $aa = $myCodonTable\->translate(\*(AqACU\*(Aq); \& $aa = $myCodonTable\->translate(\*(Aqact\*(Aq); \& $aa = $myCodonTable\->translate(\*(Aqytr\*(Aq); \& \& # reverse translate an amino acid \& @codons = $myCodonTable\->revtranslate(\*(AqA\*(Aq); \& @codons = $myCodonTable\->revtranslate(\*(AqSer\*(Aq); \& @codons = $myCodonTable\->revtranslate(\*(AqGlx\*(Aq); \& @codons = $myCodonTable\->revtranslate(\*(AqcYS\*(Aq, \*(Aqrna\*(Aq); \& \& # reverse translate an entire amino acid sequence into a IUPAC \& # nucleotide string \& \& my $seqobj = Bio::PrimarySeq\->new(\-seq => \*(AqFHGERHEL\*(Aq); \& my $iupac_str = $myCodonTable\->reverse_translate_all($seqobj); \& \& # boolean tests \& print "Is a start\en" if $myCodonTable\->is_start_codon(\*(AqATG\*(Aq); \& print "Is a terminator\en" if $myCodonTable\->is_ter_codon(\*(Aqtar\*(Aq); \& print "Is a unknown\en" if $myCodonTable\->is_unknown_codon(\*(AqJTG\*(Aq); .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" Codon tables are also called translation tables or genetic codes since that is what they represent. A bit more complete picture of the full complexity of codon usage in various taxonomic groups is presented at the \s-1NCBI\s0 Genetic Codes Home page. .PP CodonTable is a BioPerl class that knows all current translation tables that are used by primary nucleotide sequence databases (GenBank, \s-1EMBL\s0 and \s-1DDBJ\s0). It provides methods to output information about tables and relationships between codons and amino acids. .PP This class and its methods recognized all common \s-1IUPAC\s0 ambiguity codes for \s-1DNA, RNA\s0 and animo acids. The translation method follows the conventions in \s-1EMBL\s0 and \s-1TREMBL\s0 databases. .PP It is a nuisance to separate \s-1RNA\s0 and cDNA representations of nucleic acid transcripts. The CodonTable object accepts codons of both type as input and allows the user to set the mode for output when reverse translating. Its default for output is \s-1DNA.\s0 .PP Note: .PP This class deals primarily with individual codons and amino acids. However in the interest of speed you can translate longer sequence, too. The full complexity of protein translation is tackled by Bio::PrimarySeqI::translate. .PP The amino acid codes are \s-1IUPAC\s0 recommendations for common amino acids: .PP .Vb 10 \& A Ala Alanine \& R Arg Arginine \& N Asn Asparagine \& D Asp Aspartic acid \& C Cys Cysteine \& Q Gln Glutamine \& E Glu Glutamic acid \& G Gly Glycine \& H His Histidine \& I Ile Isoleucine \& L Leu Leucine \& K Lys Lysine \& M Met Methionine \& F Phe Phenylalanine \& P Pro Proline \& O Pyl Pyrrolysine (22nd amino acid) \& U Sec Selenocysteine (21st amino acid) \& S Ser Serine \& T Thr Threonine \& W Trp Tryptophan \& Y Tyr Tyrosine \& V Val Valine \& B Asx Aspartic acid or Asparagine \& Z Glx Glutamine or Glutamic acid \& J Xle Isoleucine or Valine (mass spec ambiguity) \& X Xaa Any or unknown amino acid .Ve .PP It is worth noting that, \*(L"Bacterial\*(R" codon table no. 11 produces an polypeptide that is, confusingly, identical to the standard one. The only differences are in available initiator codons. .PP \&\s-1NCBI\s0 Genetic Codes home page: (Last update of the Genetic Codes: Nov. 18, 2016) https://www.ncbi.nlm.nih.gov/Taxonomy/Utils/wprintgc.cgi?mode=c .PP \&\s-1ASN.1\s0 version with ids 1 to 25 is at: ftp://ftp.ncbi.nih.gov/entrez/misc/data/gc.prt .PP Thanks to Matteo diTomasso for the original Perl implementation of these tables. .SH "FEEDBACK" .IX Header "FEEDBACK" .SS "Mailing Lists" .IX Subsection "Mailing Lists" User feedback is an integral part of the evolution of this and other Bioperl modules. Send your comments and suggestions preferably to the Bioperl mailing lists Your participation is much appreciated. .PP .Vb 2 \& bioperl\-l@bioperl.org \- General discussion \& http://bioperl.org/wiki/Mailing_lists \- About the mailing lists .Ve .SS "Support" .IX Subsection "Support" Please direct usage questions or support issues to the mailing list: .PP \&\fIbioperl\-l@bioperl.org\fR .PP rather than to the module maintainer directly. Many experienced and reponsive experts will be able look at the problem and quickly address it. Please include a thorough description of the problem with code and data examples if at all possible. .SS "Reporting Bugs" .IX Subsection "Reporting Bugs" Report bugs to the Bioperl bug tracking system to help us keep track the bugs and their resolution. Bug reports can be submitted via the web: .PP .Vb 1 \& https://github.com/bioperl/bioperl\-live/issues .Ve .SH "AUTHOR \- Heikki Lehvaslaiho" .IX Header "AUTHOR - Heikki Lehvaslaiho" Email: heikki-at-bioperl-dot-org .SH "APPENDIX" .IX Header "APPENDIX" The rest of the documentation details each of the object methods. Internal methods are usually preceded with a _ .SS "id" .IX Subsection "id" .Vb 10 \& Title : id \& Usage : $obj\->id(3); $id_integer = $obj\->id(); \& Function: Sets or returns the id of the translation table. IDs are \& integers from 0 (special ATG\-only start) to 25, excluding \& 7\-8 and 17\-20 which have been removed. If an invalid ID is \& given the method returns 1, the standard table. \& Example : \& Returns : value of id, a scalar, warn and fall back to 1 (standard table) \& if specified id is not valid \& Args : newvalue (optional) .Ve .SS "name" .IX Subsection "name" .Vb 6 \& Title : name \& Usage : $obj\->name() \& Function: returns the descriptive name of the translation table \& Example : \& Returns : A string \& Args : None .Ve .SS "tables" .IX Subsection "tables" .Vb 8 \& Title : tables \& Usage : $obj\->tables() or Bio::Tools::CodonTable\->tables() \& Function: returns a hash reference where each key is a valid codon \& table id() number, and each value is the corresponding \& codon table name() string \& Example : \& Returns : A hashref \& Args : None .Ve .SS "translate" .IX Subsection "translate" .Vb 4 \& Title : translate \& Usage : $obj\->translate(\*(AqYTR\*(Aq) \& Function: Returns a string of one letter amino acid codes from \& nucleotide sequence input. The imput can be of any length. \& \& Returns \*(AqX\*(Aq for unknown codons and codons that code for \& more than one amino acid. Returns an empty string if input \& is not three characters long. Exceptions for these are: \& \& \- IUPAC amino acid code B for Aspartic Acid and \& Asparagine, is used. \& \- IUPAC amino acid code Z for Glutamic Acid, Glutamine is \& used. \& \- if the codon is two nucleotides long and if by adding \& an a third character \*(AqN\*(Aq, it codes for a single amino \& acid (with exceptions above), return that, otherwise \& return empty string. \& \& Returns empty string for other input strings that are not \& three characters long. \& \& Example : \& Returns : a string of one letter ambiguous IUPAC amino acid codes \& Args : ambiguous IUPAC nucleotide string .Ve .SS "translate_strict" .IX Subsection "translate_strict" .Vb 3 \& Title : translate_strict \& Usage : $obj\->translate_strict(\*(AqACT\*(Aq) \& Function: returns one letter amino acid code for a codon input \& \& Fast and simple translation. User is responsible to resolve \& ambiguous nucleotide codes before calling this \& method. Returns \*(AqX\*(Aq for unknown codons and an empty string \& for input strings that are not three characters long. \& \& It is not recommended to use this method in a production \& environment. Use method translate, instead. \& \& Example : \& Returns : A string \& Args : a codon = a three nucleotide character string .Ve .SS "revtranslate" .IX Subsection "revtranslate" .Vb 3 \& Title : revtranslate \& Usage : $obj\->revtranslate(\*(AqG\*(Aq) \& Function: returns codons for an amino acid \& \& Returns an empty string for unknown amino acid \& codes. Ambiguous IUPAC codes Asx,B, (Asp,D; Asn,N) and \& Glx,Z (Glu,E; Gln,Q) are resolved. Both single and three \& letter amino acid codes are accepted. \*(Aq*\*(Aq and \*(AqTer\*(Aq are \& used for terminator. \& \& By default, the output codons are shown in DNA. If the \& output is needed in RNA (tr/t/u/), add a second argument \& \*(AqRNA\*(Aq. \& \& Example : $obj\->revtranslate(\*(AqGly\*(Aq, \*(AqRNA\*(Aq) \& Returns : An array of three lower case letter strings i.e. codons \& Args : amino acid, \*(AqRNA\*(Aq .Ve .SS "reverse_translate_all" .IX Subsection "reverse_translate_all" .Vb 10 \& Title : reverse_translate_all \& Usage : my $iup_str = $cttable\->reverse_translate_all($seq_object) \& my $iup_str = $cttable\->reverse_translate_all($seq_object, \& $cutable, \& 15); \& Function: reverse translates a protein sequence into IUPAC nucleotide \& sequence. An \*(AqX\*(Aq in the protein sequence is converted to \*(AqNNN\*(Aq \& in the nucleotide sequence. \& Returns : a string \& Args : a Bio::PrimarySeqI compatible object (mandatory) \& a Bio::CodonUsage::Table object and a threshold if only \& codons with a relative frequency above the threshold are \& to be considered. .Ve .SS "reverse_translate_best" .IX Subsection "reverse_translate_best" .Vb 6 \& Title : reverse_translate_best \& Usage : my $str = $cttable\->reverse_translate_best($seq_object,$cutable); \& Function: Reverse translates a protein sequence into plain nucleotide \& sequence (GATC), uses the most common codon for each amino acid \& Returns : A string \& Args : A Bio::PrimarySeqI compatible object and a Bio::CodonUsage::Table object .Ve .SS "is_start_codon" .IX Subsection "is_start_codon" .Vb 7 \& Title : is_start_codon \& Usage : $obj\->is_start_codon(\*(AqATG\*(Aq) \& Function: returns true (1) for all codons that can be used as a \& translation start, false (0) for others. \& Example : $myCodonTable\->is_start_codon(\*(AqATG\*(Aq) \& Returns : boolean \& Args : codon .Ve .SS "is_ter_codon" .IX Subsection "is_ter_codon" .Vb 7 \& Title : is_ter_codon \& Usage : $obj\->is_ter_codon(\*(AqGAA\*(Aq) \& Function: returns true (1) for all codons that can be used as a \& translation tarminator, false (0) for others. \& Example : $myCodonTable\->is_ter_codon(\*(AqATG\*(Aq) \& Returns : boolean \& Args : codon .Ve .SS "is_unknown_codon" .IX Subsection "is_unknown_codon" .Vb 7 \& Title : is_unknown_codon \& Usage : $obj\->is_unknown_codon(\*(AqGAJ\*(Aq) \& Function: returns false (0) for all codons that are valid, \& true (1) for others. \& Example : $myCodonTable\->is_unknown_codon(\*(AqNTG\*(Aq) \& Returns : boolean \& Args : codon .Ve .SS "unambiguous_codons" .IX Subsection "unambiguous_codons" .Vb 4 \& Title : unambiguous_codons \& Usage : @codons = $self\->unambiguous_codons(\*(AqACN\*(Aq) \& Returns : array of strings (one\-letter unambiguous amino acid codes) \& Args : a codon = a three IUPAC nucleotide character string .Ve .SS "_unambiquous_codons" .IX Subsection "_unambiquous_codons" deprecated, now an alias for unambiguous_codons .SS "add_table" .IX Subsection "add_table" .Vb 9 \& Title : add_table \& Usage : $newid = $ct\->add_table($name, $table, $starts) \& Function: Add a custom Codon Table into the object. \& Know what you are doing, only the length of \& the argument strings is checked! \& Returns : the id of the new codon table \& Args : name, a string, optional (can be empty) \& table, a string of 64 characters \& startcodons, a string of 64 characters, defaults to standard .Ve