Back to Blog

Omics at atlas scale: rebuilding single-cell and spatial bioinformatics infrastructure for the agentic era

In this post, we describe how we rebuilt the single-cell and spatial analysis methods our agents depend on so that they keep working at atlas scale. Using a multi-agent system, we rewrote these methods for GPUs, plus a few high-performance CPU and Rust ports, deployed them on scalable serverless infrastructure, checked each one against the original tool, and gave our agents access to all of them through a single API.

A replay of a real agent run of the lung-cancer analysis from Section 4, on 24,161 malignant cells from the LuCA atlas. The light steps stayed in the sandbox while the four heavy steps went to an elastic GPU pool, which then scaled back to zero nodes. Each heavy step ran as one GPU job on its own worker; the seconds on those steps are the job times printed by the SDK, queue included. Durations on screen are compressed.

Almost half of the work our agents do in production is transcriptomics, and it is also where they fail most often. A transcriptomics session runs about ten times longer than the median other session and costs about ten times more, and the larger the dataset, the more likely the session is to end in an out-of-memory error, a dead kernel or a timeout. Most of the underlying tools were written for a single CPU core, long before datasets reached millions of cells.

Rewriting these tools by hand would take years of engineering, so we designed a multi-agent system to do most of the heavy lifting. Over seven weeks, it rewrote the heavy methods in this stack, most for GPUs and a few in Rust. We built the system for scientific rigour as well as for scale: it checks every method against the original tool for both agreement and speed, uses reviewer agents that break the code on purpose to see whether the tests notice, and migrates many methods in parallel.

Here, we first look at where the time goes in production, then describe how the methods were rewritten and checked. We then run a full lung-cancer analysis twice, once with the classic tools on CPU and once with our GPU methods. Step time fell from 6.3 hours on 16 CPU cores to 19 minutes, and the trajectory statistics that account for most of the CPU time agreed closely with the CPU results (Spearman ρ = 0.975). We close with what it took to make the methods usable by agents, benchmarks of individual methods, and what this changes for preclinical and atlas teams.

Transcriptomics is the heavy tail

We looked at a month of production (8 June to 8 July 2026): 25,909 agent runs in 4,512 sessions from 600 users, with a lightweight LLM labelling each session as transcriptomic or not from its anonymized final answers. Only one session in five is transcriptomic, yet these sessions produce 44% of all runs, hours and spend. A typical transcriptomics session makes twice as many agent runs as other sessions (4 against 2), because the agent re-runs the steps that fail.

A small number of very slow notebook cells account for most of the time. Fewer than 4% of cells ran for ten minutes or longer, but they used more than half of all cell hours, and many of them stopped at exactly 600, 1,200 or 3,600 s, even the sandbox timeouts.

Figure 1 · Where the tool-hours go
Loading and the clustering core (PCA, neighbours, Leiden, UMAP) take the most notebook-cell hours, and about a third of clustering cells end in an error. Bars show estimated hours per steps, the columns on the right split each step's errors into out-of-memory, timeout and other.

Loading is slow and often runs out of memory on large objects, and the clustering core gets more expensive as cell counts grow.

The failures that are about scale follow dataset size. The median session worked with about 22,000 cells, but one in five worked with 100,000 or more, and the largest reached 6.8 million.

Figure 2 · Bigger datasets hit walls more often
The share of sessions that hit an out-of-memory error, a dead kernel or a timeout rises from 47% below 10k cells to 81% at 250k–1M cells. Bars show how sessions are spread across dataset sizes.

Spatial data is the hardest case: 46% of spatial runs mention a dead kernel, against 11% of non-transcriptomics runs. A full slide holds a few hundred thousand cells with coordinates, and its statistics rely on permutation tests over the neighbourhood graph, which a CPU sandbox can neither hold in memory nor finish before it times out.

The requests themselves are ordinary. Three examples from production, paraphrased as:

  • Compare Visium HD data from three patients and one control with the snRNA results on mural cells and macrophages.
  • Retrieve a COVID-19 lung dataset with more than 100k cells from CELLxGENE and run an end-to-end pipeline with batch correction.
  • Examine SOX9 in colorectal and lung-cancer single-cell and spatial data.

A bioinformatician would run any of these on a workstation with a GPU, plenty of RAM and a day of patience. An agent in a CPU sandbox with a ten-minute cell timeout has none of the three, so it picks the right analysis and then runs out of memory or time, again and again.

Rewriting the methods for GPUs or Rust

The obvious fix is a bigger machine, with a GPU and 200 GB of RAM sitting next to scanpy. We tried this, but most of the tools our agents use (scanpy, squidpy, Seurat, Bioconductor, MACS3) are CPU programs, so a GPU next to them does nothing. Some have GPU counterparts, such as rapids-singlecell, cuML and cuGraph, but these cover only part of the pipeline, and some of their defaults differ from the tools they replace. And most importantly, we want to serve these great acceleration for scientists in affordable prices, so renting a whole GPU sandbox for few minutes execution for potential few hours of discovery analysis session is very cost inefficient and unnecessary.

We therefore rewrote the methods themselves and serve them in a serverless infrastructure allowing bursting, concurrent workload can be easily executed with affordable pricing. For each one, we located the part that dominates the runtime and chose the target that suits that kind of work:

GPU
Dense linear algebra, graphs and permutations

PCA, kNN, UMAP, t-SNE, Leiden, per-gene GLMs, permutation tests and deconvolution EM all do wide, regular arithmetic. We write CuPy kernels, use PyTorch for GLM fits, and use cuML, cuGraph and rapids_singlecell only where their output agrees with the original.

Rust
Branchy, streaming and I/O-bound work

Counting reads over peaks and annotating peaks make a long chain of small decisions for each read, so a GPU gains nothing and the speed comes from removing interpreter overhead instead. Our Rust ports of DiffBind dba.count and ChIPseeker annotatePeak give the same counts and annotations as the originals and run 36.5× and 5.1–6.5× faster.

Together, the methods span single-cell, spatial, ATAC, trajectory, differential expression, gene sets, cell–cell communication and 3D genome analysis. We grouped them into 14 modules, each owned by one agent campaign (§3).

Figure 3 · The coverage map: 84 methods in 14 modules
Each square is one method, grouped by module: 80 GPU methods in purple and 4 CPU or R ports in teal. The count on the right gives the number of methods in each module. Hover over a square to see its speedup.

Colours mean the same thing in every figure: purple is our GPU method, teal is our CPU or Rust port, and grey-brown is the classic tool.

Porting and testing with multi-agent campaigns

A port is only useful if scientists can trust it to give the same answer as the tool it replaces. Porting and checking about eighty methods/tools by hand would take months of engineering, so we built a multi-agent system that does most of this work, while our scientists review the process and do quality control.

How a campaign runs

We organise the work into campaigns. A campaign is one agent session that takes over a single module on its own branch and tests every method in it against the eight checks described below. When a method fails, the lead agent hands it to a fixer subagent, which patches the code and its test in an isolated sandbox. Before a verdict is recorded, a reviewer agent deliberately breaks the method to make sure the tests notice.

Figure 4 · How a module is ported and checked
Fixers repair the methods that fail a check, and a reviewer plants defects to make sure the checks catch them. In our mutation test, the checks caught all 10 effective mutants.

How we decide whether a reimplementation passes

Every method is compared with the original tool at a pinned version, which we call the oracle, and never with our own CPU copy. It has to pass all eight of the following checks:

1
No fallback

Fails if, without a GPU, the method quietly runs on CPU or returns an approximation instead of stopping with an error. This is an usual problem because of LLM cheating the benchmark or testcases

2
Scientific integrity

Fails if a number looks right but is not the stated quantity, or if the output is truncated.

3
Reproducibility

Fails if the same input and seed give different results, or if the defaults differ from the classic method.

4
Fidelity

Fails if the result does not match the oracle within tolerance, or if the method was never tested on real data.

5
Meaningful speed

Fails for a thin wrapper, for a method that is slower, or for a large ratio over a very short classic run.

6
Works end to end

Fails if the method passes in the kernel repository but breaks through the SDK, the backend or the shipped image.

7
Consistent interface

Fails if the kernel, the SDK, and the relevant skill guidance for the analysis model disagree on the name, the parameters or whether calls can be chained.

8
Familiar to agents

Fails if an agent that knows the classic tool cannot call our method the same way, or if inputs are validated in the worker rather than the SDK.

We don't accept a speedup until the method matches its oracle.

A use case: tumour states, regulons and trajectories in lung cancer

A speedup on a single method says little about how long a scientist actually waits for an answer, so we also ran a full analysis end to end to demonstrate our method and infrastructure. We picked a request that a preclinical oncology team could send on any day: find the tumour cell states in non-small-cell lung cancer, the transcription-factor regulons that control them, and the trajectory between those states. Answering it involves clustering cells into states, inferring which transcription factors drive each state, and ordering cells along a developmental path to find genes that change along it.

We used 24,161 malignant cells sampled from the LuCA lung cancer atlas (Salcher et al. 2022). The prompt fixes every analytical choice, so the only thing that differs between runs is where the work happens. The analysis has eight steps:

  1. Load the data.
  2. Normalise, select 5,000 HVGs, run PCA, Harmony by donor, kNN, UMAP and Leiden.
  3. Run GRNBoost2 with the full human TF list, then prune with cisTarget against the two hg38 v10 databases.
  4. Score the regulons with AUCell.
  5. Score the pathways with PROGENy.
  6. Run CytoTRACE v1.
  7. Run Slingshot on the three LUAD states (16,403 cells).
  8. Fit a tradeSeq negative-binomial GAM with 6 knots on all 5,000 HVGs and run the association, pattern, diffEnd and start-vs-end tests.

We ran the same prompt, model and sandbox type twice, changing only where the work runs:

  • A · CPU only. The classic tools (scanpy, pySCENIC, R slingshot and tradeSeq, …) on 16 sandbox cores.
  • B · GPU ops. A fixed recipe sent steps 2 to 8 to our GPU methods on an elastic pool.
Figure 5 · The lung-cancer analysis on CPU and on GPU
Our GPU methods finish the analysis in 19 minutes of step time, against 6.3 hours on 16 CPU cores. Each bar is split into the eight steps; hover a segment for its time.
StepA · CPU, 16 coresB · GPU ops
1 · Load1.7 s2.0 s
2 · Normalise → Harmony → Leiden4.3 min4.3 min GPU
3 · GRNBoost2 + cisTarget42.5 min2.5 min GPU
4 · AUCell88 s
5 · PROGENy38 s3.9 min GPU
6 · CytoTRACE v119.8 min2.4 min GPU
7 · Slingshot5.5 min2.1 min GPU
8 · tradeSeq NB-GAM5.1 h3.9 min GPU
Sum of steps6.3 h19.2 min (19.8×)
Submission to final answerover 6 h26.6 min

Steps 3 and 4 ran as one GPU job. Cells without a GPU tag ran on the sandbox CPU.

Two steps take almost all of the CPU time: tradeSeq (5.1 hours) and GRNBoost2 (42 minutes). They are also where the GPU helps most, at 78× and 17× faster. Light steps gain nothing at 24k cells: PROGENy is 6× slower on the GPU pool, because sending the job and waiting in the queue take longer than the computation itself. That overhead stays roughly fixed while compute grows with the data, so more steps will pay off on the GPU as inputs get larger. For now, light steps stay in the sandbox and only heavy ones go to the pool.

A faster result only matters if the answer is the same, so we compared the GPU run with the CPU run, cell by cell and gene by gene:

Agreement with the CPU runB · GPU ops
tradeSeq association statistic, Spearman ρ over 5,000 genes0.975
Genes varying along pseudotime (FDR < 0.05), Jaccard0.943
Genes differing between lineages (patternTest FDR < 0.05), Jaccard0.976
Slingshot pseudotime, Spearman ρ over 16,403 cells0.980
CytoTRACE, Spearman ρ over 24,161 cells0.959
Regulon TF sets, Jaccard0.972

The trajectory results, which take 80% of the CPU time, agree closely: the tradeSeq association statistic has a Spearman ρ of 0.975 across 5,000 genes, and 92% of the genes called significant on one run are also significant on the other.

Making the methods agent-ready

Fast kernels are not enough on their own. As §1 showed, most failing cells in production are ordinary API and code errors, not memory or time limits, so the agent also has to find the right method, call it correctly and understand what comes back. Before this work, our agents reached GPU compute through a generic job API, where the agent had to:

  1. Select a container.
  2. Write a Python program into a shell-quoted string.
  3. Submit the job and poll it until it finished.
  4. Download the output and parse it.

That design works well for molecular docking, where one call is one job, but poorly for an analysis that the agent builds up one step at a time. Below is the same PBMC clustering written both ways, with the current API on the left and the older raw path on the right.

Native: drylab_tools_sdk.analysis6 lines
import drylab_tools_sdk.analysis as da

ds = da.load_h5ad("My Project/pbmc.h5ad")  # bind; no data moves yet
da.pp.qc(ds)
da.pp.normalize(ds)
da.pp.embed(ds)
da.tl.cluster(ds, method="leiden", resolution=1.0)
# the cell's last expression materialises:
# one unit of work over one AnnData
Shortened from the SDK skill document (7,218 bytes).
Raw: accelerated_tools.run16 lines · composite
from drylab_tools_sdk import DrylabClient
client = DrylabClient()
cmd = ("python -c 'import rapids_singlecell as rsc; import scanpy as sc; "
  "adata = sc.read_h5ad(\"/input/data.h5ad\"); rsc.get.anndata_to_GPU(adata); "
  "rsc.pp.flag_gene_family(adata, gene_family_name=\"MT\", gene_family_prefix=\"MT-\"); "
  "rsc.pp.calculate_qc_metrics(adata, qc_vars=[\"MT\"]); rsc.pp.normalize_total(adata); "
  "rsc.pp.log1p(adata); rsc.pp.highly_variable_genes(adata, n_top_genes=2000, flavor=\"seurat_v3\"); "
  "adata = adata[:, adata.var.highly_variable]; rsc.pp.pca(adata); rsc.pp.neighbors(adata); "
  "rsc.tl.umap(adata); rsc.get.anndata_to_CPU(adata); sc.tl.leiden(adata); "
  "adata.write_h5ad(\"/output/results.h5ad\")'")
job = client.accelerated_tools.run("rapids_singlecell",
    {"command": cmd, "inputs": {"data.h5ad": "/home/user/user_data/Project/pbmc.h5ad"},
     "use_gpu": True}, timeout_seconds=3600)
result = client.accelerated_tools.get_job_results(job.job_id, job.tool_id, timeout=3600, interval=10)
if result.is_failed:
    print(result.error, result.log)  # read the log, edit the string, resubmit
Figure 6 · How a request is routed between the sandbox and the GPU pool
The agent writes analysis steps in its sandbox; the SDK checks them and decides where each runs. Small inputs stay local, and heavy chains go to an elastic GPU pool that exists only while jobs run. The strip below shows, to scale, how long one GPU node is billed for a single job.

Benchmarking individual methods

Section 4 timed a whole analysis. Here we time single methods. Each one runs against the original tool on the same machine, with a correctness check on the same output. The GPU is already warm, so start-up time isn't counted.

Figure 7 · Four methods, timed on CPU and GPU
Our methods turn minutes of classic runtime into seconds. Each row runs the same algorithm on CPU and on GPU; the two bars race on one clock, then settle into a log-scale view.
  • Embedding, 42×. PCA, neighbours and UMAP on 495k cells take 6 seconds instead of over 4 minutes.
  • Leiden, 516× or 5.9×. Against scanpy's default (leidenalg) we take 2.9 s instead of 25 minutes; against its faster igraph option, the gain is 5.9×.
  • CellBender, about 7 minutes on GPU. The same tool on 16 CPU cores never finished its first training epoch.
Figure 8 · Speedup explorer: 72 measured ops
Each dot is one benchmarked method; hover or tap a dot to see its baseline, sizes, hardware and correctness check. Purple is GPU and teal a CPU port.

Where the GPU loses

A GPU is not faster at everything. Before it computes anything, a job has to copy its data into GPU memory, start its kernels and set up its model, and that cost is about the same whether the input has 500 cells or 50,000. On a large problem it disappears into the total. On a small one it is most of the runtime, and the classic tool on the CPU finishes first.

GRNBoost2, which infers which transcription factors regulate which genes, shows this clearly. On 500 cells, arboreto on the CPU takes 3 seconds and our GPU version takes 32, so the GPU is 11 times slower. At 2,000 cells the GPU is still only half as fast. By 20,000 cells it is 4.9 times faster, and at 50,000 cells 12.6 times faster, because the CPU's time keeps growing with the data while ours stays under a minute and a half. The two lines cross at roughly 4,000 cells.

Other methods cross over much earlier. De-novo motif discovery breaks even at about 100 sequences and is 35 times faster than a CPU version of the same algorithm at 3,000. Building a spatial neighbour graph by radius pays off above about 3,000 cells, although at these sizes both versions finish in under a fifth of a second, so a user would not notice the difference.

These crossover points feed our routing rules: small inputs stay in the agent's sandbox on the CPU, and only steps large enough to win go to the GPU pool.

Figure 9 · Crossover: the size below which CPU wins
Each line is one method's speedup as its input grows. Below 1× (the shaded region) the GPU is slower than the classic tool, and each diamond marks where a line crosses 1×.

What changes for preclinical and atlas teams

Atlas-scale work becomes something you can iterate on. Embedding 500k cells now takes seconds instead of minutes, so you can try another clustering resolution and look again rather than settling on the first one. The biggest gains are in the analyses that failed most often in §1: large atlases, cross-study integration and full spatial slides.

Cost works differently too. A CPU sandbox is billed for as long as it's up. A GPU node is billed only while it runs, plus about 5 minutes to start and an idle period before it shuts down, which we're working to shorten. That's why only heavy steps go to the GPU and light ones stay local. For customer deployments, the GPU pool now runs inside the customer's own GCP or AWS project easily with our terraform template.


LinkedInX
Run this kind of analysis on your own data. Drylab’s agents use the same tools described in this post.
Run it on Drylab →
Animation on dark green: without the selector, a request reaches six tools and the agent picks a wrong one, with a card listing why; with the selector, the whole catalog lights up, a line reaches boltz2 and its tool card opens.
Technical

A scientific agent that chooses the right tools

Our scientific agent can use a wide range of tools, pipelines, databases, analysis operations and method guides, but in production it often misses the right one. We built the first benchmark measuring ability to discover and select the right tool for scientific research tasks. Later on we trained a Jev-like selector that outperforms Claude Code, Codex and Biomni on the same set of resources.

Illustration: branching white lines with nodes on dark green, like candidate routes splitting from one path
Technical

DryLab Discovery at the OpenADMET PXR challenge

In this post, we share a technical post-mortem of how our autonomy research system automated feature engineering, diagnosed validation-loop biases, and achieved a competitive, near-state-of-the-art result on entirely novel chemical scaffolds.