R/TCnormalize.count.R

TCnormalize.count <-
function(X, round=TRUE, add.one=TRUE, print=FALSE){
    mat = as.matrix(X)
    cSum = colSums(mat)
    c0 = 1/cSum*mean(cSum)
    tccount = sweep( mat, 2, FUN='*', c0)
    if (add.one) tccount = tccount+1
    if (round) tccount = round(tccount)
    if (print) {
        cat("before","\n")
        print(cSum)
        cat("after","\n")
        print( colSums(tccount) )
        cat("size factor","\n")
        print(c0)
        }
    return(tccount)
    }

Try the sgRSEA package in your browser

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

sgRSEA documentation built on May 2, 2019, 2:47 p.m.