neurostatx.cli.GraphMetrics
Attributes
| Name | Description |
|---|---|
OPERATIONS | Mapping of metric names to NetworkX functions GraphMetrics can run. |
app | Cyclopts application for the GraphMetrics command-line tool. |
Functions
| Name | Description |
|---|---|
GraphMetrics | Compute 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
| Name | Type | Default | Description |
|---|---|---|---|
operation | List[str] | required | List 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_file | str | None | Path and name of the file containing the metrics for each node.
Defaults to ./operation_name.xlsx. |
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. |
Examples
GraphMetrics --out-folder output/ eigencentrality graph.gexf membership