bento.tl.comp_diff

bento.tl.comp_diff(sdata, points_key, shape_names, groupby, ref_group)

Calculate the average difference in gene composition for shapes across batches of cells. Uses the Wasserstein distance.

Parameters:
  • sdata (spatialdata.SpatialData) – Spatial formatted SpatialData object.

  • shape_names (list of str) – Names of shapes to calculate compositions for.

  • groupby (str) – Key in sdata.points[‘transcripts] to group cells by.

  • ref_group (str) – Reference group to compare other groups to.