I'm running CAMERA on one of my datasets with gene set collections imported from MSigDB and graphite, and I am getting NaN results for a large fraction of gene sets that I'm testing (around 50% of pathways for some collections). This is odd because I don't remember that happening a few versions ago the last time I used CAMERA on the same gene sets. I've prepared a test case that demonstrates the problem. You can download the script and data file from here: https://www.dropbox.com/sh/dp5aheqzvf2rij5/AADuA68Hk5BdRIJpL4H_knbHa?dl=0 Simply put them in the same folder and run the script, which is just this:
library(edgeR) testcase <- readRDS("camera-nan-testcase.RDS") result <- with(testcase, camera(dge, pathway, design, makeContrasts(contrasts=contrast, levels=design))) print(result)
The result should be:
Warning message: Zero sample variances detected, have been offset data.frame with 1 row and 4 columns NGenes Correlation Direction PValue <numeric> <numeric> <character> <numeric> set1 40 NaN Up NaN
I have no idea what's causing this. Is there something about this gene set that makes it incompatible with CAMERA, or is there an issue in my data?
Upon further investigation, it appears that the problem occurs with any gene set containing at least one gene that has zero counts in all my samples.