Skip to main content

The Opentrons API is a simple framework designed to make writing automated biology lab protocols easy.

Project description

Build Status Coverage Status

Introduction

The Opentrons API is a simple framework designed to make writing automated biology lab protocols easy.

We’ve designed it in a way we hope is accessible to anyone with basic computer and wetlab skills. As a bench scientist, you should be able to code your automated protocols in a way that reads like a lab notebook.

pipette.aspirate(tube_1).dispense(tube_2)

That is how you tell the Opentrons robot to aspirate its the maximum volume of the current pipette from one tube and dispense it into another one.

You string these commands into full protocols that anyone with Opentrons can run. This one way to program the robot to use a p200 pipette to pick up 200ul (its full volume) and dispense 50ul into the first four wells in a 96 well plate called ‘plate.’

p200.aspirate(trough[1])
p200.dispense(50, plate[0])
p200.dispense(50, plate[1])
p200.dispense(50, plate[2])
p200.dispense(50, plate[3])

If you wanted to do enough times to fill a 96 well plate, you could write it like this:

#define how much volume to dispense in each well
dispense_vol = 50

for i in range(96):
   if p200.current_volume < dispense_vol:
      p200.aspirate(trough[1])
   p200.dispense(dispense_vol, plate[i])

Hello World

Below is a short protocol that will pick up a tip and use it to move 100ul volume across all the wells on a plate:

# First, import opentrons API modules
from opentrons.robot import Robot
from opentrons import containers, instruments

# Initialized Robot variable
robot = Robot()

# Load a tip rack and assign it to a variable
tiprack = containers.load(
    'tiprack-200ul',  # container type
    'A1',             # slot
    'tiprack'         # user-defined name
)
# Load a plate
plate = containers.load('96-flat', 'B1', 'plate')

# Initialize a pipette
p200 = instruments.Pipette(
    axis="b"
)

p200.set_max_volume(200)  # volume calibration, can be called whenever you want
p200.pick_up_tip(tiprack[0])  # pick up tip from position 0 in a tip rack

# loop through 95 wells, transferring to the next
for i in range(95):
    p200.aspirate(100, plate[i])
    p200.dispense(plate[i + 1]).blow_out().touch_tip()

# return tip to back to position 0 in a tip rack
p200.return_tip()
# simulate a protocol run on a virtual robot
robot.simulate()
# robot.connect('/dev/tty.usbserialNNNN')  # connect to the robot
# robot.run()                              # to run on a physical robot

Basic Principles

Human Readable: API strikes a balance between human and machine readability of the protocol. Protocol written with Opentrons API sound similar to what the protocol will look in real life. For example:

p200.aspirate(100, plate['A1']).dispense(plate['A2'])
Is exactly what you think it would do:
  • Take P200 pipette

  • Aspirate 100 uL of liquid from well A1 on your plate

  • Dispense everything into well A2 on the same plate

Permissive: everyone’s process is different and we are not trying to impose our way of thinking on you. Instead, our API allows for different ways of expressing your protocol and adding fine details as you need them. For example:

p200.aspirate(100, plate[0]).dispense(plate[1])

while using 0 or 1 instead of ‘A1’ and ‘A2’ will do just the same.

or

p200.aspirate(100, plate[0].bottom())

will aspirate 100, from the bottom of a well.

Installing Opentrons API

If you are just starting with Python it is recommended to install Jupyter notebook to run Opentrons API. Please refer to Setting up Opentrons API for detailed instructions.

If you are familiar with python and comfortable running pip, you can install Opentrons API by running:

pip install opentrons

What’s next?

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

opentrons-1.99.7.tar.gz (69.0 kB view hashes)

Uploaded Source

Built Distributions

opentrons-1.99.7-py3.4.egg (120.7 kB view hashes)

Uploaded Source

opentrons-1.99.7-py2.py3-none-any.whl (64.8 kB view hashes)

Uploaded Python 2 Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page