Single-cell and tissue · What you can do here
Predict single-cell responses to unseen perturbations
Predict single-cell transcriptomic shifts under unmeasured perturbations, doses, or contexts using LabCompass flow matching models, evaluated directly against mean-shift and no-change baselines.
What this involves
LabCompass learns a velocity field that transports control cells to perturbed cells conditioned on a perturbation representation. Once trained, you can pass a control population through the forward model with any perturbation vector to simulate how those cells would respond under an unseen condition, dose, combination, or cellular context.
The model operates in a reduced representation space, typically principal components derived from log-normalised highly variable genes, pairing controls and perturbed cells across batches via optimal transport. To predict truly novel perturbations or compounds rather than measured conditions, perturbation vectors must carry informative biological or chemical features, such as molecular fingerprints or gene embeddings, rather than simple one-hot encodings.
Doing this work rigorously requires holding out context or perturbation data and benchmarking predictions against trivial baselines: the unperturbed control state and a linear mean shift observed across other contexts. On shared cellular responses, standard mean shifts can perform comparably or better, making rigorous baseline comparison essential before trusting forward predictions.
How it goes
- 1Flow matching configurationInitialise LabCompass FlowMatching with optimal transport coupling, set the device to CPU, define neural velocity field dimensions, and supply validation splits to track training.
- 2Velocity field trainingExecute FlowMatching training across multiple CPU threads using PyTorch, saving the model object to disk with FlowMatching.save once the step target is reached.
- 3State prediction and gene reconstructionFeed held-out control principal components and condition vectors into the predict method, mapping predicted coordinates back to gene expression using the PCA loading matrix.
- 4Baseline comparison and scoringCalculate no-change and mean-shift baselines on held-out cells, evaluating R-squared and change correlations on overall genes and the top 100 perturbed genes.
Start it here
Ask in plain language. The agent works on a Linux machine of its own — it installs and runs what the job needs, keeps every file, and reads the results back with the numbers explained. Nothing to set up, and a long run continues after you close the page.
What to watch for
- Flow matching models out of the box may fail to beat an empirical mean-shift baseline on shared perturbation responses across cell types.
- Responses unique to an unobserved cell context cannot be learned if perturbations are supplied only as one-hot condition vectors.
- R-squared across all genes is elevated because baseline expression dominates; use the correlation of predicted versus real changes on top responsive genes to distinguish model quality.
- LabCompass defaults to CUDA execution, so device_id must be explicitly set to CPU on non-GPU environments.
- The model save function raises a FileNotFoundError if the target directory does not exist, and raises a runtime error on subsequent writes unless overwrite is set to true.
- Never attach WandbCallback during execution, as it attempts external authentication and data transmission to Weights & Biases.
What it runs
Databases it can query
Questions
Do I need to install anything to predict single-cell responses to unseen perturbations?
No. The research agent does this work on a Linux machine of its own — it installs what the job needs, keeps the files, and reads the results back to you. Long runs continue if you close the page.
How can the model predict a perturbation that was never measured?
You must provide an informative representation vector in uns, such as a molecular fingerprint or gene embedding, rather than a one-hot label, so the model has biological or chemical features from which to generalise.
Why is comparison against a mean-shift baseline necessary?
When a perturbation drives a strong, shared response across different cell types, adding the average observed shift to held-out controls is very difficult to beat, meaning complex model predictions must be justified against it.
How does LabCompass match control cells to perturbed cells?
Control cells are pooled rather than matched per-context; batch-level optimal transport pairs controls with perturbed cells during training, relying on cell state to carry context identity.
Can LabCompass identify which perturbation leads to a specific target cell state?
LabCompass contains an InverseModel and guided samplers designed to run backwards from a target state to candidate perturbations, though their docstrings should be consulted before use.
Written from the method the research agent follows for this work and the documentation of the tools listed above. Statements citing a figure that does not appear there are removed before publication. Corollary is a non-commercial research demonstration; results are not for clinical use.