Thank you for your suggestions.
I wanted to supply the normalized counts to the NMF and set "do.scale = FALSE" to avoid negative value. I checked the nmf_data[, HVG] and it seemed fine.
Hello, I've attempted to apply NMF clustering to my scRNA-seq data, and I've encountered some unexpected results. Below is my code snippet:
EPCAM.cell = ScaleData(object = EPCAM.cell, do.scale = FALSE, do.center = FALSE)
nmf_data = EPCAM.cell@assays$RNA@scale.data
HVG = EPCAM.cell@assays$RNA@var.features
nmf_data = nmf_data[, HVG]
res_nndsvd = nmf(nmf_data, rank = 2:10,method = "snmf/r", seed = "nndsvd", nrun = 30)
plot(res_nndsvd)
Please note that EPCAM.cell is a Seurat object. Upon plotting, I observed the following:
The cophenetic and dispersion plots remained constant, exhibiting no variation across different rank values. Does this suggest an issue in my code? Thank you for your attention.
EPCAM.cell = ScaleData(object = EPCAM.cell, do.scale = FALSE, do.center = FALSE)
nmf_data = EPCAM.cell@assays$RNA@scale.data
You set do.scale = FALSE and then pull out the scale.data slot. Have you examined nmf_data[, HVG] to see if it actually contains anything?
Also, check out cNMF it's ran in python but there are clear examples for how to run it and then import the results back into R and even incorporate into a Seurat pipeline. In my experience it's more pleasant to work with than NMF::nmf()
Thank you for your suggestions.
I wanted to supply the normalized counts to the NMF and set "do.scale = FALSE" to avoid negative value. I checked the nmf_data[, HVG] and it seemed fine.
What do the resulting H W matrices look like from the runs?
I tried cNMF and it looks good~~. Thank you for your suggestions
Log in to answer this question.