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 aDaskDataFrame. Ifsdatais backed by a zarr store, the resulting points layer will be backed to the zarr store, otherwiseddfwill 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 (
dict[str,BaseTransformation] |None(default:None)) – Transformations that will be added to the resultingoutput_layer. Currentlysparrowonly supports the Identity transformation.overwrite (
bool(default:True)) – If True, overwritesoutput_layerif it already exists insdata.
- Return type:
SpatialData- Returns:
: The
sdataobject with the points layer added.