SPADEResult¶
densitree.result.SPADEResult(labels_, tree_, X_down, down_idx, n_features, feature_names=None, _cluster_stats=None)
dataclass
¶
Rich output object from a SPADE run.
Attributes:
| Name | Type | Description |
|---|---|---|
labels_ |
(ndarray[int], shape(n_cells))
|
Cluster assignment for every original cell. |
tree_ |
Graph
|
MST connecting cluster centroids. Each node has |
X_down |
(ndarray, shape(n_down, n_features))
|
Downsampled cells used for clustering. |
down_idx |
(ndarray[int], shape(n_down))
|
Indices into the original array for the downsampled cells. |
cluster_stats_ |
DataFrame
|
One row per cluster with |
plot_tree(color_by=None, size_by='count', backend='matplotlib')
¶
Visualize the SPADE tree.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
color_by
|
int | str | None
|
Feature index (int) or name (str) to color nodes by median expression.
|
None
|
size_by
|
str
|
|
'count'
|
backend
|
str
|
|
'matplotlib'
|