Learn R Programming

missMethyl (version 1.6.2)

topRUV: Table of top-ranked differentially methylated CpGs obatained from a differential methylation analysis using RUV

Description

Extract a table of the top-ranked CpGs from a linear model fit after performing a differential methylation analysis using RUVfit.

Usage

topRUV(fit, number=10, p.value.cut = 1, 
cut.on = c("p.ebayes.BH","p.BH","p.rsvar.BH","p.evar.BH","p.rsvar.ebayes.BH"),
sort.by = c("p.ebayes.BH","p.BH","p.rsvar.BH","p.evar.BH","p.rsvar.ebayes.BH"))

Arguments

fit
An object containing a linear model fit produced by RUVfit, followed by RUVadj. The fit object should be of class MArrayLM.
number
integer, maximum number of genes to list. Default is 10.
p.value.cut
numeric, cutoff value for adjusted p-values. Only features with lower p-values are listed. Must ve between 0 and 1. Default is 1.
cut.on
numeric, the type of adjusted p-value that the cutoff should be applied to. Default is p.ebayes.BH. Other options are: p.BH, p.rsvar.BH, p.evar.BH or p.rsvar.ebayes.BH.
sort.by
character string, the type of adjusted p-value that should be used for sorting. Default is p.ebayes.BH. Other options are: p.BH, p.rsvar.BH, p.evar.BH or p.rsvar.ebayes.BH.

Value

  • Produces a dataframe with rows corresponding to the top number CpGs and the following columns:
  • coefficientsThe estimated coefficients of the factor(s) of interest.
  • sigma2Estimates of the features' variances.
  • tt statistics for the factor(s) of interest.
  • pP-values for the factor(s) of interest.
  • multiplierThe constant by which sigma2 must be multiplied in order to get an estimate of the variance of coefficients
  • dfThe number of residual degrees of freedom.
  • WThe estimated unwanted factors.
  • alphaThe estimated coefficients of W.
  • byxThe coefficients in a regression of Y on X (after both Y and X have been "adjusted" for Z). Useful for projection plots.
  • bwxThe coefficients in a regression of W on X (after X has been "adjusted" for Z). Useful for projection plots.
  • XX. Included for reference.
  • kk. Included for reference.
  • ctlctl. Included for reference.
  • ZZ. Included for reference.
  • fullW0Can be used to speed up future calls of RUVfit.
  • The following columns may or may not be present depending on the options selected when RUVadj was run:
  • p.rsvarP-values, after applying the method of rescaled variances.
  • p.evarP-values, after applying the method of empirical variances.
  • p.ebayesP-values, after applying the empirical bayes method of Smyth (2004).
  • p.rsvar.ebayesP-values, after applying the empirical bayes method of Smyth (2004) and the method of rescaled variances.
  • p.BHP-values adjusted for false discovery rate (FDR) using the method of Benjamini and Hochberg (1995).
  • p.rsvar.BHFDR-adjusted p-values, after applying the method of rescaled variances.
  • p.evar.BHFDR-adjusted p-values, after applying the method of empirical variances.
  • p.ebayes.BHFDR-adjusted p-values, after applying the empirical bayes method of Smyth (2004).
  • p.rsvar.ebayes.BHFDR-adjusted p-values, after applying the empirical bayes method of Smyth (2004) and the method of rescaled variances.

Details

This function summarises the results of a differential methylation analysis performed using RUVfit, followed by RUVadj. The top ranked CpGs are selected by first ranking the adjusted p-values (Default: p.ebayes.BH), then ranking the raw p-values (Default: p.ebayes).

References

Benjamini, Y., and Hochberg, Y. (1995). Controlling the false discovery rate: a practical and powerful approach to multiple testing. Journal of the Royal Statistical Society Series, B, 57, 289-300. Smyth, G. K. (2004). Linear models and empirical Bayes methods for assessing differential expression in microarray experiments. Statistical Applications in Genetics and Molecular Biology, Volume 3, Article 3. http://www.statsci.org/smyth/pubs/ebayes.pdf.

See Also

RUVfit, RUVadj, MArrayLM

Examples

Run this code
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(data=Mval, design=design, coef=2, ctl=ctl)
fit2 = RUVadj(fit)

# Look at table of top results
top = topRUV(fit2)
}

Run the code above in your browser using DataLab