cellrank.models.Obs

class cellrank.models.Obs(key)[source]

A numeric per-cell covariate stored in obs, e.g. a gene module score.

Parameters:

key (str) – Column in obs.

Attributes table

layer

Layer the values are fetched from, if any.

name

Human-readable name, used for titles, labels and result keys.

use_raw

Whether the values are fetched from raw.

ylabel

Default y-axis label used when the signal name is shown as a title instead.

key

Methods table

fetch(adata, *[, dtype])

Return the signal as a dense 1D ndarray aligned to obs_names.

validate(adata)

Raise a descriptive error if this signal cannot be fetched from adata.

Attributes

layer

Obs.layer: str | None = None

Layer the values are fetched from, if any. Only meaningful for Gene.

name

Obs.name

use_raw

Obs.use_raw: bool = False

Whether the values are fetched from raw. Only meaningful for Gene.

ylabel

Obs.ylabel: str = 'value'

Default y-axis label used when the signal name is shown as a title instead.

key

Obs.key: str

Methods

fetch

Obs.fetch(adata, *, dtype=<class 'numpy.float64'>)

Return the signal as a dense 1D ndarray aligned to obs_names.

Return type:

ndarray

Parameters:

validate

Obs.validate(adata)[source]

Raise a descriptive error if this signal cannot be fetched from adata.

Return type:

None

Parameters:

adata (AnnData)