RunProportionTest performs differential abundance testing for cell proportions. The function acts as a dispatcher and routes to one of the method-specific implementations: permutation, milo, sccoda, or propeller.
Usage
RunProportionTest(
srt,
group.by,
split.by = NULL,
comparison = NULL,
proportion_method,
sample.by = NULL,
pseudo_sample_n = 3L,
n_permutations = 1000,
FDR_threshold = 0.05,
log2FD_threshold = log2(1.5),
include_all_cells = FALSE,
seed = 11,
verbose = TRUE,
...
)Arguments
- srt
A Seurat object.
- group.by
Name of one or more meta.data columns to group (color) cells by.
- 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 and virtual samples are created within each condition.- comparison
Optional: specify comparisons to perform.
- proportion_method
Differential abundance method. One of
"permutation","milo","sccoda", or"propeller". This argument is required. Alias values such as"permutation_test"and"perm"are accepted and normalized to"permutation".- sample.by
Metadata column that identifies biological samples. For
"milo","sccoda", and"propeller", whensample.byis omitted or identical tosplit.by, virtual samples are created within eachsplit.bygroup for convenience.- pseudo_sample_n
Number of virtual samples per
split.bygroup when a sample-level method has no usablesample.by.- n_permutations
Number of permutations for permutation-based test.
- FDR_threshold
FDR value cutoff for significance.
- log2FD_threshold
Absolute value of log2FD cutoff for significance.
- include_all_cells
Whether to include all cell types in the complete grid for permutation mode.
- seed
Random seed.
- verbose
Whether to print the message. Default is
TRUE.- ...
Additional arguments passed to the selected method function.
References
Miller et al. paper, scProportionTest, miloR, scCODA, propeller/speckle
Examples
data(pancreas_sub)
pancreas_sub <- RunProportionTest(
pancreas_sub,
group.by = "CellType",
split.by = "Phase",
proportion_method = "permutation",
comparison = list(c("G2M", "G1"))
)
#> ℹ [2026-05-14 07:35:36] Start proportion test ("permutation")
#> ℹ [2026-05-14 07:35:36] Running comparison: "G1" vs "G2M"
#> ℹ [2026-05-14 07:35:36] Running comparison: "G2M" vs "G1"
#> ✔ [2026-05-14 07:35:36] Proportion test completed ("permutation")
ProportionTestPlot(
pancreas_sub
)