get_object_stats

FeatureExtractor.get_object_stats(area_threshold=10, agg=('median',), save=False)[source]

Aggregate object stats per obj_id.

Parameters
  • area_threshold (int) – All components smaller than this threshold are discarded.

  • agg (Union[Iterable[str], Mapping[str, str]]) – List of aggregation function or dict with {feature: function}. Passed to pd.GroupBy.agg()

  • save (bool) – Save adata object with object_stats_agg entry in obsm.

Return type

DataFrame

Returns

  • pd.DataFrame – obj_id x (clustering, feature) dataframe

  • Additionally stores result in self.adata.obsm['object_stats_agg']