krumsieklab / maplet

R statistical toolbox for metabolomics
GNU General Public License v3.0
17 stars 6 forks source link

mt_stats_univ_lm linear model performance issue #121

Open KelseyChetnik opened 3 years ago

KelseyChetnik commented 3 years ago

In GitLab by @krumsiek on Jul 12, 2020, 14:13

Function is slower than it should be. Can certainly be improved

Potentially, but calling core functions instead of lm: https://stackoverflow.com/a/39820005

Also, maybe the MatrixEQTL package can be used? https://cran.r-project.org/web/packages/MatrixEQTL/index.html

More potentially interesting resources: https://rdrr.io/cran/vows/man/lm.mp.html / https://rdrr.io/cran/Rfast/man/lmfit.html

Generally, a good trick could be to fit all models at once, instead of in a loop.

KelseyChetnik commented 3 years ago

In GitLab by @krumsiek on Jul 12, 2020, 14:13

changed the description

KelseyChetnik commented 3 years ago

In GitLab by @krumsiek on Sep 29, 2020, 22:55

Matrix EQTL is implemented. Other speed ups might be interesting to look at for scenarios that need more than just regular linear models.