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

Cannot fit a linear model with colinear covariables #59

Closed roskcl closed 2 years ago

roskcl commented 2 years ago

Hello,

I have been following your tutorial for Transcription factor activity inference in bulk RNA-seq but wanted to use the consensus analysis. I am using the Dorothea database, as in the tutorial, but when I try to run the consensus I get the following error:

Error in mutate(): ! Problem while computing model = list(mlm_evaluate_model(.data$condition)). i The error occurred in row 1. Caused by error: ! After intersecting mat and network, at least 4 sources in the network are colinear with other sources. Cannot fit a linear model with colinear covariables, please remove them. Please run decoupleR::check_corr to see what regulators are correlated

I have run check_corr() and have obtained the list of correlated sources - do I need to remove them all from the network or only the ones above a certain correlation threshold for mlm to work?

Thank you very much!

PauBadiaM commented 2 years ago

Hi @roskcl,

Thanks for checking out the package! Sorry for the late response, I was on vacation.

First I would check how much correlated are your sources, if you see that only a handful of sources are highly correlated (above absolute value 0.9) you can remove one of the sources in each pair. The number of "repeated" sources or the correlation threshold are completely arbitrary, the more correlated they are the more unreliable the predictions will be.

If you see that many of them are quite correlated or you don;t want to remove any source, I would suggest not to use mlm, instead you can run the consensus score using only norm_wsum and ulm by specifying it in the decouple function consensus_stats = c('ulm', 'norm_wsum').

Hope this was helpful! Let me know if you have more questions or need more help