多功能性-查找图中的节点与社区的关联程度
versatilit的Python项目详细描述
多功能性
这个包实现了多功能性(Shinn et al.,
2017),其中
描述节点与网络社区的关联程度
结构。它是用Python3写的,只能保证
在那里工作。(这在python2中可能有效,如果您import __future__
但是
这是未经测试的…有关详细信息,请参见代码。)
安装时使用:
pip3 install versatility
或者,克隆git repo并使用以下命令安装:
python3 setup.py install
依赖关系:
- Python3
- networkx
- Scipy(包括numpy和matplotlib)
- bctpy:模块“bct”是
bctpy,连接python的大脑连接工具箱的端口。这个
最新版本支持python3,并且可以很容易地安装
使用“
pip install bcpty
”。
有关完整文档,请参见函数帮助,但最有用的 功能包括:
find_nodal_versatility
-计算 图使用特定的社区检测算法。find_nodal_mean_versatility
-计算每个节点的多功能性 通过一系列社区检测算法参数(大多数 尤其是分辨率参数),并找到平均值。find_optimal_gamma_curve
-查找 分辨率参数和 (可选)绘制结果。这对于查找 最佳分辨率参数,例如inFigure 3c of the original paper。
下面是一个快速入门的示例:
import networkx
from versatility import *
G = networkx.karate_club_graph()
find_nodal_mean_versatility(G, find_communities_louvain, processors=2)
find_nodal_versatility(G, find_communities_louvain, algargs={"gamma" : 0.5})
如果您使用此代码,请引用:
Shinn, M., Romero-Garcia, R., Seidlitz, J., Vasa, F., Vertes, P.,
Bullmore, E. (2017). Versatility of nodal affiliation to
communities. Scientific Reports 7: 4273.
doi:10.1038/s41598-017-03394-5
版权所有2016-2019 Maxwell Shinn(maxwell.shinn@yale.edu) 在GNU GPLV3下可用。