Question: Getting Significance for second factor (bioreplicate/subject) when using limma.
0
19 months ago by
wewolski10
Zurich
wewolski10 wrote:

Daer Forum,

I want to get an estimate of the pairing variable BioReplicate

What I would do when using linear model is:

x1<-rnorm(10)
x2<-1+rnorm(10)

# Now create a dataframe for lme
myDat <- data.frame(c(x1,x2), c(rep("x1", 10), rep("x2", 10)), rep(paste("S", seq(1,10), sep=""), 2))
names(myDat) <- c("y", "Condition", "BioReplicate")
anova(lm(y ~ Condition + BioReplicate, data = myDat))

Which produces

> anova(lm(y ~ Condition + BioReplicate, data = myDat)) Analysis of Variance Table

Response: y              Df  Sum Sq Mean Sq F value  Pr(>F)   Condition     1  8.6975  8.6975  5.1585 0.04926 * BioReplicate  9  5.8334  0.6482  0.3844 0.91470   Residuals     9 15.1744  1.6860                   --- Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

With limma, I am fitting :

fit <- limma::lmFit(grp2$getNormalized()$data, model.matrix(~ Condition + BioReplicate, grp2\$annotation_)​)

fit.eb <- limma::eBayes(fit) limma::topTable(fit.eb)

But topTable produces an output similar to that of summary.lm why I am looking for an output similar to anova.lm.

I wish everyone a beautiful day

regards

Witek

limma anova • 263 views
modified 19 months ago by Aaron Lun25k • written 19 months ago by wewolski10
Answer: Getting Significance for second factor (bioreplicate/subject) when using limma.
0
19 months ago by
Aaron Lun25k
Cambridge, United Kingdom
Aaron Lun25k wrote:

Firstly, the output of topTable is not like summary.lm. The rows of the topTable output contain coefficient estimates and test results for different genes; the rows in the Coefficients: table of summary.lm contain estimates and the test results for different coefficients.

This cuts to the heart of your question - what exactly do you want to show in the rows of your output? If you want to show test results for different coefficients in the rows, you'll have to store the results for different genes along another dimension. This can get pretty messy very quickly.

It seems that the closest analogue to what you want to do is write.fit, which will produce a file where each row corresponds to a gene and contains test results for all coefficients for that gene (in the columns).

More generally, your topTable call above will not test for the effect of the pairing variable. You'll want to drop only the coefficients corresponding to the pairing variable, e.g., coef=3:11 based on myDat.