bento.tl.analyze_points

bento.tl.analyze_points(sdata, shape_keys, feature_names, points_key='transcripts', instance_key='cell_boundaries', groupby=None, recompute=False, progress=False, num_workers=1) None

Calculate features for point groups within cells.

Efficiently avoids recomputing cell-level features by compiling and computing once the set of required cell-level features and attributes for each feature.

Parameters:
  • sdata (SpatialData) – Input SpatialData object

  • shape_keys (str or list of str) – Names of shapes to analyze in sdata.shapes

  • feature_names (str or list of str) – Names of features to compute; list available features with bt.tl.list_point_features()

  • points_key (str, default “transcripts”) – Key for points in sdata.points

  • instance_key (str, default “cell_boundaries”) – Key for cell boundaries in sdata.shapes

  • groupby (str or list of str, optional) – Column(s) in sdata.points[points_key] to group by

  • recompute (bool, default False) – Whether to force recomputation of features

  • progress (bool, default False) – Whether to show progress bars

  • num_workers (int, default 1) – Number of parallel workers

Returns:

Updates sdata.tables[“table”].uns[“{instance_key}_{groupby}_features”] with computed features

Return type:

None

Raises:

KeyError – If required shape keys or groupby columns are not found