neurostatx.cli.VisualizeGraphNetwork
Attributes
| Name | Description |
|---|---|
app | Cyclopts application for the VisualizeGraphNetwork command-line tool. |
Functions
| Name | Description |
|---|---|
VisualizeGraphNetwork | Visualize 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
| Name | Type | Default | Description |
|---|---|---|---|
in_graph | str | required | Input graph network to visualize (.gml format). |
out_folder | str | './visualize_network/' | Output folder for the graph network visualization. Defaults to
./visualize_network/. |
verbose | bool | False | Verbose mode. Defaults to False. |
overwrite | bool | False | Overwrite existing files. Defaults to False. |
save_parameters | bool | False | Save parameters to a .txt file. Defaults to False. |
label_name | List[str] | None | List of label names to subsequently use for labelling. Defaults to None. |
cohort | int | None | Cohort identifier. If your graph contains data from multiple cohorts, you can specify the cohort you want for visualization. Defaults to None. |
background_alpha | bool | True | Use background alpha for the graph. Defaults to True. |
weight | str | 'membership' | Weight to use for the graph network. Defaults to membership. |
label_centroids | bool | True | Label centroids. Defaults to True. |
label_subjects | bool | False | Label subjects. Defaults to False. |
centroids_size | int | 500 | Size of the centroids. Defaults to 500. |
centroid_alpha | float | 1 | Alpha of the centroids. Defaults to 1. |
centroid_node_color | str | 'white' | Color of the centroids. Defaults to white. |
centroid_edge_color | str | 'black' | Edge color of the centroids. Defaults to black. |
subject_node_size | int | 5 | Size of the subjects. Defaults to 5. |
subject_node_alpha | float | 0.1 | Alpha of the subjects. Defaults to 0.1. |
subject_node_color | str | 'darkgrey' | Color of the subjects. Defaults to darkgrey. |
subject_edge_color | str | None | Edge color of the subjects. Defaults to None. |
colormap | str | 'plasma' | Colormap to use for the graph network. Defaults to plasma. |
title | str | 'Network Graph of the clustering membership values.' | Title of the graph network. Defaults to Network Graph of the clustering membership values.. |
legend_title | str | 'Membership values' | Legend title of the graph network. Defaults to Membership values. |
Examples
VisualizeGraphNetwork --in-graph graph_network.gml--out-folder output/ --label-name diagnosis--weight membership -v -f -s