#' @title Normalize RNA-seq or miRNA-seq dataset with RMA method
#'
#' @description \code{rmaNormalizer} normalizes RNA-seq expression dataset using RMA method (without median polish step).
#'
#' @param data A data matrix, with rows referring to genes/microRNAs and columns to samples.
#'
#' @return A data matrix with normalized gene/microRNA expression data. A scatter plots of NA proportions across samples and genes/microRNAs.
#'
#' @importFrom oligo backgroundCorrect
#' @importFrom limma normalizeBetweenArrays
#'
#' @export rmaNormalizer
#'
#' @examples
#' rmaNormalizer(data.m)
rmaNormalizer <- function(data.m){
# NAs
data.m[which(is.na(data.m), arr.ind = TRUE)] <- 0
# RMA for background correction
data.bg <- backgroundCorrect(data.m, method = 'rma')
dimnames(data.bg) <- dimnames(data.m)
# Log2 transformation
data.bg.log <- log2(data.bg)
print('Done log2 transformation')
# quantile normalization
data.bg.log.qn <- normalizeBetweenArrays(data.bg.log)
print('Done quantile normalization')
data.bg.log.qn
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.