cole-trapnell-lab / monocle-release

281 stars 116 forks source link

estimateDispersions: Parametric dispersion fit failed. Try a local fit and/or a pooled estimation. #325

Open igordot opened 5 years ago

igordot commented 5 years ago

I am getting the following error when running estimateDispersions(cds):

Error in parametricDispersionFit(disp_table, verbose) : 
  Parametric dispersion fit failed. Try a local fit and/or a pooled estimation. (See '?estimateDispersions')
In addition: Warning message:
glm.fit: algorithm did not converge 

According to a previous issue (https://github.com/cole-trapnell-lab/monocle-release/issues/5):

Monocle doesn't support different fit types. The message there is leftover from the DESeq1 code we based our dispersion estimation procedure on. I will change the message.

The message is still in the code:

https://github.com/cole-trapnell-lab/monocle-release/blob/7df105006756801a305ff43321b26d289cd6e890/R/expr_models.R#L395

Later in the same issue:

That's right - estimateDispersions only makes sense right now for negbinomial and negbinomial.size expression families. We'll add a warning for the next release that estimateDispersions has no effect for FPKM/TPM expression data.

I tried exprs(cds) = floor(exprs(cds)) to make my expression values integers. That solved the error. However, I am not sure this is appropriate. My initial values were Salmon estimated counts. They are not integers, but they are still counts, so they should still be considered negbinomial and negbinomial.size. What is the proper approach here?

alymatz commented 3 years ago

Hi! For anyone who finds this, I don't really know why, but when I made my cds, I used expressionFamily= negbinomial() instead of negbinomial.size and I was able to estimate dispersion. I have a very small dataset (<3,000 cells). All my cells are of good quality without any empty wells. On the monocle2 webpage they also have their own way to switch FPKM/TPM data to UMI in order to create a cds using negbinomial.size (but this alone did not solve my problem: I believe it is the use of negbinomial instead of negbinomial.size which made it work). I hope this helps!