_Assay.cluster

_Assay.cluster(attribute, method='dbscan', **kwargs)

Identify clusters of cells.

Modifies the label row attribute of the assay.

Parameters
attributestr / np.array

The attribute to use as coordinates for clustering. Uses _Assay.get_attribute() to retrieve the values constrained by row.

methodstr

dbscan, hdbscan, kmeans, or graph-community (Louvain on a shared nearest neighbor graph).

kwargsdictionary

Passed to the appropriate clustering method.

Available parameters for the methods are:
  1. dbscaneps (float)

    A measure of how close the points are.

  2. hdbscanmin_cluster_size (int)

    The number of cells in a cluster.

  3. kmeansn_clusters (int)

    The number of clusters to be generated.

  4. graph-communityk (int)

    The number of nearest neighbors to consider in the shared nearest neighbor graph generation.

Raises
ValueError

When the row attribute is not available in the assay.

Exception

When an unsupported clustering method is provided.