cellcharter.tl.elongation#
- cellcharter.tl.elongation(adata, cluster_key='component', out_key='elongation', copy=False)#
Compute the elongation of the topological boundaries of sets of cells.
It computes the minimum bounding rectangle of the polygon and divides the length of the minor axis by the length of the major axis.
- Parameters:
adata (
AnnData
) – Annotated data object.cluster_key (
str
(default:'component'
)) – Key inanndata.AnnData.obs
where the cluster labels are stored.out_key (
str
(default:'elongation'
)) – Key inanndata.AnnData.obs
where the metric values are stored ifcopy = False
.copy (
bool
(default:False
)) – IfTrue
, return the result, otherwise save it to theadata
object.
- Return type:
- Returns:
If
copy = True
, returns adict
with the cluster labels as keys and the elongation as values.- Otherwise, modifies the
adata
with the following key: anndata.AnnData.uns
['shape_{{cluster_key}}']['{{out_key}}']
- - the above mentioneddict
.
- Otherwise, modifies the