Simulate held-out complex spatial domain geometries
Source:R/simulate_complex_domains.R
simulate_complex_spatial_domains.RdGenerates two- or three-dimensional geometries designed to stress junctions, narrow channels, nonconvex boundaries, and severe regional concentration. These shapes are separate from those in [simulate_spatial_domains()].
Usage
simulate_complex_spatial_domains(
n = 50000L,
shape = c("voronoi_mosaic", "radial_sectors", "checkerboard_junctions",
"tubular_network", "braided_channels", "shells_3d"),
density_profile = c("uniform", "extreme"),
noise_type = c("random", "boundary", "patch"),
noise = 0.25,
samples = 1L,
k = 5L,
seed = 1L
)Arguments
- n
Number of observations.
- shape
Domain geometry.
- density_profile
Either `"uniform"` or `"extreme"`.
- noise_type
Either `"random"`, `"boundary"`, or `"patch"`.
- noise
Fraction of labels to corrupt. Each true class present in a specimen retains one correct exemplar; a rate that makes this impossible is rejected.
- samples
Number of independent tissues.
- k
Number of domains.
- seed
Random seed.
Examples
sim <- simulate_complex_spatial_domains(
n = 1000, shape = "tubular_network", density_profile = "extreme"
)
table(sim$truth)
#>
#> cluster1 cluster2 cluster3 cluster4 cluster5
#> 720 39 21 14 206