Bases: object
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.
data – AnnData object or dictionary with AnnData objects as values. If a dictionary is passed, the keys will be used as modality names. If None, creates an empty MuData object.
feature_types_names – Dictionary to map feature types encoded in data.var[“feature_types”] to modality names. Only relevant when data is an AnnData object. Default: {“Gene Expression”: “rna”, “Peaks”: “atac”, “Antibody Capture”: “prot”}
as_view – Create a view of the MuData object.
index – Index to slice the MuData object when creating the view.
**kwargs – Additional arguments to create a MuData object.
Methods
Attributes
MuData axis
Make a copy.
filename – If the object is backed, copy the object to a new file.
Filename of the MuData object.
The path to the file if backed, None otherwise.
Path | None
Whether the MuData object is backed.
True if the object is backed, False otherwise.
bool
Names of modalities (alias for list(mdata.mod.keys()))
This property is read-only.
Number of modalities in the MuData object.
The number of modalities.
int
Total number of observations
Total number of variables
Total number of variables
Annotation of observation
List keys of observation annotation obs
.
Names of variables (alias for .obs.index)
Call .obs_names_make_unique() method on each AnnData object.
If there are obs_names, which are the same for multiple modalities, append modality name to all obs_names.
Return an array of values for the requested key of length n_obs
Multi-dimensional annotation of observation
List keys of observation annotation obsm
.
Mapping of observation index in the MuData to indices in individual modalities.
1-based, 0 indicates that the corresponding observation is missing in the respective modality.
Pairwise annotatation of observations
Copy the data from the modalities to the global .obs, existing columns to be overwritten or updated
columns – List of columns to pull from the modalities’ .obs tables
common – If True, pull common columns. Common columns do not have modality prefixes. Pull from all modalities. Cannot be used with columns. True by default.
mods – List of modalities to pull from.
join_common – If True, attempt to join common columns. Common columns are present in all modalities. True for MuData wth axis=1 (shared var). False for MuData with axis=0 and axis=-1. Cannot be used with mods, or for shared attr.
nonunique – If True, pull columns that have a modality prefix such that there are multiple columns with the same name and different prefix. Cannot be used with columns or mods. True by default.
join_nonunique – If True, attempt to join non-unique columns. Intended usage is the same as for join_common. Cannot be used with mods, or for shared attr. False by default.
unique – If True, pull columns that have a modality prefix such that there is no other column with the same name and a different modality prefix. Cannot be used with columns or mods. True by default.
prefix_unique – If True, prefix unique column names with modname (default). No prefix when False.
drop – If True, drop the columns from the modalities after pulling.
only_drop – If True, drop the columns but do not actually pull them. Forces drop=True.
Copy the data from the modalities to the global .var, existing columns to be overwritten or updated
columns – List of columns to pull from the modalities’ .var tables
common – If True, pull common columns. Common columns do not have modality prefixes. Pull from all modalities. Cannot be used with columns. True by default.
mods – List of modalities to pull from.
join_common – If True, attempt to join common columns. Common columns are present in all modalities. True for MuData with axis=0 (shared obs). False for MuData with axis=1 and axis=-1. Cannot be used with mods, or for shared attr.
nonunique – If True, pull columns that have a modality prefix such that there are multiple columns with the same name and different prefix. Cannot be used with columns or mods. True by default.
join_nonunique – If True, attempt to join non-unique columns. Intended usage is the same as for join_common. Cannot be used with mods, or for shared attr. False by default.
unique – If True, pull columns that have a modality prefix such that there is no other column with the same name and a different modality prefix. Cannot be used with columns or mods. True by default.
prefix_unique – If True, prefix unique column names with modname (default). No prefix when False.
drop – If True, drop the columns from the modalities after pulling.
only_drop – If True, drop the columns but do not actually pull them. Forces drop=True.
Copy the data from the mdata.obs to the modalities, existing columns to be overwritten
columns – List of columns to push
mods – List of modalities to push to
common – If True, push common columns. Common columns do not have modality prefixes. Push to each modality unless all values for a modality are null. Cannot be used with columns. True by default.
prefixed – If True, push columns that have a modality prefix. which are prefixed by modality names. Only push to the respective modality names. Cannot be used with columns. True by default.
drop – If True, drop the columns from the global .obs after pushing. False by default.
only_drop – If True, drop the columns but do not actually pull them. Forces drop=True. False by default.
Copy the data from the mdata.var to the modalities, existing columns to be overwritten
columns – List of columns to push
mods – List of modalities to push to
common – If True, push common columns. Common columns do not have modality prefixes. Push to each modality unless all values for a modality are null. Cannot be used with columns. True by default.
prefixed – If True, push columns that have a modality prefix. which are prefixed by modality names. Only push to the respective modality names. Cannot be used with columns. True by default.
drop – If True, drop the columns from the global .var after pushing. False by default.
only_drop – If True, drop the columns but do not actually pull them. Forces drop=True. False by default.
Shape of data, all variables and observations combined (n_obs
, n_var
).
Transform string columns in .var and .obs slots of MuData to categorical as well as of .var and .obs slots in each AnnData object
This keeps it compatible with AnnData.strings_to_categoricals() method.
Convert MuData to AnnData
If mdata.axis == 0 (shared observations), concatenate modalities along axis 1 (anndata.concat(axis=1)). If mdata.axis == 1 (shared variables), concatenate datasets along axis 0 (anndata.concat(axis=0)).
See anndata.concat() documentation for more details.
data (MuData) – MuData object to convert to AnnData
kwargs (dict) – Keyword arguments passed to anndata.concat()
Unstructured annotation (ordered dictionary).
List keys of unstructured annotation.
Update both .obs and .var indices of MuData with the data from all the modalities
NOTE: From v0.4, it will not pull columns from modalities by default.
Update global .obs_names according to the .obs_names of all the modalities.
Update global .var_names according to the .var_names of all the modalities.
Annotation of variables
List keys of variable annotation var
.
Names of variables (alias for .var.index)
Call .var_names_make_unique() method on each AnnData object.
If there are var_names, which are the same for multiple modalities, append modality name to all var_names.
Return an array of values for the requested key of length n_var
Multi-dimensional annotation of variables
List keys of variable annotation varm
.
Mapping of feature index in the MuData to indices in individual modalities.
1-based, 0 indicates that the corresponding observation is missing in the respective modality.
Pairwise annotatation of variables
Write MuData object to an HDF5 file
Write MuData object to an HDF5 file
Write MuData object to a Zarr store
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4