scvi.data.fields.LayerField#
- class scvi.data.fields.LayerField(registry_key, layer, is_count_data=True, correct_data_format=True, check_fragment_counts=False)[source]#
An AnnDataField for layer or X attributes in the AnnData data structure.
- Parameters:
registry_key (
str
) – Key to register field under in data registry.layer (
str
|None
) – Key to access the field in the AnnData layers mapping. If None, uses the data in .X.is_count_data (
bool
(default:True
)) – If True, checks if the data are counts during validation.correct_data_format (
bool
(default:True
)) – If True, checks and corrects that the AnnData field is C_CONTIGUOUS and csr if it is dense numpy or sparse respectively.save_column_names – If True, saves var names to the associated state registry as
column_names
.
Attributes table#
The key of the data field within the relevant AnnData attribute. |
|
The name of the AnnData attribute where the data is stored. |
|
Returns True if the field is empty as a function of its kwargs. |
|
The modality key of the data field within the MuData (if applicable). |
|
The key that is referenced by models via a data loader. |
Methods table#
Returns a nested dictionary which describes the mapping to the data field. |
|
|
Returns the requested data as determined by the field. |
|
Get summary stats. |
|
Register the field. |
|
Transfer the field. |
|
Validate the field. |
|
View the state registry. |
Attributes#
- LayerField.COLUMN_NAMES_KEY = 'column_names'#
- LayerField.N_CELLS_KEY = 'n_cells'#
- LayerField.N_OBS_KEY = 'n_obs'#
- LayerField.N_VARS_KEY = 'n_vars'#
Methods#
- LayerField.get_data_registry()[source]#
Returns a nested dictionary which describes the mapping to the data field.
The dictionary is of the form {“mod_key”: mod_key, “attr_name”: attr_name, “attr_key”: attr_key}. This mapping is then combined with the mappings of other fields to make up the data registry.
- Return type: