Hi Zachary,
Thank you very much for your excellent singlet package! I really appreciate your work. I have a few questions and would be grateful for any guidance you could provide:
- I am running the following code to determine the optimal number of ranks k. However, it fails with the error:
Error in if (model$test_mse[[length(model$test_mse)]] / model$test_mse[[1]] > :
missing value where TRUE/FALSE needed
set.seed(123) seurat_obj <- singlet::RunNMF( object = seurat_obj, assay = "RNA", slot = "data", k = 2:50, reps = 5, tol = 1e-4, maxit = 500, verbose = FALSE, threads = 8 )
If I reduce the vector k to 20–30, the code sometimes works. Could you please explain what causes this error and how to avoid it if I want to test a larger number of components?
- I also tried running the program with the following parameters:
set.seed(123) seurat_obj <- singlet::RunNMF( object = #seurat_obj, assay = "RNA", slot = "data", k = NULL, reduction.name = "nmf", reduction.key = "NMF_", verbose = 2, reps = 3, test.set.density = 0.05, tol = 1e-05, maxit = 100, L1 = 0.01, L2 = 0, threads = 0, split.by = NULL )
In this case, everything works, and I obtain an optimal k=24. However, when I try to use RankPlot(seurat_obj, reduction = "nmf"), it is not clear that this is indeed the optimal k. From my observation, the optimal value seems closer to 30.
- The function RankPlot(seurat_obj, reduction = "nmf") does not behave as described in the tutorial. Here is how it appears on my side.
I would greatly appreciate any advice or suggestions you could provide to better determine the optimal number of NMF components and to make RankPlot work as intended.
Thank you very much for your time and help!
Hi Zachary,
Thank you very much for your excellent singlet package! I really appreciate your work. I have a few questions and would be grateful for any guidance you could provide:
set.seed(123) seurat_obj <- singlet::RunNMF( object = seurat_obj, assay = "RNA", slot = "data", k = 2:50, reps = 5, tol = 1e-4, maxit = 500, verbose = FALSE, threads = 8 )If I reduce the vector k to 20–30, the code sometimes works. Could you please explain what causes this error and how to avoid it if I want to test a larger number of components?
set.seed(123) seurat_obj <- singlet::RunNMF( object = #seurat_obj, assay = "RNA", slot = "data", k = NULL, reduction.name = "nmf", reduction.key = "NMF_", verbose = 2, reps = 3, test.set.density = 0.05, tol = 1e-05, maxit = 100, L1 = 0.01, L2 = 0, threads = 0, split.by = NULL )In this case, everything works, and I obtain an optimal k=24. However, when I try to use RankPlot(seurat_obj, reduction = "nmf"), it is not clear that this is indeed the optimal k. From my observation, the optimal value seems closer to 30.
I would greatly appreciate any advice or suggestions you could provide to better determine the optimal number of NMF components and to make RankPlot work as intended.
Thank you very much for your time and help!