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
217 stars 53 forks source link

Correlation matrix #82

Closed papelypluma closed 11 months ago

papelypluma commented 11 months ago

Hi PyWGCNA developers. Thanks for sharing this tool with the community. This post is rather an inquiry than an issue. I would just like to ask whether there is/are way/s for exporting or printing out the pairwise correlation between genes (as a whole or at least per module). I believe this is generated in the first step of the analysis. I'd like to explore more on how co-regulated genes are related to one another (i.e., positively or negatively if I'm getting this quite right).

Edit: Is it also correct that this will only make sense when adjacency type is "unsigned"?

Thanks a lot!

nargesr commented 11 months ago

Hi @papelypluma ,

thank you for your interest. do you want the adjacency matrix? if you look at the API documentation here, you can find all the middle matrices that I save in a PyWGCNA object.

I would also encourage you to look at these to give you some insight into the different parameters and their effect

papelypluma commented 11 months ago

@nargesr thanks for the reply! am actually thinking of looking into the correlation as a matrix perhaps. I would imagine that a pairwise/gene correlation matrix is stored in the PyWGCNA object after its generation. am not sure if this instance/attribute exists/is available. Although, as an alternative I think generating a correlation matrix is possible outside PyWGCNA. My idea is that inferring the type of relationship (+/-) can be carried out among eigengenes within a module (e.g., miRNA-mRNA interaction - although this can be directly predicted with thermodynamics) provided that the ~adjacency~ network type is "unsigned".

519165198 commented 11 months ago

Hi! My exp data is binarized, Pearson' correlation may be not adaptive for my data. Article of WGCNA said: "The WGCNA package also implements alternative coexpression measures, e.g. more robust measures of correlation (the biweight midcorrelation or the Spearman correlation)." Can other correlation measuring methods be selected in PyWGCNA?

Thanks!

nargesr commented 11 months ago

Hi @papelypluma,

I think TOM or adjacency matrix are the ones you are looking for but I'm not fully aware of the problem you’re trying to solve so I still encourage you to look at the original paper and API documentation.

on solution came to my mind is that you can let the program find modules and see if there is any miRNA-mRNA interaction

nargesr commented 11 months ago

Hi @519165198

you can use other correlation measuring methods but unfortunately you couldn’t use the wrapper function such as findModules(). you should call each function separately and change the correlation methods as desired

papelypluma commented 11 months ago

@nargesr thanks for the advice. Let me try to check that one.