spatialSampler.Rd
Spatially-aware subsampling of SpatialExperiment objects
spatialSampler(
spe,
prop = 0.1,
method = "grid",
grid_size = NULL,
seed = 123,
min_cells_per_region = 1,
balance_regions = FALSE
)
SpatialExperiment object
Proportion of cells to sample (between 0 and 1)
Sampling method: "grid", "kmeans", or "random" (default: "grid")
Number of grid cells per dimension for grid method (default: auto-calculated)
Random seed for reproducibility (default: 123)
Minimum cells required per spatial region (default: 1)
Whether to balance sampling across spatial regions (default: FALSE; if true, might create duplicated spatial units)
Subsampled SpatialExperiment object