alphabetFrequency         package:Biostrings         R Documentation

_F_u_n_c_t_i_o_n _t_o _c_a_l_c_u_l_a_t_e _t_h_e _f_r_e_q_u_e_n_c_y _o_f _l_e_t_t_e_r_s _i_n _a _b_i_o_l_o_g_i_c_a_l _s_e_q_u_e_n_c_e

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

     This function calculates the frequency of each letter in the
     (base) alphabet for a biological sequence.

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

       alphabetFrequency(x, baseOnly=TRUE)

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

       x: A BString, DNAString, RNAString or BStringViews object. 

baseOnly: 'TRUE' or 'FALSE'. If 'TRUE', the returned vector only
          contains frequencies for the letters in the "base" alphabet +
          the gap symbol i.e. "A", "C", "G", "T" + "-" when 'x' is a
          DNAString object (or a BStringViews object with a DNAString
          subject), and "U", "G", "C", "A" + "-" when 'x' is a
          RNAString object (or a BStringViews object with a RNAString
          subject). When 'x' is a BString object (or a BStringViews
          object with a BString subject), then the 'baseOnly' argument
          is ignored. 

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

     An integer vector. If 'x' is a DNAString or RNAString object (or a
     BStringViews object with a DNAString or RNAString subject), then
     the returned vector is named with the letters in the alphabet. If
     the 'baseOnly' argument is TRUE, then the returned vector has an
     extra element named 'other'. If 'x' is a BStringViews object, then
     the returned vector contains the cumulated frequencies found in
     each view.

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

     H. Pages

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

     BString, DNAString, RNAString, BStringViews

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

       data(yeastSEQCHR1)
       yeast1 <- DNAString(yeastSEQCHR1)
       alphabetFrequency(yeast1)
       alphabetFrequency(yeast1, baseOnly=FALSE)

