Skip to content

neurostatx.cli.AddNodesAttributes

Attributes

NameDescription
appCyclopts application for the AddNodesAttributes command-line tool.

Functions

NameDescription
AddNodesAttributesAttach tabular labels to graph nodes.

appattributemodule attribute#

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

Cyclopts application for the AddNodesAttributes command-line tool.

AddNodesAttributesfunction#

def AddNodesAttributes(in_graph: Annotated[str, Parameter(show_default=False, group='Essential Files Options')], in_dataset: Annotated[str, Parameter(show_default=False, group='Essential Files Options')], id_column: Annotated[str, Parameter(show_default=False, group='Essential Files Options')], labels: Annotated[List[str], Parameter(show_default=False, group='Essential Files Options')], out_file: Annotated[str, Parameter(show_default=False, group='Essential Files Options')] = 'graph_with_attributes.gml', verbose: Annotated[bool, Parameter(-v, --verbose, group='Optional parameters')] = False, overwrite: Annotated[bool, Parameter(-f, --overwrite, group='Optional parameters')] = False)

Attach tabular labels to graph nodes.

AddNodesAttributes is a script that sets the attributes of the nodes of a graph. The attributes are provided via a tabulated data format (.csv, .xlsx or .txt) file. The script will automatically match the IDs of the nodes with the IDs of the subjects in the file. Name of the variables to add as attributes can be supplied either via a .txt file or with multiple –labels arguments.

Parameters

NameTypeDefaultDescription
in_graphstrrequiredGraph file to add attributes to.
in_datasetstrrequiredDataset containing the variables to add as nodes’ attributes to the graph.
id_columnstrrequiredName of the column containing the subject’s ID tag. Required for proper handling of IDs and merging multiple datasets.
labelsList[str]requiredLabel(s) name(s) to add as nodes’ attributes to the graph. Can be supplied multiple times or as a .txt file containing all names in a line-separated format.
out_filestr'graph_with_attributes.gml'Output graph file name (.gml). Defaults to graph_with_attributes.gml.
verboseboolFalseIf true, produce verbose output. Defaults to False.
overwriteboolFalseIf true, force overwriting of existing output files. Defaults to False.

Examples

Terminal window
AddNodesAttributes --in-graph graph.gml --in-dataset dataset.xlsx
--id-column ID --labels label1 --labels label2 --labels label3
--out-file graph_attributes.gexf --verbose