Skip to content

Automatic gate tailoring: save time with an algorithm that gates like you do

Gating is the backbone of cytometry analysis. Some data is consistent enough that gate positions can be set globally, but oftentimes, gates need to be adjusted for every sample. This process can be extremely time consuming, and maintaining consistency can be challenging, especially if multiple people are working on a project. To make analysis easier, we developed an algorithm that quickly tailors gates to the underlying data.

When developing the autotailoring algorithm, we had four main goals:

  1. The result should follow the user’s gating strategy. The algorithm uses one of more samples that are manually gated as training data, and strictly follows the defined gating hierarchy. The results are instantly interpretable and closely mimic how you would have gated the data.
  2. Resulting gate positions must be easily reviewable and adjustable. After autotailoring, the gates are functionally identical to manually placed gates—that is, they are typical rectangles, polygons, quadrants, etc. that can be reviewed and adjusted like any other gate. CellEngine’s pivot tables display grids of flow plots to make gate review even faster. This is a major improvement over most other tools, which statically assign cells to a population without providing an easy way to inspect or correct the result.
  3. The algorithm needs to run quickly so that the analysis workflow is not interrupted. Like other CellEngine functions, autotailoring has been highly optimized for speed. It can tailor a full hierarchy in seconds, even on hundreds of files. This allows for easy experimentation and adjustment of the training data to create the best results from the algorithm.
  4. Results should be consistent and replicable. Given the same training data, the algorithm will tailor a dataset the same way every time. The algorithm was also designed to have as few settings as possible. Ultimately it has just three, all of which have intuitive functionality and none of which are a random seed.

When should you use autotailoring?

Autotailoring can be helpful for most experiments, but is most useful in large experiments with high variability between samples. Experiments with multiple tissue types, disease states, or changes in experimental conditions (e.g., different antibody concentrations or cytometers) often require different gate geometries, so are good candidates. Samples from multiple human donors are often variable, as well. Longitudinal studies can benefit from autotailoring because the algorithm creates consistent, replicable results; in many cases, samples added later in an experiment can use the earlier timepoints as the training set.

Tip

Autotailoring can tailor each file individually, or by groups defined by annotations. For example, the algorithm can apply the same geometry for all files from the same donor, or from each tissue of origin, or any other metadata you add to the Annotations section of your experiment.

The autotailoring process

Using the gate tailoring algorithm is straightforward. First, you’ll select and manually gate one or more files to use as your reference data. Once that’s done, running the algorithm is as simple as selecting the gates you want the algorithm to adjust, identifying the files in the training set and files in the autotailoring set, and clicking “run.” Within seconds, you’ll be ready to review the autotailored gates.

Autotailoring vs. manual tailoring: a case study

To measure how much time can be saved by using auto-tailoring, and to determine how similar manual and automatic analysis are, we analyzed a long-COVID clinical study with 1,991 samples from human donors from two different sites. We looked at a perforin gate, since there was a high level of variability in that marker between donors and between unstimulated and stimulated conditions. Given the large number of donors, multiple collection sites and high marker variability, gating the data would require a great deal of analyst time, and was a good challenge to the autotailoring algorithm.

One analyst gated the dataset manually, and then gated again with autotailoring. For both manual and automated analysis, all of the gate positions were reviewed and manually corrected. This review step was included in the measured time.

Samples collected from different sites had significant differences in the marker distributions, possibly due to underlying differences in the donor populations. For that reason, we picked training data independently for each site’s samples, which essentially doubled the time needed to choose and refine a training set. Despite that, using autotailoring provided significant time savings, requiring only a third of the time to complete.

Autotailoring took less than a third of the time that it took to manually gate (left), and resulted in event counts highly similar to manual gating (right). The time reported for autogating includes the manual placement of the set of training gates, running the algorithm, and review of each gate position for final approval.

Obviously, autotailoring only saves time if the final results are accurate. We compared gate placement during the review process, as well as the number of events in the manual and autogated populations. The algorithm produced results that were very similar to the manually gated choices. Although the number of events varied widely between different samples, the manual and autogated counts were tightly correlated, with an R2 of 0.998.

If you’re interested in more information on this particular project, check out our poster that we presented at CYTO 2023 that included an additional marker.

Try autotailoring yourself

If you’re not using CellEngine already, you can sign up for a free two-month trial at https://cellengine.com. Contact support@cellengine.com to enable the auto-tailoring feature. For more information, check out or documentation, or contact support@cellengine.com to arrange a live training.