scglue.data.get_metacells

scglue.data.get_metacells(*adatas, use_rep=None, n_meta=None, common=True, seed=0, agg_kwargs=None)[source]

Aggregate datasets into metacells

Parameters
  • *adatas – Datasets to be correlated

  • use_rep (Optional[str]) – Data representation based on which to cluster meta-cells

  • n_meta (Optional[int]) – Number of metacells to use

  • common (bool) – Whether to return only metacells common to all datasets

  • seed (int) – Random seed for k-Means clustering

  • agg_kwargs (Optional[List[Optional[Mapping[str, Any]]]]) – Keyword arguments per dataset passed to aggregate_obs()

Return type

List[AnnData]

Returns

adatas – A list of AnnData objects containing the metacells

Note

When a single dataset is provided, the metacells are clustered with the dataset itself. When multiple datasets are provided, the metacells are clustered jointly with all datasets.