measure_association_to_cell_properties: measure_association_to_cell_properties

View source: R/measure_association_to_cell_properties.R

measure_association_to_cell_propertiesR Documentation

measure_association_to_cell_properties

Description

Plots the density or boxplot of a property of two cell celltypes or compares using t test/wilcoxon rank sum test.

Usage

measure_association_to_cell_properties(
  spe_object,
  property = "Cell.Area",
  celltypes,
  feature_colname = "Cell.Type",
  method = "density",
  Nucleus.Ratio = FALSE,
  log.scale = FALSE
)

Arguments

spe_object

SpatialExperiment object in the form of the output of format_image_to_spe.

property

String that is the name of the column of interest.

celltypes

String Vector of celltypes of interest.

feature_colname

String that speficies the column of the cell types.

method

String. The analysis to perform on the selected cell types and property. Options are "density", "box", "t", "wilcox".

Nucleus.Ratio

Boolean whether the ratio of the nucleus size is of interest.

log.scale

Boolean whether to log the data.

Value

With method "box" or "density a plot is returned. With method "t" or "wilcox", the text output from the test are returned.

Examples

measure_association_to_cell_properties(image_no_markers,
                                      celltypes = c("Tumour", "Immune1"),
                                      feature_colname = "Cell.Type",
                                      property = "Cell.Size",
                                      method = "box")
measure_association_to_cell_properties(image_no_markers,
                                      celltypes = c("Tumour", "Immune2"),
                                      feature_colname="Cell.Type",
                                      property = "Cell.Size",
                                      method = "t")

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