harpy.pt.add_points

Contents

harpy.pt.add_points#

harpy.pt.add_points(sdata, ddf, output_points_name, coordinates, transformations=None, overwrite=True)#

Add a points element to a SpatialData object.

This function allows you to add a points element to sdata. The points element is derived from a Dask DataFrame. If sdata is backed by a zarr store, the resulting points element will be backed to the zarr store, otherwise ddf will be persisted in memory.

Parameters:
  • sdata (SpatialData) – The SpatialData object to which the new points element will be added.

  • ddf (DataFrame) – The DaskDataFrame containing the points data to be added.

  • output_points_name (str) – The name of the output points element where the points data will be stored.

  • coordinates (dict[str, str]) – A dictionary specifying the coordinate mappings for the points data (e.g., {“x”: “x_column”, “y”: “y_column”}).

  • transformations (dict[str, BaseTransformation] | None (default: None)) – Transformations that will be added to the resulting output_points_name. Currently harpy only supports the Identity transformation.

  • overwrite (bool (default: True)) – If True, overwrites output_points_name if it already exists in sdata.

Return type:

SpatialData

Returns:

: The sdata object with the points element added.