Translate               package:GeneR               R Documentation

_T_r_a_n_s_l_a_t_i_o_n _f_r_o_m _D_N_A _t_r_i_n_u_c_l_e_o_t_i_d_e_s _t_o _p_r_o_t_e_i_n_e

_D_e_s_c_r_i_p_t_i_o_n:

     Translation tools from DNA trinucleotides to proteine

_U_s_a_g_e:

     translate (seqno, from = 1, to = 0, strand = 0, code = 0,
     charcode = "") 
     strTranslate (s, code = 0, charcode = "") 
     showTable (code = 0, charcode = "") 

_A_r_g_u_m_e_n_t_s:

   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: '0', standard genetic
          code; '1' Vertebrate Mitochondrial Code; '2' Yeast
          Mitochondrial Code; '3' Mold, Protozoan, and Coelenterate
          Mitochondrial Code  and the Mycoplasma/Spiroplasma Code; '4'
          Invertebrate Mitochondrial Code

charcode: A character string of size 64, like
          "FFLLSSSSYY**CC*WLLLL\-PPPPHH\-Q\-QRRRRII\-IMTTTTNNKKSS\-RRVV
          VVAAAADDEEGGGG" 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! 

_V_a_l_u_e:

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.

_N_o_t_e:

     Global value of strand  has no effect on this function. (see
     'globals', 'getParam', 'setStrand')

_E_x_a_m_p_l_e_s:

     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)

