translate             package:Biostrings             R Documentation

_D_N_A/_R_N_A _t_r_a_n_s_c_r_i_p_t_i_o_n _a_n_d _t_r_a_n_s_l_a_t_i_o_n

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

     Functions for transcription and/or translation of DNA or RNA
     sequences, and related utilities.

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

       transcribe(x)
       cDNA(x)
       codons(x)
       translate(x)

       ## Related utilities
       dna2rna(x)
       rna2dna(x)

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

       x: A DNAString object for 'transcribe' and 'dna2rna'.

          An RNAString object for 'cDNA' and 'rna2dna'.

          A DNAString, RNAString, MaskedDNAString or MaskedRNAString
          object for 'codons'.

          A DNAString, RNAString, DNAStringSet, RNAStringSet,
          MaskedDNAString or MaskedRNAString object for 'translate'. 

_D_e_t_a_i_l_s:

     'transcribe' reproduces the biological process of DNA
     transcription that occurs in the cell.

     'cDNA' reproduces the process of synthesizing complementary DNA
     from a mature mRNA template.

     'translate' reproduces the biological process of RNA translation
     that occurs in the cell. The input of the function can be either
     RNA or coding DNA. The Standard Genetic Code (see '?GENETIC_CODE')
     is used to translate codons into amino acids. 'codons' is a
     utility for extracting the codons involved in this translation
     without translating them. 

     'dna2rna' and 'rna2dna' are low-level utilities for converting
     sequences from DNA to RNA and vice-versa. All what this
     converstion does is to replace each occurence of T by a U and
     vice-versa.

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

     An RNAString object for 'transcribe' and 'dna2rna'.

     A DNAString object for 'cDNA' and 'rna2dna'.

     Note that if the sequence passed to 'transcribe' or 'cDNA' is
     considered to be oriented 5'-3', then the returned sequence is
     oriented 3'-5'.

     An XStringViews object with 1 view per codon for 'codons'. When
     'x' is a MaskedDNAString or MaskedRNAString object, its masked
     parts are interpreted as introns and filled with the + letter in
     the returned object. Therefore codons that span across masked
     regions are represented by views that have a width > 3 and contain
     the + letter. Note that each view is guaranteed to contain exactly
     3 base letters.

     An AAString object for 'translate'.

_S_e_e _A_l_s_o:

     'reverseComplement', 'GENETIC_CODE', DNAString-class,
     RNAString-class, AAString-class, XStringSet-class,
     XStringViews-class, MaskedXString-class

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

       file <- system.file("extdata", "someORF.fa", package="Biostrings")
       x <- read.DNAStringSet(file, "fasta")
       x

       ## The first and last 1000 nucleotides are not part of the ORFs:
       x <- DNAStringSet(x, start=1001, end=-1001)

       ## Before calling translate() on an ORF, we need to mask the introns
       ## if any. We can get this information fron the SGD database
       ## (http://www.yeastgenome.org/).
       ## According to SGD, the 1st ORF (YAL001C) has an intron at 71..160
       ## (see http://db.yeastgenome.org/cgi-bin/locus.pl?locus=YAL001C)
       y1 <- x[[1]]
       mask1 <- Mask(length(y1), start=71, end=160)
       masks(y1) <- mask1
       y1
       translate(y1)

       ## Codons
       codons(y1)
       which(width(codons(y1)) != 3)
       codons(y1)[20:28]

