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

WGCNA.CoexpressionModulePlot error regarding NDFrame.where #76

Closed GentlemanOfFate closed 6 months ago

GentlemanOfFate commented 7 months ago

Hi again,

The second issue about the WGCNA.CoexpressionModulePlot function is that it crashes at line 3413:

adj = adj.where(adj.values != np.diag(adj), 0,
                   adj.where(adj.values != np.flipud(adj).diagonal(0), 0, inplace=True))

(I tried to reproduce the error in a separate code cell, that's why it doesn't look exactly like it does when running the function, but it's still the same) NDFrame error

I'm afraid there might be a mistake in coding: I rewrote it as

adj.where(adj.values != np.diag(adj), 0, inplace=True)
adj.where(adj.values != np.flipud(adj).diagonal(0), 0, inplace=True)

And it worked perfectly after that, so I suggest using this adjustment to fix the issue

Thanks again for the package!

nargesr commented 6 months ago

Hi,

Thank you for using PyWGCNA. This should be resolved in the new version (2.0.0).