neurostatx.cli.ComputeGraphNetwork
Attributes
| Name | Description |
|---|---|
app | Cyclopts application for the ComputeGraphNetwork command-line tool. |
Functions
| Name | Description |
|---|---|
ComputeGraphNetwork | Build an undirected weighted graph from a fuzzy membership matrix. |
appattributemodule attribute#
app = App(default_parameter=Parameter(negative=()))Cyclopts application for the ComputeGraphNetwork command-line tool.
ComputeGraphNetworkfunction#
def ComputeGraphNetwork(in_dataset: Annotated[str, Parameter(show_default=False, group='Essential Files Options')], id_column: Annotated[str, Parameter(show_default=False, group='Essential Files Options')], desc_columns: Annotated[int, Parameter(show_default=False, group='Essential Files Options')], out_folder: Annotated[str, Parameter(show_default=True, group='Essential Files Options')] = './graph_results/', 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, plot_distribution: Annotated[bool, Parameter(show_default=True, group='Plotting Options')] = False, import_data: Annotated[bool, Parameter(show_default=True, group='Essential Files Options')] = False, layout: Annotated[NetworkLayout, Parameter(show_default=True, show_choices=True, group='Layout Options')] = NetworkLayout.Spring, method: Annotated[str, Parameter(show_default=True, group='Layout Options')] = 'force', seed: Annotated[int, Parameter(show_default=True, group='Layout Options')] = 42, weight: Annotated[str, Parameter(show_default=True, group='Layout Options')] = 'membership')Build an undirected weighted graph from a fuzzy membership matrix.
ComputeGraphNetwork is designed to work seamlessly with FuzzyClustering. Mapping membership matrices to a graph allows later use of graph-theory statistics such as shortest path and betweenness centrality.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
in_dataset | str | required | Input dataset containing membership values for each cluster. |
id_column | str | required | Name of the column containing the subject’s ID tag. Required for proper handling of IDs. |
desc_columns | int | required | Number of descriptive columns at the beginning of the dataset. |
out_folder | str | './graph_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
./graph_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. |
save_parameters | bool | False | If true, save the parameters used in a .txt file. Defaults to False. |
plot_distribution | bool | False | If true, will plot the membership distribution and delta. Defaults to False. |
import_data | bool | False | If true, will import the data from the input dataset within the graph network file. Defaults to False. |
layout | NetworkLayout | NetworkLayout.Spring | Layout algorithm to determine the nodes position. Defaults to Spring. |
method | str | 'force' | Layout method passed to the NetworkX layout algorithm. Defaults to
force. |
seed | int | 42 | Random seed used when computing node positions. Defaults to 42. |
weight | str | 'membership' | Name of the column containing the edge weight. Defaults to
membership. |
Examples
ComputeGraphNetwork --in-dataset cluster_membership.xlsx--id-column subjectkey --desc-columns 1 --out-folder output/