satijalab / sctransform

R package for modeling single cell UMI expression data using regularized negative binomial regression
GNU General Public License v3.0
203 stars 33 forks source link

increase limit of theta.ml when method is default poisson #163

Closed adugourd closed 1 year ago

adugourd commented 1 year ago

Dear sctransform devs,

I saw that the limit parameters in the theta.ml function was set to 100 in the offset based methods, but the default poisson still uses the default theta.ml limit parameter of 10.

I actually tried to increase it myself to 100, but it seems that any value higher than 50 leads to unstable bahevior and crash the function with:

Error in h(simpleError(msg, call)) : error in evaluating the argument 'x' in selecting a method for function 't': missing value where TRUE/FALSE needed

Is it something that you have encoutered and is why the default is still 10 for the default vst runs ?

Cheers,

Aurelien

saketkc commented 1 year ago

I would recommend using the method="glmGamPoi" or vst.flavor="v2" approach as they are more stable (and converge faster). I think the default was chosen empirically (by analyzing different datasets).