lab automation · 17 November 2026
Why we built the Opentrons Protocol Builder
A protocol that simulates cleanly can still ruin a plate. This web app writes protocols that follow the rules we learned the hard way.
Open the app Code on GitHub: JackATDalton/opentrons-protocol-builder
Our lab runs an Opentrons Flex for the routine liquid handling of synthetic biology: minipreps, normalising DNA to one concentration, and combinatorial Golden Gate assembly. The robot's Python API makes it easy to write a protocol. Writing one that actually moves the right volume to the right well, every time, turned out to be much harder.
The problem: "it simulates" is not "it works"
Opentrons ships a simulator, and it is the obvious place to check a protocol. It confirms that every command can physically run: that the labware exists, the tips are there and the volumes fit the pipette. It cannot tell you whether the protocol does what you meant.
Over a year of runs we hit a series of failures. Every one of them passed the simulator with no errors:
- Small volumes went missing. Reverse-pipetting 1 µL of DNA left roughly one well in three empty. Some of the others got more than 1 µL.
- A tip contaminated shared stock. One protocol alternated between aspirating from a shared repository plate and dispensing into reaction wells, all with the same tip. Each trip carried liquid from the destination back into stock that later plates drew from, which put two plates of data in doubt.
- Labels silently drifted. Source wells were ordered over a 3-row selection and destination tubes over a 4-row rack. The two lists agreed for the first column and then diverged, so every later tube was mislabelled and nothing raised an error.
- A "batching optimisation" ruined samples. Rewriting a miniprep to lyse everything and then neutralise everything left the first tubes sitting in lysis buffer for the whole pass.
- Liquid-level detection under-read, and nearly every well was under-transferred. The simulator can't exercise it at all.
Each fix lived in one hand-edited script. The next protocol written for a slightly different experiment would make the same mistake again.
The rules we came up with
We wrote every lesson down with the run that taught it, and turned the ones that apply everywhere into seven rules every protocol must follow:
- A tip never goes back into a source after it has touched a destination. A tip goes source → destination(s) → trash. The only exception is a dispense from above the well that never touches the liquid.
- Only share a tip between wells with identical contents. For a combinatorial assembly, that means wells that have received exactly the same parts so far.
- Pair wells by name, from one ordering. Source and destination lists come from the same traversal, and the pairing is written into the protocol, not re-derived on the robot.
- Check volumes against working capacity, not the label. A 200 µL PCR plate is full at about 150 µL.
- Respect time-sensitive steps. Steps like lysis and neutralisation are interleaved in small groups, and are never "optimised" into two passes.
- Never hard-code deck slots. Labware is placed against your robot's actual deck and fixtures, so nothing collides.
- Never rely on liquid-level detection. You declare the source volumes.
We also worked out pipetting parameters that we now keep in one place instead of retyping them in each script:
- Below about 3 µL, reverse pipetting fails. Use a fresh tip and a blow-out at the bottom of the well, or scale the reaction up.
- When reverse pipetting, aspirate real excess: the larger of 5 µL or 15 % of the batch. Blow the excess back at the bottom of the source, not the top, where it stays in the tip.
- Dispense at half speed, 0.2 mm off-centre, so the drop sits against the well wall instead of riding the tip. With that, touch-tip adds nothing.
Machine-checkable rules are tested automatically against every generated protocol. The rest are built into how the generators work.
The web app
Most people don't want to write a protocol; they want to run their samples. The Opentrons Protocol Builder puts these rules behind a form. It has five tools:
- Normalise tubes: a box of 1.5 mL tubes at assorted concentrations becomes one 96-well plate at a single concentration.
- Normalise a plate: dilute a plate's wells in place to one concentration.
- Miniprep: vacuum-manifold plasmid prep, from culture to eluate, for 1–48 samples.
- Plate to tubes: one 1.5 mL tube per selected well.
- Golden Gate: combinatorial assembly with onboard or external thermocycling.
How to use it
- Pick your deck. Choose the preset that matches your robot's fixed hardware, then pick a tool.
- Set up. Upload or paste your CSV (concentrations, a plate layout or an assembly design) and set the volumes. Each upload box has a download for an example of the expected format. The deck diagram stays beside the form, so if a setting needs another tip rack, you see it appear.
- Plan. Check the table of what goes where, and read the warnings: wells that can't reach the target, parts that are short, wells over capacity.
- Simulate. Step through an animation of the run. Everything on screen comes from the same code that writes the protocol, so if the animation looks wrong, the protocol is wrong.
- Download. The
.pyfile is named with the date and your uploaded plate files, so you can tell later which run it belongs to. Run it throughopentrons_simulate(the app shows you the command), then validate it on your own robot before trusting it with real samples.
The app is a static site. There's no server, and nothing you paste leaves your browser. Slack notifications for each stage of a run are optional: add your own webhook if you want them.
Fork it
The parameters come from our Flex and our labware, so treat them as a starting point, not gospel. The code is MIT-licensed and lives in its own repository, JackATDalton/opentrons-protocol-builder. Fork it, change the deck presets and labware to match your lab, and GitHub Pages will host your own copy. If you find a rule that's wrong on your machine, or one we missed, open an issue; that is exactly the kind of lesson this project exists to collect.