View source: R/voomWithDreamWeights.R
voomWithDreamWeights | R Documentation |
dream()
Transform count data to log2-counts per million (logCPM), estimate the mean-variance relationship and use this to compute appropriate observation-level weights. The data are then ready for linear mixed modelling with dream()
. This method is the same as limma::voom()
, except that it allows random effects in the formula
voomWithDreamWeights(
counts,
formula,
data,
lib.size = NULL,
normalize.method = "none",
span = 0.5,
weights = NULL,
prior.count = 0.5,
prior.count.for.weights = prior.count,
plot = FALSE,
save.plot = TRUE,
rescaleWeightsAfter = FALSE,
scaledByLib = FALSE,
priorWeightsAsCounts = FALSE,
BPPARAM = SerialParam(),
...
)
counts |
a numeric |
formula |
specifies variables for the linear (mixed) model. Must only specify covariates, since the rows of exprObj are automatically used as a response. e.g.: |
data |
|
lib.size |
numeric vector containing total library sizes for each sample. Defaults to the normalized (effective) library sizes in |
normalize.method |
the microarray-style normalization method to be applied to the logCPM values (if any). Choices are as for the |
span |
width of the lowess smoothing window as a proportion. Setting |
weights |
Can be a numeric matrix of individual weights of same dimensions as the |
prior.count |
average count to be added to each observation to avoid taking log of zero. The count applied to each sample is normalized by library size so given equal log CPM for a gene with zero counts across multiple samples |
prior.count.for.weights |
count added to regularize weights |
plot |
logical, should a plot of the mean-variance trend be displayed? |
save.plot |
logical, should the coordinates and line of the plot be saved in the output? |
rescaleWeightsAfter |
default = FALSE, should the output weights be scaled by the input weights |
scaledByLib |
if |
priorWeightsAsCounts |
if |
BPPARAM |
parameters for parallel evaluation |
... |
other arguments are passed to |
Adapted from voom()
in limma
v3.40.2
An EList
object just like the result of limma::voom()
limma::voom()
# library(variancePartition)
library(edgeR)
library(BiocParallel)
data(varPartDEdata)
# normalize RNA-seq counts
dge <- DGEList(counts = countMatrix)
dge <- calcNormFactors(dge)
# specify formula with random effect for Individual
form <- ~ Disease + (1 | Individual)
# compute observation weights
vobj <- voomWithDreamWeights(dge[1:20, ], form, metadata)
# fit dream model
res <- dream(vobj, form, metadata)
res <- eBayes(res)
# extract results
topTable(res, coef = "Disease1", number = 3)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.