Skip to contents

Produces a data.frame with mixing scores of input reference and target cells from a SingleCellExperiment object. It calculates reference-target interactions and reference-reference interactions based on a radius. It derives the mixing score and the normalised mixing score. Function returns NA if the mixing score is being calculated between cells of the same type.

Usage

mixing_score_summary(
  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 Vector. Cell types of the reference cells.

target_celltype

String Vector. Cell types of the target cells.

radius

The maximum radius around a reference cell type for another cell to be considered an interaction.

feature_colname

String specifying the column with the desired cell type annotations.

Value

A data.frame of cell numbers, mixing scores, and normalised mixing scores.

Details

The mixing score was originally defined as the number of immune-tumour interactions divided by the number of immune-immune interactions within a defined radius (Keren et al., 2018). The normalised mixing score normalises the immune-tumour interactions and immune-immune interactions within radius by the total number of immune-tumour and immune-immune interactions in the image, respectively. We have generalized this score to allow calculation of any two cell phenotypes defined by the user.

Examples

mixing_score_summary(SPIAT::defined_image, reference_celltype = "Tumour", target_celltype="Immune1",
radius = 50, feature_colname = "Cell.Type")
#>   Reference  Target Number_of_reference_cells Number_of_target_cells
#> 2    Tumour Immune1                       819                    338
#>   Reference_target_interaction Reference_reference_interaction Mixing_score
#> 2                           80                            5026   0.01591723
#>   Normalised_mixing_score
#> 2              0.07704316