bioFAM / MOFA2

Multi-Omics Factor Analysis
https://biofam.github.io/MOFA2/
GNU Lesser General Public License v3.0
305 stars 52 forks source link

matrix.please function not found #89

Open jiangfuqing opened 2 years ago

jiangfuqing commented 2 years ago

Hi, when I run scripts as belows: " msgidb.matrix <- msigdbr( species = "Mus musculus", # Homo sapiens category = "C5", subcategory = "BP" ) %>% as.data.table %>% .[,id:=1] %>% dcast(gs_name~gene_symbol, value.var="id", fill=0) %>% matrix.please " I got an error: " Error in matrix.please(.) : could not find function "matrix.please" " Thanks!

rargelaguet commented 2 years ago

This is a function that converts a data.frame into a matrix:

matrix.please <-function(x) {
  m<-as.matrix(x[,-1])
  rownames(m)<-x[[1]]
  m
}
jiangfuqing commented 2 years ago

Got it, thanks!

jiangfuqing commented 2 years ago

Hi, when I run scripts as belows: gsea.positive <- run_enrichment(mofa, feature.sets = msgidb.matrix, view = "RNA", sign = "positive" ) I got an error: Error in run_enrichment(mofa, feature.sets = msgidb.matrix, view = "RNA", : feature.sets has to be a list or a binary matrix. Any suggestion is welcomed, thanks!