Detection of cells close to the image border for subsequent exclusion from downstream analyses.
findBorderCells(object, img_id, border_dist, coords = c("Pos_X", "Pos_Y"))
a SingleCellExperiment
or SpatialExperiment
object.
single character indicating the colData(object)
entry
containing the unique image identifiers.
single numeric defining the distance to the image border. The image border here is defined as the minimum and maximum among the cells' x and y location.
character vector of length 2 specifying the names of the
colData
(for a SingleCellExperiment
object) or the
spatialCoords
entries indicating the cells' x and y locations.
an object of class(object)
containing the logical
border_cells
entry in the colData
slot.
library(cytomapper)
data("pancreasSCE")
sce <- findBorderCells(pancreasSCE, img_id = "ImageNb",
border_dist = 10)
plotSpatial(sce,
img_id = "ImageNb",
node_color_by = "border_cells",
scales = "free")