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
209 stars 48 forks source link

outputPath does not work #8

Closed DJSiddharthVader closed 2 years ago

DJSiddharthVader commented 2 years ago

When creating a WGCNA object I cannot set the outputPath argument and always receive and error i.e.

data = PyWGCNA.WGCNA(anndata=counts, save=True, outputPath='./figures')
Traceback (most recent call last):
  File "pywgcna_test.py", line 21, in <module>
    minModuleSize=30,
  File "/PHShome/sr1068/.conda/envs/pywgcna/lib/python3.7/site-packages/PyWGCNA/wgcna.py", line 173, in __init__
    if not os.path.exists(self.outputPath + '/figures/'):
AttributeError: 'WGCNA' object has no attribute 'outputPath'

I looked at the code and in the WGCNA class the variable is never instantiated, adding the line

self.outputPath = outputPath

to the WGCNA class in wgcna.py fixed this issue and allows me to set outputPath.

nargesr commented 2 years ago

I'm so sorry, this line totally looks like I edited it in internal testing and somehow I forgot to add it. I pushed a new release with the corrected code. You can reinstall it from pip. It should work for you now.