mortazavilab / PyWGCNA

PyWGCNA is a Python package designed to do Weighted Gene Correlation Network analysis (WGCNA)
https://academic.oup.com/bioinformatics/advance-article/doi/10.1093/bioinformatics/btad415/7218311
MIT License
192 stars 46 forks source link

Doubt on application #90

Closed fmalmeida closed 4 months ago

fmalmeida commented 4 months ago

Hi,

This is rather an inquiry than an issue. I am currently with a matrix of genes that are absent/present in some samples and would like to investigate possible co-occurrences / correlations as I have data from different years.

The data is binary, 0 or 1, so I ask whether it would be possible to use this package with it, or if it is indeed tailored in a way to work with continuous data (counts) and so working with presence/absence would cause the tool to fail or induce errors.

Cheers, Felipe.

nargesr commented 4 months ago

Hi,

so WGCNA starts finding modules by calculating the correlation between each pair of genes and then finding the soft threshold to scale the calculated matrix to have a scale-free network and define modules based on the dissimilarity matrix.

If your input contains only 0 and 1, it would affect the correlation part and you might end up with a bunch of Nan values based on the ratio of zero and one so not sure how you want to interpret those.

In the end, I think it might still be worth giving it a shot but you might see too many warnings like "Some correlations are NA in block ..." when you call findModules() function, and if that's the case I would suggest looking for another tool that designed to work on boolean matrices.

Hope I can answer some of your questions Best, Narges