igraph / rigraph

igraph R package
https://r.igraph.org
532 stars 200 forks source link

treatment for both positive and negative correlations #1329

Closed Zhaoju-Deng closed 3 months ago

Zhaoju-Deng commented 3 months ago

Hi ntamas, I am now in network analysis, and igraph (in R) largely solved my problems. I am working with a 16s amplicon correlation matrix based network and want to calculate the network parameters, however, failed in some of the parameters such as efficiency, modularity etc, I googled and it seems to linked to the presence of both positive and negative correlations in my correlation matrix, just wondering if there existing any solutions for dealing with both positive and negative correlations simutaneously in igraph or any other packages/software?

many thanks! Zhaoju

ntamas commented 3 months ago

You are correct; most of the network analysis measures that you mentioned are not defined for negative weights. Extending modularity or efficiency or any of these measures is a research question; if you can point out how these measures are defined for networks that contain negative and positive weights, in a way that is currently accepted in the scientific literature (i.e. published in at least a peer-reviewed paper), you can propose the inclusion of this implementation in a future version of igraph.

You can try asking around in the igraph Discourse group in case someone else is already aware of such an extension for these measures.