cellrank.models.Gene

class cellrank.models.Gene(gene, layer=None, use_raw=False)[source]

Gene expression signal, fetched from X, a layer, or raw.

Parameters:
  • gene (str) – Gene in var_names (or raw .var_names when use_raw = True).

  • layer (str | None) – Key in layers to fetch from. If None, use X.

  • use_raw (bool) – Whether to fetch from raw. Cannot be combined with layer.

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.

gene

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

Gene.layer: str | None = None

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

name

Gene.name

use_raw

Gene.use_raw: bool = False

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

ylabel

Gene.ylabel: str = 'expression'

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

gene

Gene.gene: str

Methods

fetch

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

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

Return type:

ndarray

Parameters:

validate

Gene.validate(adata)[source]

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

Return type:

None

Parameters:

adata (AnnData)