Skip to content

neurostatx.cli.VisualizeGraphNetwork

Attributes

NameDescription
appCyclopts application for the VisualizeGraphNetwork command-line tool.

Functions

NameDescription
VisualizeGraphNetworkVisualize a graph network generated from clustering results.

appattributemodule attribute#

app = App(default_parameter=Parameter(negative=()))

Cyclopts application for the VisualizeGraphNetwork command-line tool.

VisualizeGraphNetworkfunction#

def VisualizeGraphNetwork(in_graph: Annotated[str, Parameter(show_default=False, group='Essential Files Options')], out_folder: Annotated[str, Parameter(show_default=True, group='Essential Files Options')] = './visualize_network/', verbose: Annotated[bool, Parameter(-v, --verbose, group='Optional parameters')] = False, overwrite: Annotated[bool, Parameter(-f, --overwrite, group='Optional parameters')] = False, save_parameters: Annotated[bool, Parameter(-s, --save_parameters, group='Optional parameters')] = False, label_name: Annotated[List[str], Parameter(show_default=False, group='Label Options')] = None, cohort: Annotated[int, Parameter(show_default=False, group='Essential Files Options')] = None, background_alpha: Annotated[bool, Parameter(show_default=True, group='Label Options')] = True, weight: Annotated[str, Parameter(show_default=False, group='Network Visualization Options')] = 'membership', label_centroids: Annotated[bool, Parameter(show_default=True, group='Network Visualization Options')] = True, label_subjects: Annotated[bool, Parameter(show_default=True, group='Network Visualization Options')] = False, centroids_size: Annotated[int, Parameter(show_default=True, group='Network Visualization Options')] = 500, centroid_alpha: Annotated[float, Parameter(show_default=True, group='Network Visualization Options')] = 1, centroid_node_color: Annotated[str, Parameter(show_default=True, group='Network Visualization Options')] = 'white', centroid_edge_color: Annotated[str, Parameter(show_default=True, group='Network Visualization Options')] = 'black', subject_node_size: Annotated[int, Parameter(show_default=True, group='Network Visualization Options')] = 5, subject_node_alpha: Annotated[float, Parameter(show_default=True, group='Network Visualization Options')] = 0.1, subject_node_color: Annotated[str, Parameter(show_default=True, group='Network Visualization Options')] = 'darkgrey', subject_edge_color: Annotated[str, Parameter(show_default=True, group='Network Visualization Options')] = None, colormap: Annotated[str, Parameter(show_default=True, group='Network Visualization Options')] = 'plasma', title: Annotated[str, Parameter(show_default=False, group='Network Visualization Options')] = 'Network Graph of the clustering membership values.', legend_title: Annotated[str, Parameter(show_default=False, group='Network Visualization Options')] = 'Membership values')

Visualize a graph network generated from clustering results.

VisualizeGraphNetwork uses NetworkX to draw the graph and can label specific nodes based on a condition (for example a diagnosis). Appearance can be customized with the visualization parameters. It is meant to work with ComputeGraphNetwork because it requires precomputed node positions in the graph file.

Parameters

NameTypeDefaultDescription
in_graphstrrequiredInput graph network to visualize (.gml format).
out_folderstr'./visualize_network/'Output folder for the graph network visualization. Defaults to ./visualize_network/.
verboseboolFalseVerbose mode. Defaults to False.
overwriteboolFalseOverwrite existing files. Defaults to False.
save_parametersboolFalseSave parameters to a .txt file. Defaults to False.
label_nameList[str]NoneList of label names to subsequently use for labelling. Defaults to None.
cohortintNoneCohort identifier. If your graph contains data from multiple cohorts, you can specify the cohort you want for visualization. Defaults to None.
background_alphaboolTrueUse background alpha for the graph. Defaults to True.
weightstr'membership'Weight to use for the graph network. Defaults to membership.
label_centroidsboolTrueLabel centroids. Defaults to True.
label_subjectsboolFalseLabel subjects. Defaults to False.
centroids_sizeint500Size of the centroids. Defaults to 500.
centroid_alphafloat1Alpha of the centroids. Defaults to 1.
centroid_node_colorstr'white'Color of the centroids. Defaults to white.
centroid_edge_colorstr'black'Edge color of the centroids. Defaults to black.
subject_node_sizeint5Size of the subjects. Defaults to 5.
subject_node_alphafloat0.1Alpha of the subjects. Defaults to 0.1.
subject_node_colorstr'darkgrey'Color of the subjects. Defaults to darkgrey.
subject_edge_colorstrNoneEdge color of the subjects. Defaults to None.
colormapstr'plasma'Colormap to use for the graph network. Defaults to plasma.
titlestr'Network Graph of the clustering membership values.'Title of the graph network. Defaults to Network Graph of the clustering membership values..
legend_titlestr'Membership values'Legend title of the graph network. Defaults to Membership values.

Examples

Terminal window
VisualizeGraphNetwork --in-graph graph_network.gml
--out-folder output/ --label-name diagnosis
--weight membership -v -f -s