I am working on a single-cell RNAseq dataset and running an analysis to find a cell score using NMF (RcppML)R. My question is after you get your cell scores, how can we extract the genes from the components? I have used the following code.
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)
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 great if you can help me with how to get genes instead of the components. Thanks a lot and have a great week.