Skip to content

neurostatx.cli.AverageWeightedPath

Attributes

NameDescription
appCyclopts application for the AverageWeightedPath command-line tool.

Functions

NameDescription
AverageWeightedPathCompare a group's average weighted path (AWP) against a null

appattributemodule attribute#

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

Cyclopts application for the AverageWeightedPath command-line tool.

AverageWeightedPathfunction#

def AverageWeightedPath(in_graph: Annotated[str, Parameter(show_default=False, group='Essential Files Options')], label_name: Annotated[List[str], Parameter(show_default=False, group='Essential Files Options')], out_folder: Annotated[str, Parameter(show_default=False, group='Essential Files Options')] = None, cohort: Annotated[int, Parameter(show_default=False, group='Essential Files Options')] = None, iterations: Annotated[int, Parameter(show_default=True, group='Computational Options')] = 1000, weight: Annotated[str, Parameter(show_default=True, group='Computational Options')] = 'membership', method: Annotated[PathLengthsMethods, Parameter(show_choices=True, show_default=True, group='Computational Options')] = PathLengthsMethods.Dijkstra, distribution: Annotated[str, Parameter(show_choices=False, show_default=True, group='Computational Options')] = None, processes: Annotated[int, Parameter(show_default=True, group='Computational Options')] = 1, verbose: Annotated[bool, Parameter(-v, --verbose, group='Optional parameters')] = False, save_parameters: Annotated[bool, Parameter(-s, --save_parameters, group='Optional parameters')] = False, overwrite: Annotated[bool, Parameter(-f, --overwrite, group='Optional parameters')] = False)

Compare a group’s average weighted path (AWP) against a null distribution.

AverageWeightedPath computes the average weighted shortest path length for a group of nodes, compares it to a null distribution generated by randomly selecting the same number of nodes, and reports a p-value for the comparison.

Parameters

NameTypeDefaultDescription
in_graphstrrequiredInput graph file (.gml).
label_nameList[str]requiredLabel(s) name(s) to select group(s) of nodes. Can be multiple.
out_folderstrNoneOutput folder where files will be exported. Defaults to None.
cohortintNoneCohort identifier. If your graph contains data from multiple cohorts, you can specify the cohort you want to compute the AWP for. Defaults to None.
iterationsint1000Number of iterations to perform to generate the null distribution. Defaults to 1000.
weightstr'membership'Name of the edge attributes to use during the weighted path computation. Defaults to membership.
methodPathLengthsMethodsPathLengthsMethods.DijkstraMethod to use for the estimation of the weighted path. Defaults to Dijkstra.
distributionstrNonePre-computed null distribution. Needs to be an .xlsx file containing label name as –label-name. Defaults to None.
processesint1Number of processes to use to compute the null distribution. Defaults to 1.
verboseboolFalseIf true, produce verbose output. Defaults to False.
save_parametersboolFalseIf true, will save input parameters to .txt file. Defaults to False.
overwriteboolFalseIf true, force overwriting of existing output files. Defaults to False.

Examples

Terminal window
AverageWeightedPath --in-graph ./graph.gml --label-name Group1
--label-name Group2 --out-folder ./results --iterations 5000
--weight membership --method Dijkstra