Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ConstructNetwork() and ModuleEigengenes() functions use different methods to calculate the ME (module eigengene), leading to the discrepancy in the kME result #266

Closed
erlun1 opened this issue May 24, 2024 · 3 comments
Labels
question Further information is requested

Comments

@erlun1
Copy link

erlun1 commented May 24, 2024

Thank you very much for developing the hdWGCNA package. However, I have encountered an issue with the conflicting ME (module eigengene) and kME (module membership) values during the module identification process.

Firstly, in the ConstructNetwork function, you use the default WGCNA::blockwiseConsensusModules function. I have set the minCoreKME and minKMEtoStay parameters to 0.5 and 0.2, respectively. However, when I ran the ModuleConnectivity function to calculate the gene kME values, the minimum kME value was 0.02, which does not meet my set threshold.

After reviewing the source code, I found that the blockwiseConsensusModules function calls the WGCNA::multiSetMEs function, which in turn calls the WGCNA::moduleEigengenes function to calculate the module eigengenes (ME). This is where the discrepancy arises, as I noticed that the hdWGCNA::ModuleEigengenes function uses the Seurat RunPCA method instead.

Since the kME calculation is a simple correlation (cor function + Pearson correlation), the difference in the results is due to the ME value calculation. The inconsistency in the ME calculation methods between the WGCNA and hdWGCNA packages is causing the issue, and I am unable to apply the results from the ModuleEigengenes and ModuleConnectivity functions.

I hope you can provide a solution to this problem as soon as possible. Thank you for your time and attention.

@erlun1 erlun1 added the question Further information is requested label May 24, 2024
@smorabit
Copy link
Owner

Hi,

I think I understand your confusion. If you were following the tutorial, the network is constructed on a metacell representation of your dataset, which gives us a different gene expression matrix than your original single-cell dataset. After we construct the network, the functions ModuleEigengenes and ModuleConnectivity are used to compute the expression level of each module and the module membership of each gene in the single-cell dataset. This is not an issue, this is simply the design of the package.

@erlun1
Copy link
Author

erlun1 commented May 27, 2024

Hi,

I am pleasantly surprised to receive your reply so quickly. I understand your point, so in order to maintain the consistency of my data, would it be possible to use the ME values calculated and stored by the ConstructNetwork function,which is constructed on the metacell representation, and the metacell gene expression matrix computed by the MetacellsByGroups function, to calculate the kME? I look forward to your response, thank you very much.

@smorabit
Copy link
Owner

smorabit commented Jun 4, 2024

Currently there is not a way to do this directly with hdWGCNA but you might be able to write some custom code to do this if you want to.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants