Skip to main content
biocompute

Wet lab automation as Python code. Maintained by london biocompute.

PyPI version Python License

biocompute is a framework that lets you write wet lab experiments as plain Python. Define your protocol with calls like well.fill(), well.mix(), and well.image(). Then execute on real lab hardware that handles the liquid dispensing, mixing, and imaging automatically. No drag-and-drop GUIs, no manual pipetting.

If you know Python, you can run wet lab experiments.


Quick start

Create a virtual environment and install the biocompute package.

python -m venv .venv
source .venv/bin/activate
pip install biocompute

Create a file called super_simple_experiment.py and copy the code snippet.

from biocompute import wells, red_dye, green_dye, blue_dye

def experiment():
    for well in wells(count=3):
        well.fill(vol=80.0, reagent=red_dye)
        well.fill(vol=40.0, reagent=green_dye)
        well.fill(vol=20.0, reagent=blue_dye)
        well.mix()
        well.image()

Visualize the experiment in your terminal.

biocompute visualize super_simple_experiment.py

To run experiments on real hardware, log in and submit.

biocompute login
biocompute submit super_simple_experiment.py --follow

Results stream back to your terminal as experiments finish executing on the physical hardware.

Note: Hardware access is currently limited. Run biocompute login to join the waitlist.


How it works

Your experiment function describes intent. The compiler takes this high-level declarative code and turns it into a fully scheduled, hardware-specific protocol. It handles:

  • Automatic parallelism — independent operations are identified and scheduled concurrently so protocols finish faster without any manual orchestration.
  • Plate layout — wells are assigned to physical plates based on thermal constraints. Multi-temperature experiments get split across plates automatically.
  • Operation collapsing — redundant per-well instructions (like 96 identical incubations) are collapsed into single plate-level commands.
  • Device mapping — every operation is matched to the right piece of hardware (pipette, camera, incubator, gripper) based on a capability model, so swapping equipment never means rewriting your protocol.
  • Multi-plate scaling — protocols that exceed a single plate are transparently distributed across as many plates as needed.

You describe what should happen. The compiler figures out how to make it fast.

Operations

Method What it does
well.fill(vol, reagent) Dispense vol µL of reagent
well.mix() Mix well contents
well.image() Capture an image

wells(count=n) yields n wells. Multiple calls produce non-overlapping wells.

Reagents

Import the built-in reagents you need.

from biocompute import red_dye, green_dye, blue_dye, water

Because it's just Python

Use numpy. Use scipy. Use whatever. The system only sees wells and operations.

Colour sweep

Sweep red dye volume across ten wells using numpy to generate the range.

import numpy as np
from biocompute import wells, red_dye, green_dye, blue_dye

def experiment():
    for well, r in zip(wells(count=10), np.linspace(10, 100, 10)):
        well.fill(vol=r, reagent=red_dye)
        well.fill(vol=50.0, reagent=green_dye)
        well.fill(vol=50.0, reagent=blue_dye)
        well.mix()
        well.image()

Closed-loop optimisation

Submit an experiment, read results, use them to parameterise the next one.

import numpy as np
from scipy.interpolate import interp1d
from scipy.optimize import minimize_scalar
from biocompute import Client, wells, red_dye, green_dye

with Client() as client:
    volumes = np.linspace(10, 100, 8)

    def experiment_sweep():
        for well, v in zip(wells(count=8), volumes):
            well.fill(vol=v, reagent=red_dye)
            well.fill(vol=50.0, reagent=green_dye)
            well.mix()
            well.image()

    result = client.submit(experiment_sweep)

    model = interp1d(volumes, result.result_data["scores"], kind="cubic")
    optimum = minimize_scalar(model, bounds=(10, 100), method="bounded").x

    def experiment_refine():
        for well, v in zip(wells(count=5), np.linspace(optimum - 10, optimum + 10, 5)):
            well.fill(vol=v, reagent=red_dye)
            well.fill(vol=50.0, reagent=green_dye)
            well.mix()
            well.image()

    final = client.submit(experiment_refine)

Release files for biocompute 0.1.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for biocompute 0.1.5
File Size Uploaded
biocompute-0.1.5.tar.gz 18.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for biocompute 0.1.5
File Interpreter ABI Platform
biocompute-0.1.5-py3-none-any.whl Python 3 none any Details

Total release size: 37.9 kB

Release files / biocompute-0.1.5.tar.gz

Download URL biocompute-0.1.5.tar.gz
Size 18.2 kB
Tags Source
SHA-256 checksum
How to use checksums
3360efa0dada476d7bbf582fef9b7fe7079f935c957a9c39ab00373b0c2a6a5b
BLAKE2b-256 checksum
How to use checksums
eea9aa0a59ca289ed35b5f33eab67e7791ed572945377662d5e4e0dbfc962bae
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.9

Release files / biocompute-0.1.5-py3-none-any.whl

Download URL biocompute-0.1.5-py3-none-any.whl
Size 19.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e4d4f63c94610f7fa1b92b9ba0f1b80e6383d1f0e35ff16f5ab8d74cfa3dbe24
BLAKE2b-256 checksum
How to use checksums
6957146f62b3ba383d5391a1f227c80448170a83ca6f7648d38d670cb14a3faf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.9

Release history Release notifications | RSS feed

This release

0.1.5 This release

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page