Description Usage Arguments Value References See Also Examples
Implementation of the procedure described in Law et al. for estimating precision weights from RNA-seq data.
1 2 3 4 5 6 7 8 | voom_weights(
y,
x,
preprocessed = FALSE,
doPlot = FALSE,
lowess_span = 0.5,
R = NULL
)
|
y |
a matrix of size |
x |
a matrix of size |
preprocessed |
a logical flag indicating whether the expression data have
already been preprocessed (e.g. log2 transformed). Default is |
doPlot |
a logical flag indicating whether the mean-variance plot should be drawn.
Default is |
lowess_span |
smoother span for the lowess function, between 0 and 1. This gives
the proportion of points in the plot which influence the smooth at each value.
Larger values give more smoothness. Default is |
R |
library.size (optional, important to provide if |
a vector of length n
containing the computed precision weights
Law, C. W., Chen, Y., Shi, W., & Smyth, G. K. (2014). voom: Precision weights unlock linear model analysis tools for RNA-seq read counts. Genome Biology, 15(2), R29.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | #rm(list=ls())
set.seed(123)
G <- 10000
n <- 12
p <- 2
y <- sapply(1:n, FUN=function(x){rnbinom(n=G, size=0.07, mu=200)})
x <- sapply(1:p, FUN=function(x){rnorm(n=n, mean=n, sd=1)})
my_w <- voom_weights(y, x, doPlot=TRUE)
if (requireNamespace("limma", quietly = TRUE)) {
w_voom <- limma::voom(counts=y, design=x, plot=TRUE) #slightly faster - same results
all.equal(my_w, w_voom$weights)
}
## Not run:
microbenchmark::microbenchmark(limma::voom(counts=t(y), design=x, plot=FALSE),
voom_weights(x, y, doPlot=FALSE), times=30)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.