Skip to contents

Computes a Delaunay triangulation of cell positions and stores edges in the spatial slot. Each sample_id is triangulated separately; it must identify one independent spatial coordinate frame. Every sample must contain at least three cells. Edge endpoints refer to cell rows in the complete object, never rows local to a sample. Of cells with identical coordinates, only the first is a vertex; the others get no edges.

Usage

DelaunayNetwork(object, max_edge = NULL)

Arguments

object

An SpatialCellData-class object.

max_edge

Numeric or NULL. Maximum edge length to retain.

Value

An SpatialCellData-class with delaunay_edges stored in the spatial slot.

Examples

counts <- matrix(rnorm(40), nrow = 20,
                 dimnames = list(NULL, c("CD3", "CD8")))
coords <- data.frame(x = runif(20, 0, 100), y = runif(20, 0, 100))
obj <- CreateSpatialObject(counts, coords)
obj <- DelaunayNetwork(obj, max_edge = 30)