https://github.com/ctlab/phantasus
Revision 7682b610be7f6d26e9802883447f8a18092e1d62 authored by baba-beda on 17 October 2017, 15:08:52 UTC, committed by baba-beda on 17 October 2017, 15:08:52 UTC
1 parent b19c321
Raw File
Tip revision: 7682b610be7f6d26e9802883447f8a18092e1d62 authored by baba-beda on 17 October 2017, 15:08:52 UTC
V0.99.23
Tip revision: 7682b61
quantileNormalization.R
quantileNormalization <- function(es, cols = c(), rows = c()) {
    exprs <- exprs(es)
    if (is.null(cols)) {
        cols <- 0:(ncol(exprs) - 1)
    }
    if (is.null(rows)) {
        rows <- 0:(nrow(exprs) - 1)
    }
    exprs <- exprs[rows + 1, cols + 1]
    exprs(es)[rows + 1, cols + 1] <- normalizeBetweenArrays(log2(exprs + 1),
                                                            method = "quantile")
    assign("es", es, envir = parent.frame())
    f <- tempfile(pattern = "qn", tmpdir = getwd(), fileext = ".bin")
    toSerialize <- list(data = exprs(es)[rows + 1, cols + 1])
    writeBin(protolite::serialize_pb(toSerialize), f)
    f
}
back to top