neurostatx.cli.CompareGraphs
Attributes
| Name | Description |
|---|---|
app | Cyclopts application for the CompareGraphs command-line tool. |
Functions
| Name | Description |
|---|---|
CompareGraphs | Extract high-percentile nodes from one graph and color them on another. |
appattributemodule attribute#
app = App(default_parameter=Parameter(negative=()))Cyclopts application for the CompareGraphs command-line tool.
CompareGraphsfunction#
def CompareGraphs(in_graph1: Annotated[str, Parameter(show_default=False, group='Essential Files Options')], weight: Annotated[str, Parameter(show_default=False, group='Essential Files Options')], percentile: Annotated[float, Parameter(show_default=False, group='Essential Files Options')], in_graph2: Annotated[str, Parameter(show_default=False, group='Essential Files Options')], out_folder: Annotated[str, Parameter(group='Essential Files Options')] = './comparison_results/', verbose: Annotated[bool, Parameter(-v, --verbose, group='Optional parameters')] = False, overwrite: Annotated[bool, Parameter(-f, --overwrite, group='Optional parameters')] = False, 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, background_alpha: Annotated[bool, Parameter(show_default=True, group='Network Visualization Options')] = True, 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')] = 'gray', legend_title: Annotated[str, Parameter(show_default=False, group='Network Visualization Options')] = 'Membership values')Extract high-percentile nodes from one graph and color them on another.
CompareGraphs compares two undirected weighted graph networks by extracting the Xth-percentile nodes from –in-graph1 and labelling those nodes on –in-graph2. The percentile is set by –percentile.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
in_graph1 | str | required | First graph from which subjects above –percentile will be extracted and colored. |
weight | str | required | Edge weight to use for the graph. |
percentile | float | required | Percentile value used to extract subjects. |
in_graph2 | str | required | Second graph to color extracted subjects on. |
out_folder | str | './comparison_results/' | Path of the folder in which the results will be written. If not
specified, current folder and default name will be used. Defaults to
./comparison_results/. |
verbose | bool | False | If true, produce verbose output. Defaults to False. |
overwrite | bool | False | If true, force overwriting of existing output files. Defaults to False. |
label_centroids | bool | True | If true, centroids will be labelled. Defaults to True. |
label_subjects | bool | False | If true, will label subjects nodes. Defaults to False. |
centroids_size | int | 500 | Size of the centroids nodes. Defaults to 500. |
centroid_alpha | float | 1 | Alpha value representing the transparency of the centroids nodes. Defaults to 1. |
centroid_node_color | str | 'white' | Centroids nodes color to use. Defaults to white. |
centroid_edge_color | str | 'black' | Assign a color to the edge of the centroids nodes. Defaults to
black. |
subject_node_size | int | 5 | Assign the size of the subjects nodes. Defaults to 5. |
background_alpha | bool | True | If true, will plot the background nodes with alpha = 0.2. Defaults to True. |
subject_edge_color | str | None | Assign a color to the edge of the subjects nodes. Defaults to None. |
colormap | str | 'gray' | Colormap to use when coloring the edges of the network based on the
membership values of each cluster. Available colormaps are those from
Matplotlib
(https://matplotlib.org/stable/tutorials/colors/colormaps.html).
Defaults to gray. |
legend_title | str | 'Membership values' | Legend title (colormap). Defaults to Membership values. |
Examples
CompareGraphs --in-graph1 graph1.gml --in-matrix membership_mat.npy--percentile 80 --in-graph2 graph2.gml