Boolean Gating in Flow Cytometry: AND, OR, and NOT Combination Gates

boolean gating flow cytometry combination gatesAugust 7, 2026

You have a CD4 T cell gate, and three cytokine gates — IFN-γ, TNF, and IL-2 — each drawn off the same parent. Your PI wants to know how many cells make all three at once, how many make IFN-γ but not the other two, and what fraction are making nothing. You could draw a tangle of nested gates and lose track of which is which, or you could let the software do the set arithmetic. That is what Boolean gating is for: combining gates you already drew into AND, OR, and NOT expressions so the population definitions stay explicit and reproducible.

What a Boolean gate actually is

A Boolean gate does not draw a new region on a plot. It takes existing gates as inputs and returns the events that satisfy a logical expression over them. Three operators cover almost everything you will do:

  • AND — events inside both gates. CD4 AND IFN-γ is the IFN-γ-producing CD4 cells.
  • OR — events inside either gate. IFN-γ OR TNF OR IL-2 is every cell responding with at least one cytokine.
  • NOT — events outside a gate. IFN-γ AND NOT TNF AND NOT IL-2 is the IFN-γ single-positive subset.

The key difference from a sequential hierarchical gating strategy is that hierarchy is strictly nested — each child sits inside one parent. Boolean gates let you intersect populations that live on different branches of the tree, which is exactly what co-expression questions require.

Step 1 — Draw the component gates first

Every Boolean gate is only as good as its inputs. Gate to your population of interest the usual way: clean up to live single CD4 T cells, then draw a positive gate for each marker you want to combine, each on its own plot against a sensible axis. Set the positive boundaries on controls, not by eye — for activation markers and cytokines that means an unstimulated control or a fluorescence-minus-one control for the borderline channels. If a component gate is sloppy, every Boolean expression built on it inherits the error, multiplied.

Step 2 — Build the expression in the Boolean modal

In Cytomaton, combination gates are built through a dedicated Boolean modal rather than by drawing: you pick the input gates and the operator (AND, OR, NOT) and the new gate appears in the gating tree with live statistics like any other gate. Start simple. CD4 AND IFN-γ gives you the responding fraction. Then negate: CD4 AND IFN-γ AND NOT TNF AND NOT IL-2 isolates the IFN-γ single producers.

Tip Name Boolean gates by their logic, not by a serial number. “IFN+TNF+IL2+” tells the next person what the gate means; “Boolean gate 4” sends them back to the modal to reverse-engineer it. This matters most when the workspace gets shared across a lab, where opaque gate names are a known source of reproducibility drift between operators.

Step 3 — Enumerate the full combination set

For polyfunctionality work, you usually want every combination, not just one. With n markers there are 2n Boolean subsets. A three-cytokine panel produces 23 = 8 subsets: the triple negative plus 7 responding combinations (three single-positives, three double-positives, one triple-positive). A four-cytokine panel jumps to 16. This is the standard input to polyfunctionality analysis — tools like SPICE and COMPASS take exactly this set of Boolean-defined frequencies and ask whether the quality of a response (how many functions per cell) differs between groups, not just its magnitude.

Building all of them by hand is where mistakes creep in, so build them systematically: every subset is an AND across all n markers where each marker appears either plain or negated. The triple-positive is all-plain; the triple-negative is all-NOT.

Step 4 — Sanity-check that the subsets sum

The 2n mutually exclusive subsets must sum to 100% of the parent. If your eight cytokine subsets add up to 96% or 104%, a component gate boundary is overlapping or clipping, or one input gate was drawn on the wrong parent. This sum check is the fastest way to catch a broken Boolean tree, and it is worth doing before you export anything.

Common Mistake Boolean gating on poorly compensated data manufactures fake double-positives. If TNF spills into the IFN-γ detector and you have under-compensated, the IFN-γ AND TNF gate fills with cells that are really only making TNF. Boolean logic cannot tell signal from spillover — it only sees gate membership. Confirm the matrix is right before you trust any co-expression number; our fluorescence compensation calculator visualizes over- and under-compensation if you are not sure which way yours leans, and the failure pattern is the same one described in spotting over- and under-compensation.

When Boolean gating is the wrong tool

Combination gating shines for discrete positive/negative co-expression. It is a poor fit when the biology is continuous — if “double-positive” depends on exactly where you draw two arbitrary boundaries, the Boolean count is just as arbitrary as the gates feeding it. For continuous, high-parameter co-expression structure, an unsupervised approach reads the data better; see when to trust a FlowSOM cluster for where clustering earns its place over manual combination gates. Boolean gating answers “how many cells are X+Y+Z+” cleanly; it does not discover structure you did not already gate for.

Once your component gates are set on proper controls and the compensation holds up, Boolean combinations turn a co-expression question into a few explicit set operations — reproducible, auditable, and quick to extend when a reviewer asks for one more subset. The discipline is all upstream: trustworthy inputs, logical names, and a sum check before you report.

Try Cytomaton

AI-assisted flow cytometry analysis that learns your gating style. Free during beta.

Join the beta