View source: R/average_percentage_of_cells_within_radius.R
average_percentage_of_cells_within_radius | R Documentation |
Calculates the average percentage of cells of a target cell type within a radius from the cells with a reference cell type. The calculation is done per reference cell, so runtime will depend on the number of reference cells present. Output is a single value (the mean for the image).
average_percentage_of_cells_within_radius(
spe_object,
reference_celltype,
target_celltype,
radius = 100,
feature_colname
)
spe_object |
SpatialExperiment object in the form of the output of
|
reference_celltype |
String specifying the cell type of reference cells. |
target_celltype |
String specifying the cell type for target cells |
radius |
Integer specifying the radius of search for cells around the reference cells. Radii of ~100 are recommended. If too small, too few cells might be present. |
feature_colname |
String specifying the column with the desired cell type annotations. |
A numeric vector and a plot are returned
average_percentage_of_cells_within_radius(SPIAT::defined_image, "Tumour",
"Immune3", radius = 100, "Cell.Type")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.