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.gen_subnetwork_pairs#
- meierlab.networks.graph.gen_subnetwork_pairs(G, subgraph_list, subnetwork_label='RSN')[source]#
Generate pairs of networks from graph G to explore and compare.
- Parameters:
- subgraph_listlist
A list of subnetwork subgraphs.
- subnetwork_labelstr, optional
Node label attribute to search, by default “RSN”.
- Returns:
- dict
A dictionary with keys as pairs of subnetworks (e.g., DMN-VIS) and values as a subgraph with nodes where edges connect nodes from both subnetworks.
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) >>> rsn_pairs {('DMN', 'Visual'): <networkx.classes.graph.Graph at 0x120960460>}