liana.multi.lrdata_to_mudata#
- liana.multi.lrdata_to_mudata(lrdata, xy_sep='^', min_cells=5, min_features=10, obs_keys=None, verbose=False)#
Convert an inflow score AnnData object to a MuData object, where each modality corresponds to a unique sender cell type.
- Parameters:
adata – Annotated data object.
xy_sep (
str(default:'^')) – Separator between the sender cell-type/view prefix and the ligand-receptor interaction name inlrdata.var_names(e.g."celltype^ligand^receptor"). Matches thexy_sepconvention used byliana.method.inflow(). Defaults to'^'.min_cells (
int|None(default:5)) – Minimum cells (per cell identity if grouped bygroupby) to be considered for downstream analysis.min_features (int | None, default 10) – Modalities with fewer than this many features after cell-filtering are dropped entirely. Pass
Noneto keep all modalities.obs_keys (
list[str] |None(default:None)) – List of keys inlrdata.obsthat should be included in the MuData object.verbose (
bool(default:False)) – Verbosity flag.
- Return type:
- Returns:
MuData MuData object with one modality per sender cell type.
- Raises:
TypeError – If
lrdatais not an AnnData object.ValueError – If any of the provided keys are not found in
lrdata.obs.
Examples
>>> mdata = lrdata_to_mudata(lrdata, min_cells=5, min_features=10)