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
|None
Optional
[str
] (default:None
) Name of the modality with AIRR information is stored in the
MuData
object. if anAnnData
object is passed to the function, this parameter is ignored.- airr_key :
str
|None
Optional
[str
] (default:None
) Key under which the AIRR information is stored in adata.obsm as an awkward array.
- chain_idx_key :
str
|None
Optional
[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
alias of
Union
[anndata._core.anndata.AnnData
,mudata._core.mudata.MuData
,DataHandler
]Reference to the AnnData object of the AIRR modality.
reference to the awkward array with AIRR information.
Reference to the chain indices
Get the outermost container.
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.
Convert strings to categoricals.