Closed jhaberbe closed 2 weeks ago
Hi,
I think that you should be able to use the npcs
argument already, I tried this:
seurat_obj <- ModuleEigengenes(seurat_obj, npcs=2)
and it runs just fine.
Aside from this, I am very confused as to why you would run hdWGCNA on such a small dataset? You say that you have 31 samples, and ModuleEigengenes
works on the single-cell level matrix, so surely you should have enough cells (at least hundreds or thousands) such that this error should not be arising... Can you please clarify?
Hi,
I've used the hdWGCNA method for a few different analyses, and have run into some issues when trying to use it on a small sample set. From what I've read online, WGCNA can get away with as little as 15 sample and still provide useful results, but when trying to run it on a macrophage dataset (31 samples), I've run into an error computing the ModuleEigengenes, the example code would look like:
the seurat object I have prints out the following:
I would receive an error stating that the number of rows I had was fewer than the number of PCs that I was calculating. I managed to fix the issue pretty quickly by adjusting the number of principal components I was calculating in the ComputeModuleEigengene function. From line 83, I just add the npcs argument:
From what I understand about WGCNA, the module eigengene is typically just using the first principal component, I was wondering if the script could be updated to have a standard argument of something like
npcs = pc_dim
, since you allow the user to choose the PC they want to use themselves.I will probably put in a pull request where I do that, I hope this explains the issue that I was having and why I'm proposing the change. Please let me know if there is any additional information that would be useful.