R/estimateQ.R

Defines functions estimateQ

.estimateQ <- function(meth,unmeth,size_t,size_c,p,useAll=TRUE){
  if (useAll) {
    temp_t <- t(t(meth)/size_t)
    temp_c <- t(t(unmeth)/size_c)
    temp_n <- temp_t+temp_c
    q <- rowSums(temp_n)/length(size_t)
  } else {
    temp_c <- t(t(unmeth)/size_c)
    qc <- rowMeans(temp_c)
    q <- qc/(1-p)
  }
  
  q[is.na(q)] <- 0
  return(q)
  # which(is.na(q))
  # which(is.infinite(q))  
}

Try the QNB package in your browser

Any scripts or data that you put into this service are public.

QNB documentation built on Nov. 17, 2017, 8:09 a.m.