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_list#
- meierlab.networks.graph.gen_subnetwork_list(G, subnetwork_label='RSN')[source]#
Generate a list of ‘subnetworks’ used in an atlas/parcellation.
Useful for creating subgraphs.
- Parameters:
- G
networkx.Graph Graph containing nodes with a subnetwork_label attribute.
- subnetwork_labelstr, optional
Node label attribute to search, by default “RSN”
- G
- Returns:
- list
A list of ‘subnetworks’ that nodes in G belong to.
Examples
>>> from meierlab.networks import graph >>> atlas = 'schaefer2018/atlas.csv' >>> G = graph.gen_base_graph_from_atlas(atlas) >>> rsn_list = graph.gen_subnetwork_list(G) >>> print(rsn_list) ['DMN','Visual']