findBorderCells {imcRtools}R Documentation

Find cells at the image border

Description

Detection of cells close to the image border for subsequent exclusion from downstream analyses.

Usage

findBorderCells(object, img_id, border_dist, coords = c("Pos_X", "Pos_Y"))

Arguments

object

a SingleCellExperiment or SpatialExperiment object.

img_id

single character indicating the colData(object) entry containing the unique image identifiers.

border_dist

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.

coords

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.

Value

an object of class(object) containing the logical border_cells entry in the colData slot.

Author(s)

Nils Eling (nils.eling@dqbm.uzh.ch)

Examples

library(cytomapper)
data("pancreasSCE")

sce <- findBorderCells(pancreasSCE, img_id = "ImageNb", 
                       border_dist = 10)

plotSpatial(sce, img_id = "ImageNb", node_color_by = "border_cells")


[Package imcRtools version 1.0.2 Index]