Method-specific implementation used by RunProportionTest when
proportion_method = "milo".
The function always returns a group-level summary and additionally stores a
neighborhood-level result list under neighborhood_results.
The group summary uses sample-level cell-type proportions; its p-values are
not Milo neighborhood test p-values. Neighborhood results use the Milo test
and SpatialFDR as their standardized FDR.
Usage
RunMilo(
object,
group.by,
split.by,
sample.by,
comparison = NULL,
milo_k = 20L,
milo_d = 30L,
reduction = NULL,
backend = c("r", "cpp"),
n_bootstrap = 500,
seed = 11,
verbose = TRUE,
srt = NULL
)Arguments
- object
A
Seuratobject.- group.by
Metadata column(s) used to color cells.
- split.by
Metadata column that identifies the condition groups to compare. For sample-level methods, if
split.byis omitted andsample.byis provided,sample.byis treated as the condition column; a separate biological sample column is still required unless descriptive virtual samples are explicitly enabled.- sample.by
Metadata column identifying biological samples. Required when calling
RunMilo()directly. Fully paired sample IDs across two conditions are supported; partially paired comparisons are rejected.- comparison
Optional pairs of condition labels. Each pair is
c(group1, group2).obs_log2FDislog2(group1 / group2), matching RunDEtest / Seuratident.1vsident.2: positive values mean the cell type is more abundant ingroup1. IfNULL, all pairwise comparisons are generated in both directions.- milo_k
Number of nearest neighbors used for Milo graph building.
- milo_d
Number of dimensions used by Milo.
- reduction
Dimensional reduction used for Milo graph construction. If
NULL, the default PCA-like reduction is used.- backend
Backend used to compute Milo neighborhoods and tests.
"r"calls the upstreammiloRimplementation."cpp"uses nativescopgraph/neighborhood/counting kernels and keeps edgeR for the neighborhood-level quasi-likelihood test.- n_bootstrap
Number of bootstrap iterations used by the group-level summary.
- seed
Random seed, including for permutation testing.
- verbose
Whether to print the message. Default is
TRUE.- srt
Deprecated alias for
object; supply exactly one of the two. It will be removed in scop 1.0.0.
Value
A method result bundle used internally by RunProportionTest.