Create a cell mask polygon based on dbscan spatial clusters of cell type(s) of interest
create_cell_masks(
seurat,
sample_key = NULL,
label = NULL,
label_class = NULL,
eps = 30,
minPts = 6,
concavity = 3,
lengthThreshold = 0,
buffer = NULL
)a Seurat object containing Kandinsky data
character string specifying a variable stored in the Seurat object to use as sample/batch annotation.
character string indicating meta data variable containing cell type annotation
character string indicating which cell type(s) to consider to create the cell mask
size (radius) of the epsilon neighborhood. See dbscan documentation for more details.
number of minimum points required in the eps neighborhood for core points (including the point itself). See dbscan documentation for more details.
a relative measure of concavity. 1 results in a relatively detailed shape, Infinity results in a convex hull. You can use values lower than 1, but they can produce pretty crazy shapes. See concaveman documentation for more details.
when a segment length is under this threshold, it stops being considered for further detalization. Higher values result in simpler shapes. See concaveman documentation for more details.
numeric, size of spatial buffer to apply to the final cell mask. If NULL, no buffer will be applied. Default is NULL
a sf data.frame object containing the mask polygon coordinates for each cell cluster defined with dbscan
dbscan spatial density clustering is first applied to define independent clusters of cells. Concaveman algorithm is then applied separately to each cluster to draw a concave hull mask