Skip to contents

Lightweight wrapper to build a Milo object, define neighbourhoods, count cells, and test differential abundance with optional batch-aware design.

Usage

leo.milo(
  all,
  sample = "orig.ident",
  milo_mode = "fast",
  group = "case_ctrl",
  group_level = c("ctrl", "vkh"),
  reduced.dim = "harmony",
  k = 50,
  prop = 0.1,
  adjust_k_p_manual = FALSE,
  contrast_list = NULL,
  batch = NULL,
  cell_type = NULL
)

Arguments

all

Seurat object

sample

Character. Meta column used as sample identifier (default: "orig.ident")

milo_mode

Character, either "fast" or other. Controls neighbourhood refinement and testing behavior

group

Character. Meta column encoding the biological group/condition (default: "Stage1")

group_level

Character vector. Desired factor levels for group (controls ordering)

reduced.dim

Character. Set to the batch-corrected dim (default: "harmony")

k

Integer. Number of nearest neighbours to use for graph construction (default: 50)

prop

Numeric (0.1-0.2). Proportion of cells to use for neighbourhood definition (default: 0.1) Note that for large data sets, it might be good to set k higher (50-100) and prop lower (0.01-0.1). See: https://github.com/MarioniLab/miloR/issues/108

adjust_k_p_manual

Logical. If TRUE, allows interactive adjustment of k and prop parameters.

contrast_list

List or NULL. Contrast vector/list for differential abundance testing.

batch

NULL or character. Feels useless yet as Seraut obj normally has already processed with batch-integration like harmony.

cell_type

Deprecated! Ignored in current version (placeholder for future stratification)

Value

A list with components da_results (Milo differential abundance result) and milo_obj (constructed Milo object)

Examples

if (FALSE) { # \dontrun{
res <- leo.milo(all)
milo_obj   <- res$milo_obj
da_results <- res$da_results
} # }