MOFA2 icon indicating copy to clipboard operation
MOFA2 copied to clipboard

run_enrichment does not work when selecting a single factor

Open jjcaff opened this issue 1 year ago • 1 comments

I've found a single factor that I want to perform pathway enrichment on. When I try to run_enrichment but select only one factor, I get an error message.

pathways <- run_enrichment(model, 
                            view = "transcriptomic", 
                            factors = 1, 
                            feature.sets = MSigDB_v6.0_C5_human, 
                            sign = "all", 
                            statistical.test = "parametric") 

The paraphrased readout message is: Warning: XXX features were removed because they had no variance in the data. Intersecting features names in the model and the gene set annotation results in a total of XXXXX features. Error in W[features, , drop = FALSE] : incorrect number of dimensions

Currently the workaround is to just select any other additional factor as well as the one of interest.

jjcaff avatar Jun 16 '24 20:06 jjcaff

Thank you very much for sharing ! I had the same error, namely Error in W[features, , drop = FALSE] : incorrect number of dimensions with the run_enrichment() function, and I can now work around it.

srh-bzd avatar Feb 11 '25 16:02 srh-bzd