interpolateHelper           package:edgeR           R Documentation

_Q_u_a_n_t_i_l_e _A_d_j_u_s_t_m_e_n_t _i_n_t_e_r_p_o_l_a_t_o_r

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

     Helper function to interpolate the quantile function

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

      
     interpolateHelper(mu, p, r, count.max, verbose=TRUE) 

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

      mu: matrix of means

       p: matrix of percentiles

       r: scalar, vector or matrix of 'size' parameters

count.max: vector of maximum counts for all tags

 verbose: whether to write comments, default 'true'

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

     matrix with quantile-adjusted pseudodata

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

     Mark Robinson, Davis McCarthy

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

     y<-matrix(rnbinom(10000,size=2,mu=10),ncol=4)
     d<-DGEList(data=y,group=rep(1:2,each=2),lib.size=rep(c(1000,1010),2))
     ps<-estimatePs(d,r=2)
     N<-prod(d$lib.size)^(1/ncol(d$data))
     perc<-pnbinom(d$data-1,size=2,mu=outer(ps$p.common,d$lib.size))+dnbinom(d$data,size=2,mu=outer(ps$p.common,d$lib.size))/2
     maxcounts<-apply(d$data,1,max)
     pseudo<-interpolateHelper(outer(ps$p.common,rep(N,4)),perc,r=2,maxcounts)

