deepcell_types.DCTConfig#

class deepcell_types.DCTConfig(zarr_path=None)#

Inference-time configuration for deepcell_types.predict.

A DCTConfig snapshots the marker / cell-type registry and a small set of preprocessing constants. The registry is loaded from a TissueNet zarr v3 archive when one is available; otherwise it falls back to the vocabulary snapshot (vocab.json) shipped with the package, so predict() works without the (large) archive.

Note: DCTConfig is unrelated to deepcell_types.DEFAULT_CONFIG (a preprocessing op list for the preprocess hook), despite the similar name.

Parameters:
zarr_pathstr or Path, optional

Path to a TissueNet zarr v3 archive. If None, looks for the DEEPCELL_TYPES_ZARR_PATH environment variable, and otherwise falls back to the packaged vocab.json. An explicitly-passed zarr_path that does not contain an archive raises FileNotFoundError. (The tissue->cell-type mapping from get_tct_mapping() is only available in archive mode.)

Attributes:
ARCHIVE_ENV_VARstr

Environment-variable name consulted when zarr_path is None.

CHANNEL_ALIASESdict[str, str]

Canonical channel-name aliases applied during preprocessing.

Methods

get_tct_mapping

resolve_channel_name

Examples

>>> config = DCTConfig()  # reads DEEPCELL_TYPES_ZARR_PATH
>>> config = DCTConfig(zarr_path="/path/to/tissuenet.zarr")
__init__(zarr_path=None)#

Methods

__init__([zarr_path])

get_tct_mapping()

resolve_channel_name(ch_name)

Attributes

ARCHIVE_ENV_VAR

CHANNEL_ALIASES

ct2idx

domain2idx

marker2idx

master_channels