spatialvi.data.NeighborhoodGraphField#
- class spatialvi.data.NeighborhoodGraphField(obsm_key)[source]#
AnnData obsm field for neighbor index/distance arrays.
Stores dense numpy arrays. Squidpy outputs sparse CSR matrices — this field converts them to dense on registration (documented behavior). Keys:
index_neighboranddistance_neighbor(matching upstream ResolVI).- Parameters:
obsm_key (
str) – Key to access the neighbor graph inadata.obsm.
Methods
__init__(obsm_key)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
COLUMN_NAMES_KEYattr_keyThe key of the data field within the relevant AnnData attribute.
attr_nameThe name of the AnnData attribute where the data is stored.
is_emptyReturns True if the field is empty as a function of its kwargs.
mod_keyThe modality key of the data field within the MuData (if applicable).
registry_keyThe key that is referenced by models via a data loader.