RNAString-class          package:Biostrings          R Documentation

_R_N_A_S_t_r_i_n_g _o_b_j_e_c_t_s

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

     An RNAString object allows efficient storage and manipulation of a
     long RNA sequence.

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

     The RNAString class is a direct XString subclass (with no
     additional slot). Therefore all functions and methods described in
     the XString man page also work with an RNAString object
     (inheritance).

     Unlike the BString container that allows storage of any single
     string (based on a single-byte character set) the RNAString
     container can only store a string based on the RNA alphabet (see
     below). In addition, the letters stored in an RNAString object are
     encoded in a way that optimizes fast search algorithms.

_T_h_e _R_N_A _a_l_p_h_a_b_e_t:

     This alphabet contains all letters from the IUPAC Extended Genetic
     Alphabet (see '?IUPAC_CODE_MAP') where '"T"' is replaced by '"U"'
     + the gap ('"-"') and the hard masking ('"+"') letters. It is
     stored in the 'RNA_ALPHABET' constant (character vector). The
     'alphabet' method also returns 'RNA_ALPHABET' when applied to an
     RNAString object and is provided for convenience only.

_C_o_n_s_t_r_u_c_t_o_r-_l_i_k_e _f_u_n_c_t_i_o_n_s _a_n_d _g_e_n_e_r_i_c_s:

     In the code snippet below, 'x' can be a single string (character
     vector of length 1), a BString object or a DNAString object.


      'RNAString(x="", start=1, nchar=NA)': Tries to convert 'x' into
          an RNAString object by reading 'nchar' letters starting at
          position 'start' in 'x'.


_A_c_c_e_s_s_o_r _m_e_t_h_o_d_s:

     In the code snippet below, 'x' is an RNAString object.


      'alphabet(x, baseOnly=FALSE)': If 'x' is an RNAString object,
          then return the RNA alphabet (see above). See the
          corresponding man pages when 'x' is a BString, DNAString or
          AAString object.


_A_u_t_h_o_r(_s):

     H. Pages

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

     'IUPAC_CODE_MAP', 'letter', XString-class, DNAString-class,
     'reverseComplement', 'alphabetFrequency'

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

       RNA_BASES
       RNA_ALPHABET
       d <- DNAString("TTGAAAA-CTC-N")
       r <- RNAString(d)
       r
       alphabet(r)                 # RNA_ALPHABET
       alphabet(r, baseOnly=TRUE)  # RNA_BASES

       ## When comparing an RNAString object with a DNAString object,
       ## U and T are considered equals:
       r == d  # TRUE

