average_marker_intensity_within_radius: average_marker_intensity_within_radius

View source: R/average_marker_intensity_within_radius.R

average_marker_intensity_within_radiusR Documentation

average_marker_intensity_within_radius

Description

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.

Usage

average_marker_intensity_within_radius(
  spe_object,
  reference_marker,
  target_marker,
  radius = 20
)

Arguments

spe_object

SpatialExperiment object in the form of the output of format_image_to_spe.

reference_marker

String specifying the marker that is used for reference cells.

target_marker

String specifying the marker to calculate its average intensity.

radius

Numeric specifying the radius of search for cells around the reference cells.

Value

A single number is returned

Examples

average_marker_intensity_within_radius(SPIAT::simulated_image,
                                       reference_marker ="Immune_marker3",
                                       target_marker = "Immune_marker2",
                                       radius=30)

TrigosTeam/SPIAT documentation built on Aug. 22, 2024, 7:50 p.m.