File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -14,7 +14,6 @@ def create_xenium_filtered_points():
1414 zip_filepath = join (data_dir , "xenium_rep1_io.spatialdata.zarr.zip" )
1515 spatialdata_filepath = join (data_dir , "xenium_rep1_io.spatialdata.zarr" )
1616
17-
1817 if not isdir (spatialdata_filepath ):
1918 if not isfile (zip_filepath ):
2019 os .makedirs (data_dir , exist_ok = True )
@@ -37,13 +36,11 @@ def create_xenium_filtered_points():
3736
3837 # 2. Define a function to take every 100th row from a partition
3938
40-
4139 def select_every_200th (partition ):
4240 # Each 'partition' is a Pandas DataFrame
4341 # .iloc[::100] is the efficient pandas way to get every 100th row
4442 return partition .iloc [::200 ]
4543
46-
4744 # 3. Apply this function to every partition in the Dask DataFrame
4845 result = ddf .map_partitions (select_every_200th )
4946
@@ -53,3 +50,6 @@ def select_every_200th(partition):
5350 small_sdata = SpatialData (points = {"transcripts" : filtered_ddf })
5451
5552 small_sdata .write ("xenium_rep1_io.points_only.spatialdata.zarr" , overwrite = True )
53+
54+ # Uncomment to run.
55+ # create_xenium_filtered_points()
You can’t perform that action at this time.
0 commit comments