cellrank.models.Signal

class cellrank.models.Signal[source]

Continuous, observation-aligned signal to fit along a trajectory.

A signal identifies a single 1D quantity defined for every cell – gene expression (Gene), a covariate in obs (Obs), or a column of an obsm array (Obsm). It is the unit consumed by prepare() and the trajectory plotting functions, replacing the older gene + data_key + use_raw triple.

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.

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

Signal.layer: str | None = None

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

name

Signal.name

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

use_raw

Signal.use_raw: bool = False

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

ylabel

Signal.ylabel: str = 'value'

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

Methods

fetch

Signal.fetch(adata, *, dtype=<class 'numpy.float64'>)[source]

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

Return type:

ndarray

Parameters:

validate

abstractmethod Signal.validate(adata)[source]

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

Return type:

None

Parameters:

adata (AnnData)