liana.utils.mdata_to_anndata¶
- liana.utils.mdata_to_anndata(mdata, x_mod, y_mod, x_layer=None, y_layer=None, x_use_raw=False, y_use_raw=False, x_transform=None, y_transform=None, verbose=True)¶
Convert a MultiData object to an AnnData object.
- Parameters:
- mdata
MuData object.
- x_mod
Name of the modality to be used as x.
- y_mod
Name of the modality to be used as y.
- x_layer
Layer to be used for modality x.
- y_layer
Layer to be used for modality y.
- x_use_raw
Whether to use raw counts for modality x.
- y_use_raw
Whether to use raw counts for modality y.
- x_transform
Transformation function to be applied to modality x.
- y_transform
Transformation function to be applied to modality y.
- verbose
Verbosity flag.
- Returns:
- An AnnData object with the two modalities concatenated.
- Information related to observations (obs, obsp, obsm) and .uns are copied from the original MuData object.