bento.tl.lp

bento.tl.lp(sdata, instance_key='cell_boundaries', nucleus_key='nucleus_boundaries', groupby='feature_name', num_workers=1, recompute=False)

Predict transcript subcellular localization patterns.

Predicts patterns including: cell edge, cytoplasmic, nuclear edge, nuclear, none. Computes required features if they don’t exist.

Parameters:
  • sdata (SpatialData) – Input SpatialData object

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

  • nucleus_key (str, default “nucleus_boundaries”) – Key for nucleus boundaries in sdata.shapes

  • groupby (str or list of str, default “feature_name”) – Column(s) in sdata.points to group transcripts by

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

  • recompute (bool, default False) – Whether to recompute existing features

Returns:

Modifies sdata.tables[“table”].uns with: - ‘lp’: DataFrame of binary pattern indicators - ‘lpp’: DataFrame of pattern probabilities Also computes pattern statistics via lp_stats()

Return type:

None