[BioC] how limma compute the logFC in differential expression analysis
James W. MacDonald
jmacdon at med.umich.edu
Mon Jan 16 17:14:03 CET 2012
Hi Yuan,
On 1/14/2012 1:40 AM, Yuan Tian wrote:
> Hi,
>
> I'm using limma package to do differential expression analysis on a microarray data. May I know how the logFC is computed in the package?
>
> I start the analysis with a normalized, log2 transformed dataset and a matrix indicate the case and groups as
> fit<- lmFit((normalized,log2transformed data), design).
> cont.matrix<- makeContrasts(..., levels=design)
> fit2<- contrasts.fit(fit, cont.matrix)
> fit2<- eBayes(fit2)
> result= topTable(fit2, adjust="BH", number=nrow(data))
>
> A number of summary statistics are presented by topTable() for the top genes and the selected contrast. I manually compute the logFC for the 2 groups: G1mean=rowMeans(2^(normalized,log2transformed data in group1)), G2mean=rowMeans(2^(normalized,log2transformed data in group2)), FC=G2mean/G1mean, log2(FC).
>
> The log2(FC) is not consistent with the one in the summary statistics output by topTable()...
>
> Does the calculation of logFC depend on the variance?
No, but it all the computations are done in the log space (e.g., it
computes the geometric mean). Computing the arithmetic mean and then
converting to log_2 is not the same. You want
g1mean <- rowMeans(normalized data in grp1)
g2mean <- rowMeans(normalized data in grp2)
fc <- g1mean - g2mean
Best,
Jim
>
> Yuan
> [[alternative HTML version deleted]]
>
> _______________________________________________
> Bioconductor mailing list
> Bioconductor at r-project.org
> https://stat.ethz.ch/mailman/listinfo/bioconductor
> Search the archives: http://news.gmane.org/gmane.science.biology.informatics.conductor
--
James W. MacDonald, M.S.
Biostatistician
Douglas Lab
University of Michigan
Department of Human Genetics
5912 Buhl
1241 E. Catherine St.
Ann Arbor MI 48109-5618
734-615-7826
**********************************************************
Electronic Mail is not secure, may not be read every day, and should not be used for urgent or sensitive issues
More information about the Bioconductor
mailing list