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.obswhere the cluster labels are stored.out_key (
str(default:'elongation')) – Key inanndata.AnnData.obswhere the metric values are stored ifcopy = False.copy (
bool(default:False)) – IfTrue, return the result, otherwise save it to theadataobject.
- Return type:
- Returns:
If
copy = True, returns adictwith the cluster labels as keys and the elongation as values.- Otherwise, modifies the
adatawith the following key: anndata.AnnData.uns['shape_{{cluster_key}}']['{{out_key}}']- - the above mentioneddict.
- Otherwise, modifies the