Note

This page is a reference documentation. It only explains the function signature, and not how to use it. Please refer to the user guide for the big picture.

meierlab.networks.graph.get_between_network_connectivity#

meierlab.networks.graph.get_between_network_connectivity(subgraphs, edge_attr='weight')[source]#

Calculate the average of weighted edges of each subgraph pair.

This provides the effective ‘between-network’ connectivity of each subgraph pair.

Parameters:
subgraphsdict

Dictionary of subgraph network pairs and their connecting nodes.

edge_attrstr, optional

Edge attribute label, by default “weight”.

Returns:
dict

Dictionary of network pairs and their average connectivity.

Examples

>>> from meierlab.networks import graph
>>> atlas = 'schaefer2018/atlas.csv'
>>> sub_file = 'sub-001.tsv'
>>> G = graph.gen_base_graph_from_atlas(atlas)
>>> g = graph.gen_graph_from_matrix(G,atlas,sub_file)
>>> rsn_list = graph.gen_subnetwork_list(g)
>>> subgraphs = graph.gen_subnetwork_subgraphs(g, rsn_list)
>>> rsn_pairs = graph.gen_subnetwork_pairs(g, subgraphs)
>>> averages = graph.get_between_network_connectivity(rsn_pairs)
>>> averages
{('DMN', 'Visual'): 0.5}