Protein.cluster
Protein.cluster#
- Protein.cluster(attribute: Union[str, numpy.ndarray], method: str = 'dbscan', **kwargs: Any)#
Identify clusters of cells.
Modifies the label row attribute of the assay.
- Parameters
- attributestr / np.ndarray
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. kmeans and graph-community accept a random_state parameter to produce reproducible results.
- Available parameters for the methods are:
- dbscaneps (float)
A measure of how close the points are.
- hdbscanmin_cluster_size (int)
The number of cells in a cluster.
- kmeansn_clusters (int)
The number of clusters to be generated.
- 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.