Code Monkey home page Code Monkey logo

Comments (5)

nargesr avatar nargesr commented on July 26, 2024

Hi,

please make sure you have the latest version and if you still got that error would you mind sharing with me your picke file and the script you used?

from pywgcna.

ZivTQ avatar ZivTQ commented on July 26, 2024

Hi,

please make sure you have the latest version and if you still got that error would you mind sharing with me your picke file and the script you used?

Hi
I have installed pYWGCNA1.2.3. Previous error have solved.
The data link mentioned in #39 (comment)

Thank you so much

from pywgcna.

nargesr avatar nargesr commented on July 26, 2024

Hi,

For pywgcna.analyseWGCNA(), you need to add your data trait and colormap like the tutorials.

I don't have your data trait and the script you used. would you mind giving me some insight of those things?

Thanks

from pywgcna.

ZivTQ avatar ZivTQ commented on July 26, 2024

Hi, thanks for response
the trait data was arranged like tutorials. a dataframe like this:

sample_id group
oocyte1 oocyte
oocyte2 oocyte
oocyte3 oocyte
pronuclear1 pronuclear
pronuclear2 pronuclear
pronuclear3 pronuclear
zygote1 zygote
zygote2 zygote
2_cell1 2_cell
2_cell2 2_cell
2_cell3 2_cell
4_cell1 4_cell
4_cell2 4_cell
4_cell3 4_cell
4_cell4 4_cell
8_cell1 8_cell
8_cell2 8_cell
8_cell3 8_cell
8_cell4 8_cell
8_cell5 8_cell
8_cell6 8_cell
8_cell7 8_cell
8_cell8 8_cell
8_cell9 8_cell
8_cell10 8_cell
8_cell11 8_cell
morula1 morula
morula2 morula
morula3 morula

The color set was copy from the tutorials.

test.setMetadataColor('stage', ['oocyte': 'darkviolet',
                                'pronuclear': 'deeppink',
                                'zygote': 'thistle',
                                '2cell': 'plum',
                               '4cell': 'violet',
                                '8cell': 'purple',
                                'morula':'red'])

Thank you

from pywgcna.

nargesr avatar nargesr commented on July 26, 2024

Again, I was able to run PyWGNA without any problem!

I attached my script below.
Please read the tutorials more carefully :)
i.e. your color map should be a dictionary, not a list. Or the name of the color map should match to the one the column names but in your case, your column name is group but you specify stage in the setMetadataColor() function.

import PyWGCNA
import pandas as pd

tpm = pd.read_csv('GSE44183_human_expression_mat.txt', sep='\t', index_col=0).T

test = PyWGCNA.WGCNA(name='test',
                     species='mus musculus', 
                     geneExp=tpm, 
                     outputPath='',
                     save=True)

test.preprocess()
test.findModules()

sampleInfo = test.datExpr.obs.copy(deep=True)
sampleInfo['group'] = sampleInfo.index.tolist()
sampleInfo.group[sampleInfo.group.str.contains('oocyte')] = 'oocyte'
sampleInfo.group[sampleInfo.group.str.contains('pronuclear')] = 'pronuclear'
sampleInfo.group[sampleInfo.group.str.contains('zygote')] = 'zygote'
sampleInfo.group[sampleInfo.group.str.contains('2 cell')] = '2 cell'
sampleInfo.group[sampleInfo.group.str.contains('4 cell')] = '4 cell'
sampleInfo.group[sampleInfo.group.str.contains('8 cell')] = '8 cell'
sampleInfo.group[sampleInfo.group.str.contains('morula')] = 'morula'

test.updateSampleInfo(sampleInfo=sampleInfo)

test.setMetadataColor('group', {'oocyte': 'darkviolet',
                                'pronuclear': 'deeppink',
                                'zygote': 'thistle',
                                '2 cell': 'plum',
                               '4 cell': 'violet',
                                '8 cell': 'purple',
                                'morula':'red'})

test.analyseWGCNA()

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.