number_of_cells_within_radius
Source:R/number_of_cells_within_radius.R
number_of_cells_within_radius.Rd
Calculates the number of cells of a target cell type within a pre-defined radius around cells of a reference cell type.
Usage
number_of_cells_within_radius(
sce_object,
reference_celltype,
target_celltype,
radius = 20,
feature_colname
)
Arguments
- sce_object
SingleCellExperiment object in the form of the output of
format_image_to_sce
.- reference_celltype
String. Cell type to be used for reference cells.
- target_celltype
String. Cell type to be used for target cells.
- radius
Numeric. Radius around the reference cells.
- feature_colname
String specifying the column with the desired cell type annotations.
Examples
n_in_radius <- number_of_cells_within_radius(SPIAT::defined_image,
reference_celltype = "Tumour", target_celltype="Immune1", radius = 50,
feature_colname = "Cell.Type")