raphael-group/comet

comet_exact_test r function fails with 0 inclusive counts.

Opened this issue · 2 comments

comet_exact_test() fails to run when number of co-occurring samples is zero during 2^2 contingency table.

For example, In TCGA LAML, NPM1 and RUNX1 show strong mutually exclusiveness. Following is the table for NPM1 and RUNX1:

binaryString number
00 124
01 54
10 18
11 0
> comet_exact_test(tbl = c(124, 54, 18, 0))
Error in `[<-`(`*tmp*`, , col_index, value = c(1L, 1L)) : 
  subscript out of bounds

But code runs without error if I replace last entry with 1.

> comet_exact_test(tbl = c(124, 54, 18, 1))
[1] 0.00720818

So is it necessary for two genes to have at least one common sample to run comet ?

Thanks.

P.S: Sorry if this is not the right place to ask this.

Thank you for your interest in our software.
It is a bug when plotting mutation matrix if no co-occurrence occur. We will fix this asap.

If you need only the p-value, try disable the plot function by using the following code:

comet_exact_test(c(124,18,18,0) , mutmatplot=F)

I should have tried this before asking.
Thank you.