Estimates statistically significant marker combination values within
which one immunologically distinctive group (i.e., disease case) is more associated than
another group (i.e., healthy control), successively, using various combinations (i.e.,
"gates") of markers to examine features of cells that may be different between
groups. For a two-group comparison, the 'gateR' package uses the spatial relative risk
function estimated using the 'sparr' package. Details about the 'sparr' package
methods can be found in the tutorial: Davies et al. (2018)

Date repository last updated: August 29, 2025
Overview
The gateR package is a suite of R functions to identify significant spatial clustering of flow and mass cytometry data used in immunological investigations. For a two-group comparison, we detect clusters using the kernel-based spatial relative risk function estimated using the sparr package. The tests are conducted in a two-dimensional space comprised of two fluorescent markers.
Examples of a single condition with two groups:
For a two-group comparison of two conditions, we estimate two relative risk surfaces for one condition and then a ratio of the relative risks. For example:
$$\frac{ \big(\frac{Condition2B}{Condition2A}\big)}{\big(\frac{Condition1B}{Condition1A}\big)}$$
Within areas where the relative risk exceeds an asymptotic normal assumption, the gateR package has the functionality to examine the features of these cells. Basic visualization is also supported.
Installation
To install the release version from CRAN:
install.packages("gateR")
To install the development version from GitHub:
devtools::install_github("lance-waller-lab/gateR")
Available functions
| Function | Description | gating |
Main function. Conduct a gating strategy for flow and mass cytometry data. | rrs |
Called within gating, one condition comparison. |
lotrrs |
Called within gating, two condition comparison. |
pval_correct |
Called within rrs and lotrrs, calculates various multiple testing corrections for the alpha level. Five methods account for (spatially) dependent, multiple testing. |
lrr_plot |
Called within rrs and lotrrs, provides functionality for basic visualization of a log relative risk surface. |
pval_plot |
Called within rrs and lotrrs, provides functionality for basic visualization of a significant p-value surface. |
|---|
| Data | Description | randCyto |
A sample dataset containing information about flow cytometry data with two binary conditions and four markers. The data are a random subset of the 'extdata' data in the flowWorkspaceData package found on Bioconductor and formatted for `gateR` input. |
|---|