Translate {GeneR} | R Documentation |
Translation tools from DNA trinucleotides to proteine
translate (seqno, from = 1, to = 0, strand = 0, code = 0, charcode = "") strTranslate (s, code = 0, charcode = "") showTable (code = 0, charcode = "")
seqno |
Integer, sequence number (bufno) |
s |
Sequence as a character string |
from,to |
Begining and ending of sequence, can be vectors. 0 represent the last nucleotide and 1 the first one. |
strand |
0: forward, 1: reverse, can be a vector |
code |
One of the following standard code:
|
charcode |
A character string of size 64, like "FFLLSSSSYY**CC*WLLLL\-PPPPHH\-Q\-QRRRRII\-IMTTTTNNKKSS\-RRVVVVAAAADDEEGGGG" for translation code to use, in the order: TTT TTC TTA TTG TCT TCC TCA ... (for F F L L S S S). Use showTable to be sure! |
strTranslate |
return a character string of the protein |
translate |
return a vector of character string of the protein |
showTable |
return the table of translation |
All return -1 if error.
Global value of strand has no effect
on this function. (see globals
, getParam
, setStrand
)
s<-"gtcatgcatgctaggtgacagttaaaatgcgtctaggtgacagtctaacaa" # Simple usage: strTranslate(s) #[1] "VMHAR*QLKCV*VTV*Q" # with buffers placeString(s) translate() # the same... #[1] "VMHAR*QLKCV*VTV*Q" # with 2 positions translate (from=c(1,2),to=c(0,0)) #[1] "VMHAR*QLKCV*VTV*Q" "SCMLGDS*NASR*QSN" # with 2 strands translate (from=c(1,2,1),to=c(0,0,0),strand=c(0,0,1)) #[1] "VMHAR*QLKCV*VTV*Q" "SCMLGDS*NASR*QSN" "LLDCHLDAF*LSPSMHD" # With Invertebrate Mitochondrial Code translate(code=4) #[1] "VMHASWQLKCV*VTV*Q" # With a personal code translate(charcode="FFLLxxxxYY**CCwwLLLLPPPPHHQQRRRRIIIMTTTTNNKKSSRRuuuuAAAADDEEGGGG") #[1] "uMHARwQLKCu*uTu*Q" # Show what is this code... showTable(charcode="FFLLxxxxYY**CCwwLLLLPPPPHHQQRRRRIIIMTTTTNNKKSSRRuuuuAAAADDEEGGGG") # [,1] [,2] # [1,] "UUU" "F" # [2,] "UUC" "F" # [3,] "UUA" "L" # [4,] "UUG" "L" # [5,] "UCU" "x" # [6,] "UCC" "x" # [7,] "UCA" "x" # ... # Show Standard table: showTable() # Show Invertebrate Mitochondrial Code showTable(code=4)