scdef.tl.get_obs_score_rankings ¶
get_obs_score_rankings(model: scDEF, layer: Union[int, str], obs_key: str, obs_values: Union[str, Sequence[str]], mode: Literal['f1', 'fracs', 'weights', 'prob', 'soft_prec', 'score'] = 'fracs', ascending: bool = False, recompute: bool = False) -> DataFrame
Return per-obs-value factor rankings by observation association score.
This reads cached matrices from model.adata.uns['obs_scores'] (written by
scd.pl.obs_scores). If cache is missing/stale for the requested key/model,
it is recomputed on demand for the requested obs_key and mode.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
model
|
scDEF
|
fitted scDEF model. |
required |
layer
|
Union[int, str]
|
layer to rank factors in, as an index or a name from
|
required |
obs_key
|
str
|
column in |
required |
obs_values
|
Union[str, Sequence[str]]
|
one or more values of |
required |
mode
|
Literal['f1', 'fracs', 'weights', 'prob', 'soft_prec', 'score']
|
which association score to rank by — |
'fracs'
|
ascending
|
bool
|
if True, rank from lowest score to highest. Ranking is always
grouped by |
False
|
recompute
|
bool
|
force the score matrix to be recomputed even when a cache entry
for this |
False
|
Returns:
| Type | Description |
|---|---|
DataFrame
|
One row per ( |
DataFrame
|
|