Question: masigpro: could not find function "negative.binomial"
0
14 months ago by
nicolas.descostes20 wrote:

Hi,

After updating to bioconductor 3.8, I have some troubles using p.vector. The command and error are:

> fit <- p.vector(edgeR_cpm_matrix, design, Q = 0.05, MT.adjust = "BH", counts=TRUE, family= negative.binomial(10));
Error in negative.binomial(10) :
could not find function "negative.binomial"

I can also reproduce the error with (R 3.5.0):

> library(maSigPro)
> negative.binomial(10)
Error in negative.binomial(10) :
could not find function "negative.binomial"

However ?negative.binomial works. Any idea?

Thanks

masigpro • 238 views
modified 14 months ago • written 14 months ago by nicolas.descostes20

It looks like that function is from the MASS package. You could loading the MASS library before running.

library(MASS)
> negative.binomial(10)

Family: Negative Binomial(10)

Answer: masigpro: could not find function "negative.binomial"
1
14 months ago by
Gordon Smyth39k
Walter and Eliza Hall Institute of Medical Research, Melbourne, Australia
Gordon Smyth39k wrote:

This looks like a bug in the maSigPro package. The maSigPro package imports the MASS package but not in a way that makes the negative.binomial() function available within the p.value() function. So you have to load the MASS package explicitly yourself.

Even if you load MASS though, your code doesn't look right. It isn't correct to use family="negative.binomial" with cpm values. You could try using maSigPro with log-cpm values and the default gaussian family, but I'd suggest instead using the edgeR package itself on the actual counts.

Answer: masigpro: could not find function "negative.binomial"
0
14 months ago by
nicolas.descostes20 wrote:

ok it is working now. Thank you for the correction.