Code Monkey home page Code Monkey logo

Comments (6)

frlender avatar frlender commented on July 26, 2024 1

I encountered the same problem and found the solution here:
WestHealth/pyvis#223

from pywgcna.

nargesr avatar nargesr commented on July 26, 2024

Hi,

would you mind sending the full error?

from pywgcna.

mksingh2104 avatar mksingh2104 commented on July 26, 2024

/Users/mksingh/PyWGCNA/figures/network/all.html
Traceback (most recent call last):
File "/Users/mksingh/PyWGCNA/network.py", line 10, in
pyWGCNA_m1_10x.CoexpressionModulePlot(modules=modules, numGenes=10, numConnections=100, minTOM=0, file_name="all")
File "/Users/mksingh/anaconda3/lib/python3.10/site-packages/PyWGCNA/wgcna.py", line 3391, in CoexpressionModulePlot
net.show(f"{self.outputPath}/figures/network/{file_name}.html")
File "/Users/mksingh/anaconda3/lib/python3.10/site-packages/pyvis/network.py", line 546, in show
self.write_html(name, open_browser=False,notebook=True)
File "/Users/mksingh/anaconda3/lib/python3.10/site-packages/pyvis/network.py", line 515, in write_html
self.html = self.generate_html(notebook=notebook)
File "/Users/mksingh/anaconda3/lib/python3.10/site-packages/pyvis/network.py", line 479, in generate_html
self.html = template.render(height=height,
AttributeError: 'NoneType' object has no attribute 'render'

from pywgcna.

nargesr avatar nargesr commented on July 26, 2024

can you send me your pickle file?

from pywgcna.

mksingh2104 avatar mksingh2104 commented on July 26, 2024

I am attaching all the input files as pickle file is large in size.
sample_info.csv
trimmed_means_transposed.csv

Running script:

import PyWGCNA

geneExp = 'trimmed_means_transposed.csv'

pyWGCNA_m1_10x = PyWGCNA.WGCNA(name='m1_10x', species='human', geneExpPath=geneExp, outputPath='/Users/manojkumarsingh/PyWGCNA_', save=True)

print( pyWGCNA_m1_10x.geneExpr.to_df().head(5) )

pyWGCNA_m1_10x.preprocess()

pyWGCNA_m1_10x.findModules()

pyWGCNA_m1_10x.updateSampleInfo(path='/Users/manojkumarsingh/PyWGCNA_/sample_info.csv', sep=',')

pyWGCNA_m1_10x.setMetadataColor('Sex', {'F': 'green',
'M': 'yellow'})
pyWGCNA_m1_10x.setMetadataColor('Genotype', {'Nothing': 'darkviolet',
'Something': 'deeppink'})
pyWGCNA_m1_10x.setMetadataColor('Age', {'0': 'thistle',
'1': 'purple'})
pyWGCNA_m1_10x.setMetadataColor('Tissue', {'M1': 'red',
'Cortex': 'blue'})

geneList = PyWGCNA.getGeneList(dataset='hsapiens_gene_ensembl', attributes=['ensembl_gene_id', 'external_gene_name', 'gene_biotype'], maps=['gene_id', 'gene_name', 'gene_biotype'])

pyWGCNA_m1_10x.updateGeneInfo(geneList)

pyWGCNA_m1_10x.analyseWGCNA()

pyWGCNA_m1_10x.saveWGCNA()

import PyWGCNA

pyWGCNA_m1_10x = PyWGCNA.readWGCNA("m1_10x.p")

print(pyWGCNA_m1_10x.datExpr.var.head(5) )

pyWGCNA_m1_10x.CoexpressionModulePlot(modules=["silver"], numGenes=10, numConnections=100, minTOM=0)
modules = pyWGCNA_m1_10x.datExpr.var.moduleColors.unique().tolist()
print( modules )
pyWGCNA_m1_10x.CoexpressionModulePlot(modules=modules, numGenes=10, numConnections=100, minTOM=0, file_name="all")

from pywgcna.

nargesr avatar nargesr commented on July 26, 2024

Hi,

I was able to run your code without any problem and gave me what it suppose to give! The only thing I changed is the outputPath which I don't believe is related to the error you got!

I would check the version of packages you have. I have listed mine here

for example this is what I got for silver module

image

from pywgcna.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.