This question was also asked on Biostars
I am using Rcppml package in R for my NMF analysis, I have a matrix from single-cell analysis. I have cells scores and I wanted to know how to extract genes instead of the components.
i used the following codes.
t1.cpm<- LogNormalize(data = as.matrix(t1@assays$RNA@counts)) # Log converting the data form seurat obj t1.model <- RcppML::nmf(as.matrix(t1.cpm), 30, verbose = F, seed = 1234) t1.w <- t1.model$w t1.d <- t1.model$d t1.h <- t1.model$h dim(t1.w) rownames(t1.w)<- rownames(t1.cpm) colnames(t1.w)<- paste0("component", 1:30) rownames(t1.h)<- paste0("component", 1:30)
and my output is as follows
T_1_TACCTATCAGATGGCA T_1_CCTATTATCAGGCAAG component1 0.000000000 0.0000000000 component2 0.000000000 0.0023590277 component3 0.001512931 0.0000000000 component4 0.000000000 0.0021574559 component5 0.001175799 0.0020222144 component6 0.000000000 0.0004463346
It would be helpful if you can let me know how to extract Gene names instead of components.
Rcppml is a machine learning library.
NMF is Non-negative matrix factorization which is used in bioinformatics and AI, which can examine the latent relationships in experimental data sets.