Open jiangfuqing opened 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
}
Got it, thanks!
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!
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!