scvi.data.fields.ObsmField#

class scvi.data.fields.ObsmField(*args, **kwargs)[source]#

An AnnDataField for an .obsm field in the AnnData data structure.

Attributes table#

COLUMN_NAMES_KEY

attr_key

The key of the data field within the relevant AnnData attribute.

attr_name

The name of the AnnData attribute where the data is stored.

is_empty

Returns True if the field is empty as a function of its kwargs.

mod_key

The modality key of the data field within the MuData (if applicable).

registry_key

The key that is referenced by models via a data loader.

Methods table#

get_data_registry()

Returns a nested dictionary which describes the mapping to the data field.

get_field_data(adata)

Returns the requested data as determined by the field for a given AnnData/MuData object.

get_summary_stats(state_registry)

Get summary stats.

register_field(adata)

Register the field.

transfer_field(state_registry, adata_target, ...)

Transfer the field.

validate_field(adata)

Validate the field.

view_state_registry(state_registry)

View the state registry.

Attributes#

ObsmField.COLUMN_NAMES_KEY = 'column_names'#
ObsmField.attr_key[source]#
ObsmField.attr_name[source]#
ObsmField.is_empty[source]#
ObsmField.mod_key[source]#

The modality key of the data field within the MuData (if applicable).

ObsmField.registry_key[source]#

Methods#

ObsmField.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:

dict

ObsmField.get_field_data(adata)[source]#

Returns the requested data as determined by the field for a given AnnData/MuData object.

Return type:

Union[ndarray, DataFrame]

ObsmField.get_summary_stats(state_registry)[source]#

Get summary stats.

Return type:

dict

ObsmField.register_field(adata)[source]#

Register the field.

Return type:

dict

ObsmField.transfer_field(state_registry, adata_target, **kwargs)[source]#

Transfer the field.

Return type:

dict

ObsmField.validate_field(adata)[source]#

Validate the field.

Return type:

None

ObsmField.view_state_registry(state_registry)[source]#

View the state registry.

Return type:

Optional[Table]