scdef.pl.within_group_pairwise_dissimilarity ¶
within_group_pairwise_dissimilarity(model: scDEF, layer: Union[int, str], obs_key: str, metric: Literal['jsd', 'euclidean', 'cosine'] = 'jsd', kind: Literal['box', 'violin'] = 'box', showfliers: bool = False, figsize: Tuple[float, float] = (8, 4), show: bool = True) -> Optional[Figure]
Plot within-group pairwise dissimilarity distributions.
Uses cached results from
model.adata.uns['within_group_pairwise_dissimilarity'] when available,
otherwise computes them with
scdef.tl.compute_within_group_pairwise_dissimilarity.
A group whose cells sit far apart in factor space is heterogeneous at that resolution, which is a reason to look for structure inside it at a finer layer.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
model
|
scDEF
|
fitted scDEF model. |
required |
layer
|
Union[int, str]
|
layer whose factor memberships represent each cell, as an index or a
name from |
required |
obs_key
|
str
|
|
required |
metric
|
Literal['jsd', 'euclidean', 'cosine']
|
distance between two cells' membership vectors — |
'jsd'
|
kind
|
Literal['box', 'violin']
|
draw each group's distribution as a box or a violin. |
'box'
|
showfliers
|
bool
|
draw outlier points beyond the whiskers. Only affects |
False
|
figsize
|
Tuple[float, float]
|
figure size in inches. |
(8, 4)
|
show
|
bool
|
call |
True
|
Returns:
| Type | Description |
|---|---|
Optional[Figure]
|
The figure when |