scirpy.util.DataHandler

class scirpy.util.DataHandler(data, airr_mod=None, airr_key=None, chain_idx_key=None)

Transparent access to airr modality in both AnnData and MuData objects.

Performs a plausibility check of the input data for public scirpy functions.

Provides convenient accessors to the airr data that is stored somewhere in the input AnnData/MuData.

DataHandler may be called with another DataHandler instance as data attribute. In that case all attributes are taken from the existing DataHandler instance and all keyword attributes are ignored.

Parameters
adata

AnnData or MuData object that contains AIRR information.

airr_mod : str | NoneOptional[str] (default: None)

Name of the modality with AIRR information is stored in the MuData object. if an AnnData object is passed to the function, this parameter is ignored.

airr_key : str | NoneOptional[str] (default: None)

Key under which the AIRR information is stored in adata.obsm as an awkward array.

chain_idx_key : str | NoneOptional[str] (default: None)

Key under which the chain indices are stored in adata.obsm. If chain indices are not present, index_chains() is run with default parameters.

Attributes

TYPE

alias of Union[anndata._core.anndata.AnnData, mudata._core.mudata.MuData, DataHandler]

adata

Reference to the AnnData object of the AIRR modality.

airr

reference to the awkward array with AIRR information.

chain_indices

Reference to the chain indices

data

Get the outermost container.

mdata

Reference to the MuData object.

Methods

check_schema_pre_v0_7(adata)

Raise an error if AnnData is in pre scirpy v0.7 format.

default()

Initailize a DataHandler object with default keys.

get_obs()

Get one or multiple obs columns from either MuData or AIRR AnnData

inject_param_docs(**kwargs)

Inject parameter documentation into a function docstring

set_obs(key, value)

Store results in .obs of AnnData and MuData.

strings_to_categoricals()

Convert strings to categoricals.