One-sided tests with CAMERA-PR
1
0
Entering edit mode
@df6c68e9
Last seen 26 days ago
United States

I am not sure that this is the correct place to request new features, but I was wondering if it would be possible to add an alternative parameter to limma::cameraPR to perform one-sided tests? This could be implemented using the following code, which replaces lines 64 to 67 in cameraPR.default (line numbers based on Viewing the function).

# Matches t.test options (this goes near the top of the function)
alternative <- match.arg(alternative, choices = c("two.sided", "less", "greater"))

# ...

Direction <- rep_len("Up", nsets)

# Update p-values and direction of change
switch(alternative,
       two.sided = {
           PValue <- 2 * pmin(Down, Up)
           Direction[Down < Up] <- "Down"
       },
       less = {
           PValue <- Down
           Direction[] <- "Down"
       },
       greater = {
           PValue <- Up
       })

# Originally, PValue = TwoSided, but this is changed to PValue = PValue
if (fixed.cor) 
    tab <- data.frame(NGenes = NGenes, Direction = Direction, 
                      PValue = PValue, stringsAsFactors = FALSE)
else tab <- data.frame(NGenes = NGenes, Correlation = inter.gene.cor, 
                       Direction = Direction, PValue = PValue, 
                       stringsAsFactors = FALSE)

I ask because, while one-sided tests are generally not recommended, if the nonparametric version of CAMERA-PR could perform upper-tail tests, it can be used as an alternative to gene set over-representation analysis (ORA), which uses hypergeometric tests. The input statistics would be cluster membership probabilities from a soft clustering approach like fuzzy C-means. This would allow us to test for localization of gene sets to the cluster centroids; that is, for each set, do the genes have higher cluster membership probabilities than genes not in the set?

Since each cluster would need to be analyzed separately, a for loop or lapply would be needed, and then the results would need to be stacked and p-values adjusted across clusters, since no cluster can be considered independent of the others.

CAMERA limma • 544 views
ADD COMMENT
2
Entering edit mode
@gordon-smyth
Last seen 4 hours ago
WEHI, Melbourne, Australia

The cameraPR ouput already allows you to extract one-sided tests. For example:

> library(limma)
> example(cameraPR)
> out <- cameraPR(fit$t[,2], list(set1=index1,set2=index2))
> UpperPValue <- LowerPValue <- out$PValue/2
> Up <- out$Direction=="Up"
> UpperPValue[!Up] <- 1-UpperPValue[!Up]
> LowerPValue[Up] <- 1-LowerPValue[Up]

Now you have one-sided p-values.

ADD COMMENT
0
Entering edit mode

I see. I was thinking about it a different way, but I see the connection now. Thank you.

For the example you provided, would it give the lower-tail probabilities (tests if the gene sets are "Down"), since the one-sided p-values for the "Up" direction are being subtracted from 1?

ADD REPLY
1
Entering edit mode

I made a mistake in my answer, now corrected!

I've also added lower-tail p-values.

Of course I could have written camera() and cameraPR() to return the one-sided p-values in the first place, which are already computed internally, but I thought that returning a a single two-sided p-value instead of two one-sided p-values would be simpler to read and of more general use.

ADD REPLY

Login before adding your answer.

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