GabrielHoffman / variancePartition

Quantify and interpret divers of variation in multilevel gene expression experiments
http://gabrielhoffman.github.io/variancePartition/
60 stars 14 forks source link

Parameters to increase iterations for model fitting of genes #94

Closed shoffm closed 9 months ago

shoffm commented 10 months ago

Hello, I am trying to run dream with contrasts on a dataset of ~3,800 samples, and I am getting gene-level errors (i.e. model failed for 80 responses) for ~80 genes. I have tried to increase the number of evaluations by including control = lmerControl(optCtrl = list(maxeval = 20000)) and control=lmerControl(optCtrl=list(maxfun=20000)), but in running both of those models the number of genes that fail increases to ~780. Assuming the default parameters for maxfun (10,000) and maxeval (1,000) used in dream are the defaults listed in the documentation for lmerControl, I would have assumed this would increase (or at least not decrease) the number of genes converging in the model. Please can you advise on how to increase the number of model iterations to see if it increase convergence of genes?

Thanks so much!

GabrielHoffman commented 10 months ago

HI Sophie, It looks like a small set of genes is failing convergence checks. It's only been in the last few months that I improved reporting these convergence issues. They definitely happened before, but now the user gets notified. I've never found that changing parameters or the convergence checks help rescue these genes. In almost all cases, this non-convergence indicates an issue with the covariates (i.e. fixed effects not being full rank) or the response (i.e. no variance overall or within a category defined by a covariate).

See documentation here

You can examine those examples manually, but I almost always find that there is an initiative reason why the gene failed.

Best, Gabriel

shoffm commented 10 months ago

Hi Gabriel,

Thank you for that advice. After adjusting the terms in my model, I have reduced the number of genes failing to converge from ~80 with the previous model down to ~10 in the current model, a large improvement.

In investigating the failing genes, I have run lmer directly on these failing genes, and the models are having no trouble converging. I am curious then why they are failing to be modeled with dream? Thanks so much!

Sophie

GabrielHoffman commented 10 months ago

Hi Sophie, You are probably not running lmer() exactly like variancePartition is. Do you have a minimal reproducible example you can share?

Gabriel