Problem with limma's topTable lfc filter when more than 1 contrast is in output
1
0
Entering edit mode
@vladimir-zhurov-4990
Last seen 10.3 years ago
> ... Dear Bioconductors, I am having the following problem which can be due to a misunderstanding, or an actual problem with topTable function in limma package. As far as I understand lfc and p filters should work together in filtering topTable results. Am I correct in this regard? If it is an intended situation then the problem is the following: when more than one contrasts is reported lfc filter does not affect the output. Which is shown in the sample R session below. I would appreciate you help. Regards. Vladimir. $ uname -a Linux 2.6.32-37-generic #81-Ubuntu SMP Fri Dec 2 20:32:42 UTC 2011 x86_64 GNU/Linux Sample R session: R version 2.14.1 (2011-12-22) Copyright (C) 2011 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: x86_64-pc-linux-gnu (64-bit) R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. Natural language support but running in an English locale R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > # load data > library("ALLMLL") Loading required package: affy Loading required package: Biobase Welcome to Bioconductor Vignettes contain introductory material. To view, type 'browseVignettes()'. To cite Bioconductor, see 'citation("Biobase")' and for packages 'citation("pkgname")'. > data("MLL.A") > # calculate RMA measures for the first 6 arrays > eset<-rma(MLL.A[,1:6]) Loading required package: AnnotationDbi Background correcting Normalizing Calculating Expression > # load and proceed with limma. lets have 3 groups of 2 arrays > library("limma") > design <- model.matrix(~ 0+factor(c(1,1,2,2,3,3))) > colnames(design)<-c("G1", "G2", "G3") > # lets make all pair-wise comparisons > contrast.matrix <- makeContrasts(G1-G2, G1-G3, G2-G3, levels=design) > fit<-lmFit(eset, design) > fit.c<-contrasts.fit(fit, contrast.matrix) > fit.eb<-eBayes(fit.c) > # create topTable's with different filters and check dimensions > # lets output data for all comparisons and adjust lfc > tt.1<-topTable(fit.eb, number=Inf, p=0.05, adjust.method="none") > dim(tt.1) [1] 1482 8 > tt.2<-topTable(fit.eb, number=Inf, p=0.05, adjust.method="none", lfc=2) > dim(tt.2) [1] 1482 8 > tt.3<-topTable(fit.eb, number=Inf, p=0.05, adjust.method="none", lfc=10) > dim(tt.3) [1] 1482 8 > # we have 3 identical tables with no effect of lfc filter > # lets output data for all comparisons and adjust lfc > # p value will be at 1 and have no effect > tt.1p<-topTable(fit.eb, number=Inf, adjust.method="none") > dim(tt.1p) [1] 22283 8 > tt.2p<-topTable(fit.eb, number=Inf, adjust.method="none", lfc=2) > dim(tt.2p) [1] 22283 8 > tt.3p<-topTable(fit.eb, number=Inf, adjust.method="none", lfc=10) > dim(tt.3p) [1] 22283 8 > # we have 3 identical tables with no effect of lfc filter > # lets output data for just the 1st comparison and adjust lfc > tt.1c<-topTable(fit.eb, number=Inf, p=0.05, adjust.method="none", coef=1) > dim(tt.1c) [1] 806 7 > tt.2c<-topTable(fit.eb, number=Inf, p=0.05, adjust.method="none", lfc=2, + coef=1) > dim(tt.2c) [1] 26 7 > tt.3c<-topTable(fit.eb, number=Inf, p=0.05, adjust.method="none", lfc=10, + coef=1) > dim(tt.3c) [1] 0 0 > # now lfc filter works > > traceback() No traceback available > warnings() NULL > sessionInfo() R version 2.14.1 (2011-12-22) Platform: x86_64-pc-linux-gnu (64-bit) locale: [1] LC_CTYPE=en_CA.UTF-8 LC_NUMERIC=C [3] LC_TIME=en_CA.UTF-8 LC_COLLATE=en_CA.UTF-8 [5] LC_MONETARY=en_CA.UTF-8 LC_MESSAGES=en_CA.UTF-8 [7] LC_PAPER=C LC_NAME=C [9] LC_ADDRESS=C LC_TELEPHONE=C [11] LC_MEASUREMENT=en_CA.UTF-8 LC_IDENTIFICATION=C attached base packages: [1] stats graphics grDevices utils datasets methods base other attached packages: [1] limma_3.10.1 hgu133acdf_2.9.1 AnnotationDbi_1.16.11 [4] ALLMLL_1.2.11 affy_1.32.0 Biobase_2.14.0 loaded via a namespace (and not attached): [1] affyio_1.22.0 BiocInstaller_1.2.1 DBI_0.2-5 [4] IRanges_1.12.5 preprocessCore_1.16.0 RSQLite_0.11.1 [7] tools_2.14.1 zlibbioc_1.0.0
limma limma • 1.1k views
ADD COMMENT
0
Entering edit mode
@alex-gutteridge-2935
Last seen 10.3 years ago
United States
On 20.01.2012 05:11, Vladimir Zhurov wrote: >> ... > > Dear Bioconductors, > > I am having the following problem which can be due to a > misunderstanding, > or an actual problem with topTable function in limma package. > > As far as I understand lfc and p filters should work together in > filtering > topTable results. Am I correct in this regard? > > If it is an intended situation then the problem is the following: > when more > than one contrasts is reported lfc filter does not affect the output. > Which > is shown in the sample R session below. > > I would appreciate you help. > > Regards. > > Vladimir. > Hi Vladimir, I think the issue maybe that it is not clear (to me anyway!) what result one would expect with a lfc filter on a table with multiple contrasts. Should rows where all contrasts are above the cutoff be reported? Or where any are? It doesn't seem to be explicit in the docs, but my assumption is that to avoid confusion topTable ignores lfc= in the case you describe. Perhaps decideTests() is what you are really looking for? You can then index a topTable generated data.frame with the results of decideTests. E.g (pseudo-code not tested!) tt = topTable(fit,p.value=1,number=Inf,sort.by="none") dt = decideTests(fit,p.value=0.05,lfc=1) tt[dt[,1] != 0 & dt[,2] != 0 & dt[,3] !=0,] #Gives rows where all contrasts pass filter (assuming 3 contrasts) tt[dt[,1] != 0 | dt[,2] != 0 | dt[,3] !=0,] #Gives rows where any contrast passes filter -- Alex Gutteridge
ADD COMMENT

Login before adding your answer.

Traffic: 464 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