scvi.data.register_tensor_from_anndata

scvi.data.register_tensor_from_anndata(adata, registry_key, adata_attr_name, adata_key_name, is_categorical=False, adata_alternate_key_name=None)[source]

Add another tensor to scvi data registry.

This function is intended for contributors testing out new models.

Parameters
adata : AnnDataAnnData

AnnData with “_scvi” key in .uns

registry_key : strstr

Key for tensor in registry, which will be the key in the dataloader output

adata_attr_name : {‘obs’, ‘var’, ‘obsm’, ‘varm’, ‘uns’}Literal[‘obs’, ‘var’, ‘obsm’, ‘varm’, ‘uns’]

AnnData attribute with tensor

adata_key_name : strstr

key in adata_attr_name with data

is_categorical : bool | NoneOptional[bool] (default: False)

Whether or not data is categorical

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

Added key in adata_attr_name for categorical codes if is_categorical is True