basecontent            package:Biostrings            R Documentation

_O_b_t_a_i_n _t_h_e _A_T_C_G _c_o_n_t_e_n_t _o_f _a _g_e_n_e

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

     WARNING: Both 'basecontent' and 'countbases' have been deprecated
     in favor of 'alphabetFrequency'.

     These functions accept a character vector representing the
     nucleotide sequences and compute the frequencies of each base (A,
     C, G, T).

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

     basecontent(seq)
     countbases(seq, dna = TRUE)

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

     seq: Character vector.

     dna: Logical value indicating whether the sequence is DNA ('TRUE')
          or RNA ('FALSE')

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

     The base frequencies are calculated separately for each element of
     'x'. The elements of 'x' can be in upper case, lower case or
     mixed.

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

     A matrix with 4 columns and 'length(x)' rows.  The columns are
     named 'A', 'C', 'T', 'G', and the values in each column are the
     counts of the corresponding bases in the elements of 'x'.  When
     'dna=FALSE', the 'T' column is replaced with a 'U' column.

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

     R. Gentleman, W. Huber, S. Falcon

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

     'alphabetFrequency', 'reverseComplement'

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

      v<-c("AAACT", "GGGTT", "ggAtT")

      ## Do not use these functions anymore:
      if (interactive()) {
        basecontent(v)
        countbases(v)
      }

      ## But use more efficient alphabetFrequency() instead:
      v <- DNAStringSet(v)
      alphabetFrequency(v, baseOnly=TRUE)

      ## Comparing efficiencies:
      if (interactive()) {
        library(hgu95av2probe)
        system.time(y1 <- countbases(hgu95av2probe$sequence))
        x <- DNAStringSet(hgu95av2probe$sequence)
        system.time(y2 <- alphabetFrequency(x, baseOnly=TRUE))
      }

