Skip to content

neurostatx.cli.ComputeGraphNetwork

Attributes

NameDescription
appCyclopts application for the ComputeGraphNetwork command-line tool.

Functions

NameDescription
ComputeGraphNetworkBuild 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

NameTypeDefaultDescription
in_datasetstrrequiredInput dataset containing membership values for each cluster.
id_columnstrrequiredName of the column containing the subject’s ID tag. Required for proper handling of IDs.
desc_columnsintrequiredNumber of descriptive columns at the beginning of the dataset.
out_folderstr'./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/.
verboseboolFalseIf true, produce verbose output. Defaults to False.
overwriteboolFalseIf true, force overwriting of existing output files. Defaults to False.
save_parametersboolFalseIf true, save the parameters used in a .txt file. Defaults to False.
plot_distributionboolFalseIf true, will plot the membership distribution and delta. Defaults to False.
import_databoolFalseIf true, will import the data from the input dataset within the graph network file. Defaults to False.
layoutNetworkLayoutNetworkLayout.SpringLayout algorithm to determine the nodes position. Defaults to Spring.
methodstr'force'Layout method passed to the NetworkX layout algorithm. Defaults to force.
seedint42Random seed used when computing node positions. Defaults to 42.
weightstr'membership'Name of the column containing the edge weight. Defaults to membership.

Examples

Terminal window
ComputeGraphNetwork --in-dataset cluster_membership.xlsx
--id-column subjectkey --desc-columns 1 --out-folder output/