troutpy.pp.create_grid_squares

troutpy.pp.create_grid_squares#

troutpy.pp.create_grid_squares(sdata, layer='transcripts', square_size=50)#

Generate a grid of square polygons covering the transcript space.

Parameters:
  • sdata (spatialdata.SpatialData) – The spatial data object containing transcript coordinates.

  • layer (str) – The key to access transcript coordinates in sdata.

  • square_size (int) – The size of each square grid cell.

Return type:

tuple[ShapesModel, ndarray]

Returns:

tuple: A ShapesModel containing the grid squares and an array of centroid coordinates.