Skip to content

neurostatx.cli.CompareClustering

Attributes

NameDescription
appCyclopts application for the CompareClustering command-line tool.

Functions

NameDescription
CompareClusteringCompare clustering solutions with an Adjusted Rand Index (ARI) heatmap.

appattributemodule attribute#

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

Cyclopts application for the CompareClustering command-line tool.

CompareClusteringfunction#

def CompareClustering(in_dataset: Annotated[List[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=False, group='Essential Files Options')], columns_name: Annotated[List[str], Parameter(group='Visualization Options', show_default=True)] = [], cmap: Annotated[str, Parameter(show_default=True, group='Visualization Options')] = 'magma', title: Annotated[str, Parameter(show_default=True, group='Visualization Options')] = 'Adjusted Rand Index Heatmap', 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 clustering solutions with an Adjusted Rand Index (ARI) heatmap.

CompareClustering compares clustering results from multiple solutions using ARI and writes a heatmap of the pairwise scores.

Parameters

NameTypeDefaultDescription
in_datasetList[str]requiredInput dataset(s) (at least 2 are expected to produce a comparison).
id_columnstrrequiredName of the column containing the subject’s ID tag. Required for proper handling of IDs and merging multiple datasets.
desc_columnsintrequiredNumber of descriptive columns at the beginning of the dataset to exclude in statistics and descriptive tables.
out_folderstrrequiredOutput folder containing the results.
columns_nameList[str][]Name given to each input dataset (needs to be in the same order as the input datasets). Defaults to [].
cmapstr'magma'Name of the colormap to use. Defaults to magma. See https://matplotlib.org/stable/tutorials/colors/colormaps.html.
titlestr'Adjusted Rand Index Heatmap'Heatmap title. Defaults to Adjusted Rand Index Heatmap.
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
CompareClustering --in_dataset dataset1.csv --in_dataset dataset2.csv
--in_dataset dataset3.csv --id_column ID --desc_columns 1 --out_folder
./ --columns_name dataset1 dataset2 dataset3 --title "ARI Heatmap"
--verbose