R/ratio.zScore.R

Defines functions ratio.zScore

ratio.zScore <- function(A, B, background=1){
    stopifnot(length(A)==length(B))
    r <- log2(A+background) - log2(B+background)
    ## check distribution?
    ## normal distribution
    pop_sd <- sd(r) * sqrt((length(r)-1)/length(r))
    pop_mean <- mean(r)
    z <- (r - pop_mean)/pop_sd
    z
}
LihuaJulieZhu/ChIPpeakAnno documentation built on Aug. 5, 2020, 12:02 a.m.