Skip to content

neurostatx.cli.GraphMetrics

Attributes

NameDescription
OPERATIONSMapping of metric names to NetworkX functions GraphMetrics can run.
appCyclopts application for the GraphMetrics command-line tool.

Functions

NameDescription
GraphMetricsCompute NetworkX metrics on an existing undirected weighted graph.

OPERATIONSattributemodule attribute#

OPERATIONS = get_metrics_ops()

Mapping of metric names to NetworkX functions GraphMetrics can run.

appattributemodule attribute#

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

Cyclopts application for the GraphMetrics command-line tool.

GraphMetricsfunction#

def GraphMetrics(operation: Annotated[List[str], Parameter(show_choices=True, show_default=False, group=Group(Arguments))], out_file: Annotated[str, Parameter(show_default=False, group='Essential Files Options')] = None, verbose: Annotated[bool, Parameter(-v, --verbose, group='Optional parameters')] = False, overwrite: Annotated[bool, Parameter(-f, --overwrite, group='Optional parameters')] = False)

Compute NetworkX metrics on an existing undirected weighted graph.

Runtime depends on hardware and the chosen metric; a large graph (~10 000 nodes) can take about 10 minutes.

Parameters

NameTypeDefaultDescription
operationList[str]requiredList of arguments to provide to the script. The first argument is the operation to perform. The second argument is the input graph file. The rest of the arguments are the arguments required by the operation (see above).
out_filestrNonePath and name of the file containing the metrics for each node. Defaults to ./operation_name.xlsx.
verboseboolFalseIf true, produce verbose output. Defaults to False.
overwriteboolFalseIf true, force overwriting of existing output files. Defaults to False.

Examples

Terminal window
GraphMetrics --out-folder output/ eigencentrality graph.gexf membership