RUVfit | R Documentation |
Provides an interface similar to lmFit
from
limma
to the RUV2
, RUV4
,
RUVinv
and RUVrinv
functions from the
ruv
package, which facilitates the removal of unwanted
variation in a differential methylation analysis. A set of negative control
variables, as described in the references, must be specified.
RUVfit(
Y,
X,
ctl,
Z = 1,
k = NULL,
method = c("inv", "rinv", "ruv4", "ruv2"),
...
)
Y |
numeric |
X |
The factor(s) of interest. A m by p matrix, where m is the number
of samples and p is the number of factors of interest. Very often p = 1.
Factors and dataframes are also permissible, and converted to a matrix by
|
ctl |
logical vector, |
Z |
Any additional covariates to include in the model, typically a m by
q matrix. Factors and dataframes are also permissible, and converted to a
matrix by |
k |
integer, required if |
method |
character string, indicates which |
... |
additional arguments that can be passed to |
This function depends on the ruv
package and is used to
estimate and adjust for unwanted variation in a differential methylation
analysis. Briefly, the unwanted factors W
are estimated using
negative control variables. Y
is then regressed on the variables
X
, Z
, and W
. For methylation data, the analysis is
performed on the M-values, defined as the log base 2 ratio of the methylated
signal to the unmethylated signal.
A list
containing:
betahat |
The estimated coefficients of the factor(s) of interest. A p by n matrix. |
sigma2 |
Estimates of the features' variances. A vector of length n. |
t |
t statistics for the factor(s) of interest. A p by n matrix. |
p |
P-values for the factor(s) of interest. A p by n matrix. |
Fstats |
F statistics for testing all of the factors in X simultaneously.. |
Fpvals |
P-values for testing all of the factors in X simultaneously. |
multiplier |
The
constant by which |
df |
The number of residual degrees of freedom. |
W |
The estimated unwanted factors. |
alpha |
The estimated coefficients of W. |
byx |
The coefficients in a regression of Y on X (after both Y and X have been "adjusted" for Z). Useful for projection plots. |
bwx |
The coefficients in a regression of W on X (after X has been "adjusted" for Z). Useful for projection plots. |
X |
|
k |
|
ctl |
|
Z |
|
fullW0 |
Can be used to
speed up future calls of |
include.intercept |
|
method |
Character variable with value indicating which RUV method was used. Included for reference. |
Jovana Maksimovic
Gagnon-Bartsch JA, Speed TP. (2012). Using control genes to correct for unwanted variation in microarray data. Biostatistics. 13(3), 539-52. Available at: http://biostatistics.oxfordjournals.org/content/13/3/539.full.
Gagnon-Bartsch, Jacob, and Speed. 2013. Removing Unwanted Variation from High Dimensional Data with Negative Controls. Available at: http://statistics.berkeley.edu/tech-reports/820.
RUV2
, RUV4
, RUVinv
,
RUVrinv
, topRUV
if(require(minfi) & require(minfiData) & require(limma)) {
# Get methylation data for a 2 group comparison
meth <- getMeth(MsetEx)
unmeth <- getUnmeth(MsetEx)
Mval <- log2((meth + 100)/(unmeth + 100))
group <- factor(pData(MsetEx)$Sample_Group)
design <- model.matrix(~group)
# Perform initial analysis to empirically identify negative control features
# when not known a priori
lFit <- lmFit(Mval,design)
lFit2 <- eBayes(lFit)
lTop <- topTable(lFit2,coef=2,num=Inf)
# The negative control features should *not* be associated with factor of
# interest but *should* be affected by unwanted variation
ctl <- rownames(Mval) %in% rownames(lTop[lTop$adj.P.Val > 0.5,])
# Perform RUV adjustment and fit
fit <- RUVfit(Y=Mval, X=group, ctl=ctl)
fit2 <- RUVadj(Y=Mval, fit=fit)
# Look at table of top results
top <- topRUV(fit2)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.