R/calc_p.R

Defines functions calc_p

Documented in calc_p

#' Estimation of p values
#' @param X list of matrices, where the first is the one obtained with real data
calc_p <- function(X){

  p <- matrix(0, nrow=nrow(X[[1]]), ncol=ncol(X[[1]]), dimnames = list(rownames(X[[1]]), colnames(X[[1]])))

  for(i in 1:length(X)){
    idx <- X[[i]] >= X[[1]]
    p[idx] <- p[idx] + 1
  }

  p <- p / length(X)

  return(p)


}
emosca-cnr/dmfind002 documentation built on May 16, 2024, 10:44 p.m.