Skip to contents

Annotates Milo neighborhoods with cell type information and filters neighborhoods based on abundance threshold.

Usage

annotate_nhood(
  sce_milo,
  da_results,
  celltype_var,
  abundance_thresh = 0.7,
  plot = TRUE
)

Arguments

sce_milo

A list containing a Milo object and a design matrix.

da_results

A data frame of differential abundance results for the neighborhoods.

celltype_var

Character string specifying the column in metadata containing cell type annotations.

abundance_thresh

Numeric value specifying the minimum fraction threshold for a cell type to be considered dominant in a neighborhood. Default is 0.7.

plot

Logical indicating whether to generate diagnostic plots. Default is TRUE.

Value

A list containing:

milo

The updated Milo object.

da_results

The annotated differential abundance results.

design

The design matrix used for differential testing.

Details

This function annotates neighborhoods with cell type information, filters neighborhoods based on an abundance threshold, and optionally generates plots.

Examples

# Example usage:
# result <- annotate_nhood(sce_milo, da_results, celltype_var = "cell_type")