scvi.data.fields.VarmField#

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

An AnnDataField for a .varm 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.

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#

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

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

VarmField.registry_key[source]#

Methods#

VarmField.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

VarmField.get_field_data(adata)[source]#

Returns the requested data as determined by the field.

Return type:

ndarray | DataFrame

VarmField.get_summary_stats(state_registry)[source]#

Get summary stats.

Return type:

dict

VarmField.register_field(adata)[source]#

Register the field.

Return type:

dict

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

Transfer the field.

Return type:

dict

VarmField.validate_field(adata)[source]#

Validate the field.

Return type:

None

VarmField.view_state_registry(state_registry)[source]#

View the state registry.

Return type:

Table | None