muon.MuData#
- class muon.MuData(data: AnnData | Mapping[str, AnnData] | MuData = None, feature_types_names: dict | None = {'Antibody Capture': 'prot', 'Gene Expression': 'rna', 'Peaks': 'atac'}, as_view: bool = False, index: Tuple[slice | Integral, slice | Integral] | slice | Integral | None = None, **kwargs)#
Multimodal data object
MuData represents modalities as collections of AnnData objects as well as includes multimodal annotations such as embeddings and neighbours graphs learned jointly on multiple modalities and generalised sample and feature metadata tables.
- __init__(data: AnnData | Mapping[str, AnnData] | MuData = None, feature_types_names: dict | None = {'Antibody Capture': 'prot', 'Gene Expression': 'rna', 'Peaks': 'atac'}, as_view: bool = False, index: Tuple[slice | Integral, slice | Integral] | slice | Integral | None = None, **kwargs)#
Methods
__init__([data, feature_types_names, ...])copy([filename])obs_keys()List keys of observation annotation
obs.obs_names_make_unique()Call .obs_names_make_unique() method on each AnnData object.
obs_vector(key[, layer])Return an array of values for the requested key of length n_obs
obsm_keys()List keys of observation annotation
obsm.strings_to_categoricals([df])Transform string columns in .var and .obs slots of MuData to categorical as well as of .var and .obs slots in each AnnData object
uns_keys()List keys of unstructured annotation.
update()Update both .obs and .var of MuData with the data from all the modalities
update_obs()Update .obs slot of MuData with the newest .obs data from all the modalities
update_var()Update .var slot of MuData with the newest .var data from all the modalities
var_keys()List keys of variable annotation
var.var_names_make_unique()Call .var_names_make_unique() method on each AnnData object.
var_vector(key[, layer])Return an array of values for the requested key of length n_var
varm_keys()List keys of variable annotation
varm.write([filename])Write MuData object to an HDF5 file
write_h5mu([filename])Write MuData object to an HDF5 file
write_zarr(store, **kwargs)Write MuData object to a Zarr store
Attributes
axisMuData axis
filenameisbackedn_modn_obsTotal number of observations
n_varTotal number of variables
n_varsTotal number of variables
obsAnnotation of observation
obs_namesNames of variables (alias for .obs.index)
obsmMulti-dimensional annotation of observation
obsmapMapping of observation index in the MuData to indices in individual modalities.
obspPairwise annotatation of observations
shapeShape of data, all variables and observations combined (
n_obs,n_var).varAnnotation of variables
var_namesNames of variables (alias for .var.index)
varmMulti-dimensional annotation of variables
varmapMapping of feature index in the MuData to indices in individual modalities.
varpPairwise annotatation of variables