Learn R Programming

plmDE (version 1.0)

limmaPLM: Adapt Additive Partially Linear Models for Testing via limma

Description

Uses the methods of fitGAPLM to generate linear models of the class MArrayLM so that the moderated t and F methods of limma may be used to test for differential gene expression. See fitGAPLM for more a more in-depth description of the inputs.

Usage

limmaPLM(dataObject, intercept = TRUE, indicators = as.character(unique(dataObject$sampleInfo[,2])[-1]), continuousCovariates = NULL, groups = as.character(unique(dataObject$sampleInfo[,2])[-1]), groupFunctions = rep("AdditiveSpline", length(groups)), fitSplineFromData = TRUE, splineDegrees = rep(3, length(groups)), splineKnots = rep(0, length(groups)), splineKnotSpread = "quantile", ...)

Arguments

dataObject
An object of type plmDE which we wish to test for differential gene expression.
intercept
Should an intercept term be included in the model?
indicators
Same as indicators.fullModel in fitGAPLM. Note that choice of intercept should affect choice of indicators.
continuousCovariates
Same as continuousCovariates.fullModel in fitGAPLM.
groups
Same as groups.fullModel in fitGAPLM.
groupFunctions
Same as groupFunctions.fullModel in fitGAPLM.
fitSplineFromData
Same as fitSplineFromData in fitGAPLM.
splineDegrees
Same as splineDegrees.fullModel in fitGAPLM.
splineKnots
Same as splineKnots.fullModel in fitGAPLM.
splineKnotSpread
Same as splineKnotSpread in fitGAPLM.
...
parameters to be passed to lmFit in limma.

Value

This method returns an MarrayLM object on which we can call eBayes() and topTable() to test for differentially expressed genes.

References

Smyth, G. K. Linear Models and empirical Bayes methods for assesing differential expression in microarray experiments. Stat Appl Genet Mol Biol. 3, Article 3 (2004).

See Also

fitGAPLM, plmDE, limma

Examples

Run this code
## create an object of type \code{plmDE} containing disease 
## with "control" and "disease" and measurements of weight and severity:
ExpressionData = as.data.frame(matrix(abs(rnorm(10000, 1, 1.5)), ncol = 100))
names(ExpressionData) = sapply(1:100, function(x) paste("Sample", x))
Genes = sapply(1:100, function(x) paste("Gene", x))
DataInfo = data.frame(sample = names(ExpressionData), group = c(rep("Control", 50), 
rep("Diseased", 50)), weight = abs(rnorm(100, 50, 20)), severity = c(rep(0, 50), 
abs(rnorm(50, 100, 20))))
plmDEobject = plmDEmodel(Genes, ExpressionData, DataInfo)

## create a linear model from which various hypotheses can be tested:
toTest = limmaPLM(plmDEobject, continuousCovariates = c("weight", "severity"),
 fitSplineFromData = TRUE, splineDegrees = rep(3, length(groups)),
 splineKnots = rep(0, length(groups)), splineKnotSpread = "quantile")

## view the coefficients/variables in the model:
toTest$coefficients[1, ]
weightCoefficients = c("DiseasedBasisFunction.weight.1", 
"DiseasedBasisFunction.weight.2", "DiseasedBasisFunction.weight.3", 
"DiseasedBasisFunction.weight.4", "DiseasedBasisFunction.weight.5", 
"DiseasedBasisFunction.weight.6", "DiseasedBasisFunction.weight.7", 
"DiseasedBasisFunction.weight.8", "DiseasedBasisFunction.weight.9")

## test the significance of weight in variation of the expression levels:
toTestCoefficients = contrasts.fit(toTest, coefficients = weightCoefficients)
moderatedTest = eBayes(toTestCoefficients)
topTableF(moderatedTest)

Run the code above in your browser using DataLab