saezlab / decoupleR

R package to infer biological activities from omics data using a collection of methods.
https://saezlab.github.io/decoupleR/
GNU General Public License v3.0
183 stars 24 forks source link

Fix mlm multicond #66

Closed gabora closed 1 year ago

gabora commented 1 year ago

hey,

the mlm was really slow for multiple conditions or when I ran on individual samples. I noticed that it calls the lm function for each conditions one-by-one, but this is not needed, because lm can fit multiple conditions at once. This is actually much faster, because then it does not need to run QR-decomposition N times (if there are N sampoles), but only once.

Checked on my data, the results are identical to the old version within machine precision. Checked with a single condition and also with multiple sampels too. Let me know if something else is missing before merging.

best, Attila