View source: R/runNormalization.R
runNormalization | R Documentation |
Calculate normalization factors to scale library sizes, using the TMM (trimmed mean of
M-values) method implemented in edgeR
.
runNormalization(rs_data, norm_method = "TMM")
rs_data |
|
norm_method |
Normalization method to use. Options are |
Normalization factors are used to scale the raw library sizes (total read counts per
sample). We use the TMM (trimmed mean of M-values) normalization method (Robinson and
Oshlack, 2010), as implemented in the edgeR
package.
For more details, see the documentation for calcNormFactors
in
the edgeR
package.
This step should be performed after filtering with filterZeros
and
filterLowCounts
. The normalization factors are then used by
limma-voom
in the next step (runVoom
).
The normalization factors are stored in a new column named norm_factors
in the
column meta-data (colData
slot) of the RegspliceData
object. The colData
can be accessed with the accessor function
colData()
.
Normalization should be skipped when using exon microarray data. (When using the
regsplice
wrapper function, normalization can be disabled with the
argument normalize = FALSE
).
Previous step: Filter low-count exon bins with filterLowCounts
.
Next step: Calculate limma-voom
transformation and weights with
runVoom
.
Returns a RegspliceData
object. Normalization factors are
stored in the column norm_factors
in the column meta-data (colData
slot), which can be accessed with the colData()
accessor function.
filterLowCounts
runVoom
file_counts <- system.file("extdata/vignette_counts.txt", package = "regsplice")
data <- read.table(file_counts, header = TRUE, sep = "\t", stringsAsFactors = FALSE)
head(data)
counts <- data[, 2:7]
tbl_exons <- table(sapply(strsplit(data$exon, ":"), function(s) s[[1]]))
gene_IDs <- names(tbl_exons)
n_exons <- unname(tbl_exons)
condition <- rep(c("untreated", "treated"), each = 3)
rs_data <- RegspliceData(counts, gene_IDs, n_exons, condition)
rs_data <- filterZeros(rs_data)
rs_data <- filterLowCounts(rs_data)
rs_data <- runNormalization(rs_data)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.