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
194 stars 47 forks source link

how to make age a continuous parameter? #55

Closed kunalkathuria closed 11 months ago

kunalkathuria commented 12 months ago

Hello!

Thank you for all your responses thus far. I now have output from PyWGCNA and am thinking of different analyses. Is it possible to include age as a continuous variable in the module-trait relationship (0-100)? I see that 'Age' seems to be treated differently by default compared to the other traits as per the tutorial, https://github.com/mortazavilab/PyWGCNA/blob/main/tutorials/Quick_Start.ipynb?

Thanks!

nargesr commented 12 months ago

Hello:)

I believe if you define the color as a continuous color map (i.e you can use mpl.cm.ScalarMappable) you should be fine.

please let me know if you got any error

kunalkathuria commented 11 months ago

Sorry, I meant in the correlation matrix leading to the module-trait relationship heatmap. Can the dependence be made sensitive to age as a continuous variable (i.e. correlation with high/low values) rather than discrete types as in PrimaryDx, Tissue etc.?

nargesr commented 11 months ago

hmm I'm not sure if you can interpret the results in that way since you couldn't figure out what high correlation means but you can have categorical variables with a sequential relationship for example divide your samples into three categories: young, juvenile, old

if you think you still want to give it a shot and try using the continuous variables you can try to calculate the Pearson correlation using scipy.stats.pearsonr and sns.heatmap to plot it

kunalkathuria commented 11 months ago

Yea, I was thinking along the same lines...cool, thanks a lot for the input!