AI-Assisted Gating: How LLMs Can Accelerate Flow Cytometry Analysis
How Cytogence FCS integrates large language models as a copilot for flow cytometry analysis — from automated gating suggestions to population naming and strategy design.
Gating a flow cytometry dataset is part science, part art, and part institutional memory. An experienced immunologist can look at a scatter plot and immediately identify lymphocyte populations, set appropriate boundaries, and name the resulting gates. But that expertise takes years to develop, and even experts can disagree on gate placement.
What if an AI could assist — not replace — that expertise?
In Cytogence FCS, we’ve built an AI copilot that does exactly that. It doesn’t gate for you. It gates with you.
What the AI Copilot Actually Does
The copilot is not a black box that takes your FCS file and returns a gating hierarchy. That approach fails because gating is context-dependent — the “right” gates depend on your experimental question, your panel design, your tissue type, and your scientific judgment.
Instead, the copilot operates as an interactive assistant with a growing set of specialized tools:
Analysis Tools
- list_parameters — List all channels and markers in the loaded file
- get_sample_metadata — Retrieve instrument type, acquisition date, event count
- get_statistics — Compute population statistics (mean, median, geometric mean MFI, CV) for any parameter within any gate
- analyze_distributions — Characterize the distribution shape of any channel
Gating Tools
- create_gate — Draw rectangle, polygon, ellipse, or range gates with specified coordinates
- evaluate_gate — Check population counts and percentages for any gate
- list_gates — Display the current gate hierarchy
- delete_gate, rename_gate — Modify existing gates
- run_auto_gate — Trigger unsupervised clustering (K-means, DBSCAN, or GMM)
Intelligence Tools
- suggest_gating_strategy — Propose a multi-step gating workflow based on the panel and experiment type
- name_populations — Suggest biologically meaningful names for gated populations
- set_plot_parameters — Change axis assignments for visualization
- set_transform — Apply data transforms (linear, log, logicle, arcsinh, hyperlog)
Statistical Tools
- run_statistical_test — Execute t-tests, ANOVA, Kruskal-Wallis, or Mann-Whitney U tests between populations, depending on data distribution and experimental design
- get_compensation_matrix — Retrieve the current spillover matrix
Three Modes of Assistance
The copilot operates in three modes, each designed for a different use case:
Copilot Mode
The default. You’re analyzing data, and the AI observes your workflow in real time. It might suggest: “You’ve gated on CD3+ cells. Consider creating a CD4/CD8 subset gate next — your panel includes both markers.” You approve or dismiss each suggestion.
Tutor Mode
For trainees and students. The AI explains why each gating step is important, what the populations mean biologically, and what to watch for. It’s like having an experienced flow cytometrist looking over your shoulder.
Designer Mode
For panel design and experiment planning. Before you’ve collected any data, the AI can help you think through your gating strategy based on your marker panel, suggest potential issues (spectral overlap, missing dump channels), and recommend controls.
How It Works Under the Hood
Multi-Provider Architecture
The copilot supports five LLM backends:
- Anthropic Claude — Our recommended option for reasoning quality
- OpenAI GPT-4 — Widely available alternative
- AWS Bedrock — Enterprise cloud deployment with SigV4 authentication
- Ollama (local) — For air-gapped environments where data cannot leave the machine
- Cytogence Managed — Our hosted endpoint for users who don’t want to manage API keys
Users choose their provider based on their privacy requirements and institutional policies. For labs working with sensitive data, the local Ollama option ensures that no data — not even parameter names — leaves the local machine.
Tool Approval
Every action the AI proposes goes through an approval step. When the copilot suggests creating a gate, you see the proposed coordinates and can approve, modify, or reject. The AI never modifies your data without your explicit consent.
This is a deliberate design choice. Flow cytometry gating has real consequences for downstream analysis, and we believe the human must remain in control of every decision.
Streaming Responses
AI responses stream in real-time — you see the copilot’s response as it develops, not after a long wait. This makes the interaction feel conversational rather than transactional.
What Works Well
Strategy Suggestions
Given a panel and an experiment type (immunophenotyping, intracellular cytokine staining, cell cycle analysis), the copilot can outline a logical gating sequence. For a standard T cell panel, it might suggest:
- Time gate (remove acquisition instabilities)
- Singlet gate (FSC-A vs. FSC-H)
- Live/dead discrimination
- Lymphocyte gate (FSC-A vs. SSC-A)
- CD3+ gate
- CD4/CD8 subsets
- Functional markers within each subset
This isn’t novel for an experienced user — but it’s invaluable for trainees, for unfamiliar panels, or for documenting the rationale behind your gating strategy.
Population Naming
After unsupervised clustering identifies distinct populations, the copilot can suggest biologically meaningful names based on marker expression patterns. A cluster that’s CD3+CD4+CD25+FOXP3+ may be suggested as “Regulatory T cells” — saving the manual step of interpreting each cluster’s phenotype.
Statistical Guidance
The copilot can recommend appropriate statistical tests based on your experimental design: paired vs. unpaired, parametric vs. non-parametric, and whether multiple testing correction is needed.
What Doesn’t Work (Yet)
Complex Manual Gates
The AI can suggest gate coordinates, but it can’t yet match the nuance of an expert manually adjusting a polygon gate based on subtle population features visible in a density plot. Automated gate placement is a starting point, not the final answer.
Novel Panels
For well-characterized panels (standard immunophenotyping, common cytokine panels), the copilot’s suggestions are strong. For novel or highly custom panels, it may default to generic suggestions that miss the specific biology you’re studying.
Quantitative Precision
Like all LLMs, the copilot can make errors when reporting exact numbers. Always verify statistics against the actual computed values displayed in the application — don’t rely on the AI’s paraphrasing of your results.
The Privacy Question
Flow cytometry data can be sensitive — patient samples, unpublished research, proprietary panel designs. We designed the AI integration with this in mind:
- Local models (Ollama): Zero data leaves your machine. Full local functionality with complete privacy.
- Session-only API keys: Keys are held in memory only and zeroed on application close — never written to disk.
- Privacy modes: Standard, Enhanced, and Strict modes control what context is sent to cloud providers.
- No training on your data: We do not use your queries or data to train any models.
Why This Approach Works
The key design decision is separation of concerns: the AI handles interpretation and suggestion, while the analysis engine executes computations deterministically.
This avoids a common failure mode in AI-driven tools, where models attempt to perform calculations directly and introduce errors. In Cytogence FCS, the AI suggests actions — but all statistical calculations and gating operations are executed by the Rust analysis engine, ensuring correctness even if the AI’s suggestion needs adjustment.
Looking Ahead
AI-assisted flow cytometry is in its early stages. The current copilot accelerates routine workflows and reduces the barrier to entry for new users. As models improve and we refine the tool integration, we expect the copilot to become increasingly capable at handling complex, multi-panel experiments and providing publication-ready analysis summaries.
But the principle won’t change: the AI assists, the researcher decides.
Cytogence FCS is available for Windows, macOS, and Linux. Request a demo to see the AI copilot in action.