Question: Question about difference between decideTests() and classifyTestsP() in limma
gravatar for lmsh
3 months ago by
lmsh0 wrote:

I am using limma to find differentially expressed genes between 2 tumor types. My gene expression matrix has 31 samples in one group and 59 samples in the other, and 58581 gene expression measurements.

These are the R commands I've run (having previously defined df as my expression matrix, and design and cont.matrix with my sample grouping info):

y <- DGEList(df)

v <- voom(y, design, plot=FALSE)

vfit <- lmFit(v, design)

vfit <-, contrasts=cont.matrix)

efit <- eBayes(vfit)

Now I would like to get significantly differentially expressed genes.

If I run: summary(decideTests(efit))

I get 645 genes down in my test group and 1116 genes up in my test group.

However, if I run: summary(classifyTestsP(efit))

I get 3362 genes down in my test group and 3730 genes up in my test group.

In both cases, the gene numbers of course change if I adjust the p.value away from default, but the decideTests() result is still very different from the classifyTestsP() result.

I have read all the documentation I can find on decideTests() and classifyTests() but I still have 2 questions:

1) What type of test does decideTests() call by default? Here: it says "The functions described here are called by decideTests. Most users should use decideTests rather than using these functions directly." but it does not say which function is being called by decideTests by default, or why I would want to use decideTests() rather than using one of the other functions directly.

2) What is the exact function of classifyTestsP()? According to this: since I only have 1 contrast in my linear model, classifyTestsP() should not be conducting any p value adjustment, so why is it so different from decideTests()? I also cannot find the "documentation entry for classifyTestsP()" referred to in the answer to the linked question.

If you are able to point me to some documentation that will answer my questions, I would be very grateful. Thank you.

limma • 104 views
ADD COMMENTlink modified 3 months ago by Gordon Smyth37k • written 3 months ago by lmsh0
Answer: Question about difference between decideTests() and classifyTestsP() in limma
gravatar for Gordon Smyth
3 months ago by
Gordon Smyth37k
Walter and Eliza Hall Institute of Medical Research, Melbourne, Australia
Gordon Smyth37k wrote:

You say that you've read all the documentation you can find, but intention is that you will read the documentation that comes with limma rather than doing google searches for anything that comes up. To find out about decideTests and classifyTestsP just type


at the R prompt. There is also an extensive User's Guide than you can access either through the Windows GUI or by typing limmaUsersGuide().

The page you have found is for limma 3.28.14, which was five Bioconductor releases ago. The Bioconductor support question you found is from 15 years ago. While these old pages are mostly still correct, it's naturally better to read the current documentation.

I am not clear why you are using classifyTestsP even though the documention has advised you not do. Anyway, the differences between the functions are explained on the help pages. The help page for decideTests says:

multiple testing strategies are offered that adjust for multiple testing down the genes ...

so decideTests is adjusting for doing the same test for multiple genes. From the "Usage" line, you can see that the default correction method is "BH" or Benjamini and Hochberg. By contrast, the classifyTestsP help page says:

Note that these functions do not adjust for multiple testing across genes.

You can see the key difference between the functions just from the titles of the help pages. The decideTests help page is titled Multiple Testing Across Genes and Contrasts whereas the classifyTestsP page is titled Multiple Testing Genewise Across Contrasts.

Obviously, for most practical analyses, it is very important that you do adjust for multiple testing across the genes. You've correctly noted that classifyTestsP isn't doing any such adjustment, so isn't it to be expected that decideTests will give more correct and conservative results?

If you are curious what classifyTestsP is for, it is used by decideTests at a lower level if you set adjust="hierarchical". I suggest you stick to the defaults though.

ADD COMMENTlink modified 3 months ago • written 3 months ago by Gordon Smyth37k
Please log in to add an answer.


Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 16.09
Traffic: 141 users visited in the last hour