mean and SD in output of Limma for differential-gene-expression
1
0
Entering edit mode
mheydarpour ▴ 10
@mheydarpour-9430
Last seen 5.2 years ago

Hi,

I have a bunch of genes wants to get gene-expression difference using Limma. In the output I would like to have Mean_Case + SD and Mean_Control + SD of each gene along with other parameters such as : gene-Name, log2FC, AveExpr, t, B, Pval, adj.P.Val.

any comments or suggestions!

 

Thanks,

Mahyar

limma mean sd • 1.2k views
ADD COMMENT
0
Entering edit mode
Aaron Lun ★ 28k
@alun
Last seen 6 minutes ago
The city by the bay

You don't provide any code or experimental design (read the posting guide!) so I'll just make some data up:

g <- gl(5, 2)
y <- matrix(rnorm(20*length(g)), nrow=20)
design <- model.matrix(~0 + g)
fit <- lmFit(y, design)
fit <- eBayes(fit)

The group means are simply the values in fit$coefficients, due to the use of a no-intercept experimental design. The standard deviations can be obtained as fit$sigma, or sqrt(fit$s2.post) if you want the values after empirical Bayes shrinkage. Of course, if you're looking at the mean expression within each group, I suspect that you actually want the standard errors of the mean; these can be obtained as fit$stdev.unscaled * sqrt(fit$s2.post).

Everything else that you want is just the output of topTable() and can be obtained by calling the function with sort.by="none". Just cbind the results together to get a single data.frame object.

ADD COMMENT

Login before adding your answer.

Traffic: 772 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6