sparrow.pt.add_points_layer#
- sparrow.pt.add_points_layer(sdata, ddf, output_layer, coordinates, transformations=None, overwrite=True)#
Add a points layer to a SpatialData object.
This function allows you to add a points layer to
sdata
. The points layer is derived from aDask
DataFrame
. Ifsdata
is backed by a zarr store, the resulting points layer will be backed to the zarr store, otherwiseddf
will be persisted in memory.- Parameters:
sdata (
SpatialData
) – The SpatialData object to which the new points layer will be added.ddf (
DataFrame
) – The DaskDataFrame containing the points data to be added.output_layer (
str
) – The name of the output layer 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 (
Optional
[dict
[str
,BaseTransformation
]] (default:None
)) – Transformations that will be added to the resultingoutput_layer
. Currentlysparrow
only supports the Identity transformation.overwrite (
bool
(default:True
)) – If True, overwritesoutput_layer
if it already exists insdata
.
- Return type:
SpatialData
- Returns:
: The
sdata
object with the points layer added.