bento.tl.register_shape_feature

bento.tl.register_shape_feature(name, func)
Register a shape feature function. The function should take an SpatialData object and a shape name as input.

The function should add the feature to the SpatialData object as a column in SpatialData.table.obs. This should be done in place and not return anything.

Parameters:
  • name (str) – Name of the feature function.

  • func (function) – Function that takes a SpatialData object and a shape name as arguments.