bento.tl.second_moment¶
- bento.tl.second_moment(sdata, shape_key, recompute=False) None¶
Compute second moment of each shape relative to its centroid.
The second moment measures the spread of points in the shape around its center.
- Parameters:
sdata (SpatialData) – Input SpatialData object
shape_key (str) – Key in sdata.shapes containing shape geometries
recompute (bool, default False) – Whether to force recomputation if feature exists
- Returns:
Updates sdata.shapes[shape_key] with: - ‘{shape_key}_moment’: Second moment value for each shape
- Return type:
None