Skip to content

Instantly share code, notes, and snippets.

@SimplyAhmazing
Created September 21, 2016 16:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SimplyAhmazing/6c6dec03922d759044ad11534e093d42 to your computer and use it in GitHub Desktop.
Save SimplyAhmazing/6c6dec03922d759044ad11534e093d42 to your computer and use it in GitHub Desktop.
Protocol
from opentrons_sdk.labware import containers, instruments
# Deck declarations
"""
Deck is a singleton behind the scenes that registers containers
and validates errors such as impromper allocation and inferences
loading of yaml/json files based on attribute names.
"""
protocol = Protocol()
standards = containers.load('pcr_flat_96')('D1')
standards = containers.load('pcr_flat_96').set_slot('D1')
standards = containers.load('pcr_flat_96', slot='D1')
standards = containers.load('pcr_flat_96').slot('D1')
protocol.add_container(standards)
p200_rack = containers.tiprack_200ul('B1')
trash = containers.point('B2')
trough = containers.trough_12row('C2')
# Head declarations
p200 = instruments.Pipette(
trash_container=trash,
tip_racks=[p200_rack],
min_vol=10, # These are variable
max_vol=200, # These variable
axis="b",
channels=1
)
p200 = instruments.Pipette(
trash_container=trash,
tip_racks=[p200_rack],
min_vol=10, # These are variable
max_vol=200, # These variable
channels=1
)
p200.axis = 'A'
# Operations
# Using iteradispensers
for well in standards:
p200.asiprate(trough[0], 180).dispense(well) # use 0 instead of A1
p200.replace_tip() # in json it is encoded as a group
for well in standards[:-1]:
# note that asiprate() and mix() return a pipette object
# which could allow for method calls dispense be chained
# giving additional syntax sugar
p200.asiprate(well, 100).mix(3).replace_tip()
p200.asiprate(well, 20).dispense(next(well)).replace_tip()
# Last well. Don't transfer further. Only Mix.
p200.asiprate(standards[-1], 100).mix(3)
# ##### OR #####
# Operations
# Using index
for i in range(1, 13):
p200.asiprate(trough['A1'], 180).dispense(standards['A' + str(i)])
p200.replace_tip()
for i in range(1, 12):
p200.asiprate(standards['A1'], 100).mix(3).replace_tip()
p200.asiprate(standards['A' + str(i)], 20).dispense(
standards['A' + str(i + 1)]).replace_tip()
# Don't transfer further. Only Mix.
p200.asiprate(standards['A12'], 100).mix(3)
###############
## Instruments, Containers, Instr.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment