R/average_marker_intensity_within_radius.R
average_marker_intensity_within_radius.Rd
Calculates the average intensity of the target_marker within a radius from the cells positive for the reference marker. Note that it pools all cells with the target marker that are within the specific radius of any reference cell. Results represent the average intensities within a radius, but not a vector of metrics for each cell.
average_marker_intensity_within_radius(
spe_object,
reference_marker,
target_marker,
radius = 20
)
SpatialExperiment object in the form of the output of
format_image_to_spe
.
String specifying the marker that is used for reference cells.
String specifying the marker to calculate its average intensity.
Numeric specifying the radius of search for cells around the reference cells.
A single number is returned
average_marker_intensity_within_radius(SPIAT::simulated_image,
reference_marker ="Immune_marker3",
target_marker = "Immune_marker2",
radius=30)
#> [1] 0.5995357