You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The clusters are added to the `key_added` column of the "inference_patches" shapes (`key_added='cluster'` by default).
36
32
37
33
Args:
38
-
sdata: A `SpatialData` object
39
-
element: The `DataArray` containing the embeddings, or the name of the element
40
-
method: Callable that takes as an input an array of size `(n_patches x embedding_size)` and returns an array of clusters of size `n_patches`, or an available method name (`leiden`)
41
-
key_added: The key containing the clusters to be added to the patches `GeoDataFrame`
34
+
sdata: A `SpatialData` object. Can be `None` if element is an `AnnData` object.
35
+
element: The `AnnData` containing the embeddings, or the name of the element
36
+
method: Callable that takes as an AnnData object and returns an array of clusters of size `n_obs`, or an available method name (`leiden`)
37
+
key_added: The key containing the clusters to be added to the `element.obs`
42
38
method_kwargs: kwargs provided to the method callable
43
39
"""
44
40
ifisinstance(element, str):
45
-
element: DataArray=sdata.images[element]
41
+
element: AnnData=sdata.tables[element]
46
42
47
43
ifisinstance(method, str):
48
44
assertmethodinMETHODS_DICT, f"Method {method} is not available. Use one of: {', '.join(METHODS_DICT.keys())}"
0 commit comments