Local simulator & visualizer for Opentrons OT-2 bio-art protocols — no robot required
Project description
Opentrons Bio-Art Simulator
Run and visualize Opentrons OT-2 bio-art protocols locally — no robot required.
Simulate protocols generated by the Opentrons Art Designer or custom HTGAA protocols. Preview your fluorescent protein artwork on a virtual Petri dish before using real hardware.
Features
- Full mock of the Opentrons Python API (
ProtocolContext, pipette, labware, modules) - Automatic color mapping for 30+ fluorescent proteins (sfGFP → lime, mRFP1 → red, etc.)
- Matplotlib visualization of the Petri dish with droplets and smears
- Save images directly from the command line
- Volume tracking — detects waste and cross-contamination
- Zero dependencies beyond
opentronsandmatplotlib
Installation
From source (recommended)
git clone https://github.com/Mozta/opentrons-bioart-sim.git
cd opentrons-bioart-sim
python -m venv venv
source venv/bin/activate # macOS/Linux
pip install -e .
Dependencies only
pip install opentrons matplotlib
Usage
Option 1 — CLI (command line)
# Run an example protocol
opentrons-bioart-sim examples/octocat.py
# Change the Petri dish background
opentrons-bioart-sim examples/octocat.py --background agar
# Save to file without displaying
opentrons-bioart-sim examples/OTDesign_02-23-26_11-56-55.py --save output.png --no-show
# See all options
opentrons-bioart-sim --help
Option 2 — One-liner in Python
from opentrons_bioart_sim import simulate_protocol
mock = simulate_protocol('examples/octocat.py', background='black')
Option 3 — Manual control
from opentrons_bioart_sim import OpentronsMock
well_colors = {
'A1': 'sfGFP',
'A2': 'mRFP1',
'A3': 'Azurite',
# ...
}
mock = OpentronsMock(well_colors)
run(mock) # your run(protocol) function
mock.visualize(save_path='art.png') # render the Petri dish
Petri Dish Backgrounds
| Value | Description |
|---|---|
'black' |
Dark agar plate (default) |
'agar' |
Normal agar plate (beige) |
'paper' |
Paper insert (outline only) |
Supported Fluorescent Proteins
| Protein | Visual Color | Protein | Visual Color |
|---|---|---|---|
| sfGFP | lime | mRFP1 | red |
| mCherry | firebrick | mKO2 | orange |
| Venus | yellow | Azurite | royalblue |
| mTurquoise2 | turquoise | TagBFP | blue |
| mClover3 | green | mWasabi | lightgreen |
| mNeonGreen | greenyellow | mScarlet_I | tomato |
| mPlum | purple | Electra2 | deepskyblue |
| mJuniper | darkgreen | EGFP | lime |
30+ proteins supported — see
colors.pyfor the full list.
Project Structure
opentrons-bioart-sim/
├── src/opentrons_bioart_sim/ # Installable package
│ ├── __init__.py # Public API exports
│ ├── cli.py # Command-line interface
│ ├── colors.py # Protein → color mapping
│ ├── mock.py # Mock Opentrons API classes
│ └── visualization.py # Petri dish rendering
├── examples/ # Example protocols
│ ├── octocat.py
│ ├── siempre_tuyo.py
│ ├── OTDesign_02-23-26_11-56-55.py
│ └── OTDesign_02-23-26_18-57-12.py
├── notebooks/ # Original HTGAA Colab notebooks
├── tests/ # Test suite
├── pyproject.toml # Build configuration
├── README.md
├── CONTRIBUTING.md
└── LICENSE
Architecture
| Class | Simulates | Key Responsibility |
|---|---|---|
OpentronsMock |
ProtocolContext |
Entry point — loads labware, modules, pipettes |
PipetteSim |
InstrumentContext |
Tracks droplets, smears, volumes, colors |
LabwareMock |
Labware |
Well plates, tip racks, custom plates |
WellMock |
Well |
Individual well positions and colors |
ModuleMock |
Hardware modules | Temperature, thermocycler modules |
Development
# Install with dev dependencies
pip install -e ".[dev]"
# Run tests
pytest tests/ -v
# Lint
ruff check src/ tests/
See CONTRIBUTING.md for more details.
Credits
- Original HTGAA Colab Notebook — by Eyal Perry, Laura Maria Gonzalez, Dominika Wawrzyniak, Alex Hadik, Suvin Sundararajan, and Ronan Donovan. Their notebook served as the foundation codebase for this project.
- María José Rivas Arreola — whose HTGAA coursework inspired the creation of this standalone tool for the community.
- HTGAA — How To Grow (Almost) Anything course
- Opentrons Art Designer by RC Donovan — web tool for designing bio-art protocols
- Opentrons — open-source lab robotics
License
MIT — see LICENSE for details.
Made with 🧬 + 🎨 by Rafael Pérez Aguirre (@Mozta)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file opentrons_bioart_sim-1.0.0.tar.gz.
File metadata
- Download URL: opentrons_bioart_sim-1.0.0.tar.gz
- Upload date:
- Size: 21.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fb091d6fab403473ca663c0392c1c4cfdb1bfadf3d7fb1b86a369c05d7d298be
|
|
| MD5 |
cb7dc8560356af48790925fefa7fe1bc
|
|
| BLAKE2b-256 |
e7357330c1ad0eefe32f2da340daa84bb4387076532513e5752de69d1df0fd5e
|
File details
Details for the file opentrons_bioart_sim-1.0.0-py3-none-any.whl.
File metadata
- Download URL: opentrons_bioart_sim-1.0.0-py3-none-any.whl
- Upload date:
- Size: 16.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d35a6e683f1dc335e30997bd1c5d18d89e927a79212b3cadfaac405bbc2f9e30
|
|
| MD5 |
5c6987f37540936f52f1eaf60ca84542
|
|
| BLAKE2b-256 |
3aac6489b25eb390a53c60b66566d7878b34020e26390b8352056f02aea2b428
|