R/SetupRA.R

#' @title Relative Synonymous Codon Usage
#'
#' @description
#' \code{SetupRA } creates a table of relative adaptiveness for yeast or based on carbon RA
#'
#' @details
#' Generation of manually set tables.
#'
#' @param s Species and subsettings, maybe one of
#' c('yeast', 'yeast2perc', 'yeast1perc', 'yeast05perc', 'yeasttop24protexpr', 'yeasttop24mrnaexpr')
#'or 'carbone' for computing carbone RA with standard values.
#' @return Numerical vector with relative adaptiveness for the 64 codons
#'
#' @author Roth, A.; Friberg, M.; Siegrist, F. and Cannarozzi, G. M. \email{gina@@cannarozzi.com}
#' @seealso \code{\link{statanacoseq}} \code{\link{ComputeCarboneRA}}
#' @keywords CodonBias
#' @examples
#' SetupRA('yeast2perc')
#'
#' @export

SetupRA <- function(s='yeast') {
  CodonProb <- c(0.9910, 0.9750, 0.9793, 0.9691, 0.9318, 0.9268, 0.8389, 0.9636,
              0.9622, 0.8830, 0.8633, 0.9223, 0.9179, 0.9598,      1, 0.9825,
              0.9720, 0.8660, 0.8883, 0.9223, 0.9530, 0.8176, 0.7371, 0.9253,
              0.5895, 0.5874, 0.4657, 0.8154, 0.9370, 0.7825, 0.8817, 0.9173,
              0.9832, 0.9475, 0.9284, 0.9727, 0.9341, 0.9249, 0.8082, 0.9614,
              0.8887, 0.8914, 0.8059, 0.9475, 0.9074, 0.9249, 0.9072, 0.9719,
              0, 0.9460,      0, 0.9436, 0.9328, 0.9347, 0.8408, 0.9737,
              0, 0.7542, 0.8870, 0.8534, 0.9722, 0.9748, 0.9819, 0.9703)
  if (s == 'yeast') {  # based on the original CAI paper by Shart and Li
    RA <- c(0.135,     1,     1, 0.053, 0.012,     1, 0.006, 0.921,
       1, 0.031, 0.003, 0.021, 0.003,     1,     1, 0.823,
       1,     1, 0.007, 0.245,     1, 0.009, 0.002, 0.047,
       0.002, 0.002, 0.002, 0.137, 0.039, 0.003, 0.003, 0.006,
       1,     1, 0.016, 0.554, 0.015, 0.316, 0.001,     1,
       0.002, 0.020, 0.004,     1, 0.002, 0.831, 0.018,     1,
       1,     1,     1, 0.071, 0.036, 0.693, 0.005,     1,
       1, 0.077,     1,     1, 0.117,     1,     1, 0.113)
  }
  else if ( s == 'yeast2perc') {
    RA <- c(0.1277, 1, 1, 0.08078603, 0.02564103, 0.9501, 0.01, 1, 1, 0.0313253,
       0.00159109, 0.03253012, 0.00383632, 1, 1, 0.8325, 1, 1, 0.00572082,
       0.2407, 1,  0.00333704, 0.01, 0.08676307, 0.01, 0.01, 0.01, 0.1687,
       0.04752971, 0.01, 0.00125078, 0.00562852, 1, 1, 0.01611863, 0.6806,
       0.00955593, 0.3007, 0.00337268, 1, 0.00286369, 0.01890034, 0.00229095, 1,
       0.00169635, 0.7625, 0.01526718, 1, 1, 1, 1, 0.08910891, 0.02409639, 0.6892,
       0.00120482, 1, 1, 0.05555556, 1, 1, 0.1451, 1, 1, 0.1765)
  }
  else if ( s == 'yeast1perc') {
      RA <- c(0.07619048, 1, 1, 0.04887218, 0.01160093, 1, 0.01, 0.9722, 1,
       0.02690583, 0.01, 0.02690583, 0.00233645, 1, 1, 0.7664, 1, 1, 0.01,
       0.2192, 1, 0.00190114, 0.01, 0.07984791, 0.01, 0.01,
       0.01, 0.1402, 0.03326180, 0.01, 0.00107296, 0.00536481, 1, 1,
       0.01156069, 0.6220, 0.00392542, 0.2826, 0.00098135, 1, 0.01, 0.01452282,
       0.00207469, 1, 0.01, 0.8253, 0.02028081, 1, 1, 1, 1, 0.06722689,
       0.01345291, 0.7691, 0.01, 1, 1, 0.08333333, 1, 1, 0.1159, 1, 1, 0.1405)
  }
  else if ( s == 'yeast05perc') {
    RA <- c(0.06239168, 1, 1, 0.025, 0.004329, 1, 0.01, 0.8095, 1,
       0.01877934, 0.01, 0.00938967, 0.00452489, 1, 1, 0.7285, 1, 1, 0.01,
       0.1574, 1, 0.01, 0.01, 0.04961832, 0.01, 0.01,
       0.01, 0.08362369, 0.02471910, 0.01, 0.01, 0.00449438, 1, 1,
       0.01518987, 0.5362, 0.01, 0.2367, 0.00189394, 1, 0.01, 0.00852878,
       0.00426439, 1, 0.01, 0.8644, 0.01261830, 1, 1, 1, 1, 0.05263158,
       0.00938967, 0.7793, 0.01, 1, 1, 0.1132, 1, 1, 0.07865169, 1, 1,
       0.08415842)
  }
  else if ( s == 'yeasttop24protexpr') {
    RA <- c(0.3403, 1, 1, 0.3230, 0.1646, 0.6951, 0.04268293, 1, 1, 0.09117647,
       0.04307692, 0.1059, 0.07407407, 0.6931, 1, 1, 1, 1, 0.1014, 0.7321, 1,
       0.03353659, 0.00914634, 0.1982, 0.01, 0.00923077, 0.01, 0.2308,
       0.1548, 0.01092896, 0.04007286, 0.07103825, 1, 0.9475, 0.1169, 1, 0.1366,
       0.3707, 0.02764228, 1, 0.03382353, 0.06470588, 0.02647059, 1, 0.07712766,
       0.7048, 0.09574468, 1, 1, 1, 1, 0.4009, 0.1324, 0.6029, 0.02941176, 1, 1,
       0.07865169, 1, 1, 0.357, 1, 1, 0.3927)
  }
  else if ( s == 'yeasttop24mrnaexpr') {
    RA <- c(0.1286, 1, 1, 0.08292683, 0.04761905, 1, 0.04761905, 0.9864, 1,
       0.03783784, 0.00904977, 0.02702703, 0.00621118, 1, 1, 0.677, 1, 1,
       0.00625, 0.17, 1, 0.00485437, 0.01941748, 0.09223301, 0.01, 0.00452489,
       0.01, 0.2081, 0.04885057, 0.00862069, 0.01, 0.01436782, 1, 1,
       0.00914634, 0.6516, 0.01081081, 0.327, 0.01, 1, 0.0080429, 0.02144772,
       0.00268097, 1, 0.01754386, 0.8816, 0.01754386, 1, 1, 1, 1, 0.08163265,
       0.07027027, 0.6757, 0.00540541, 1, 1, 0.125, 1, 1, 0.1782, 1, 1, 0.1019)
  }
  else if ( s == 'carbone') {
    RA <- ComputeCarboneRA()
  }
  else {
  stop('Error in SetupRA: not yet implemented for that organism', call. = FALSE)
  }
}
fredysiegrist/statanacoseq documentation built on May 16, 2019, 2:44 p.m.