Skip to content

Commit 42f66a2

Browse files
fixing code blocks and most build errors, add expected mix behavior and meniscus-relative shoutout
1 parent 5d1d86b commit 42f66a2

File tree

5 files changed

+89
-72
lines changed

5 files changed

+89
-72
lines changed

api/docs/v2/complex_commands/parameters.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ For example, this basic transfer command will mix 50 µL of liquid 3 times befor
113113

114114
Mixing occurs before every aspiration, including when :ref:`tip refilling <complex-tip-refilling>` is required.
115115

116-
Liquid class definitions determine mix behavior in liquid class complex commands like ``transfer_with_liquid_class()``. For more information, see the :ref:`Opentrons-verified liquid class definitions <liquid-class-definitions>`.
116+
Liquid class definitions determine mix behavior in liquid class complex commands like ``transfer_with_liquid_class()``. If mixing is enabled before an aspiration, the pipette will mix in place at the aspirate position. You can see position and other values in the :ref:`Opentrons-verified liquid class definitions <liquid-class-definitions>`.
117117

118118
.. note::
119119
:py:meth:`~.InstrumentContext.consolidate` ignores any value of ``mix_before``. Mixing on the second and subsequent aspirations of a consolidate command would defeat its purpose: to aspirate multiple times in a row, from different wells, *before* dispensing.
@@ -285,7 +285,7 @@ For example, this ``transfer()`` command will mix 50 µL of liquid 3 times after
285285
mix_after=(3, 50),
286286
)
287287

288-
Liquid class definitions determine mix behavior in liquid class complex commands like ``transfer_with_liquid_class()``. For more information, see the :ref:`Opentrons-verified liquid class definitions <liquid-class-definitions>`.
288+
Liquid class definitions determine mix behavior in liquid class complex commands like ``transfer_with_liquid_class()``. If mixing is enabled after a dispense, the pipette will mix in place at the dispense position. You can see position and other values in the :ref:`Opentrons-verified liquid class definitions <liquid-class-definitions>`.
289289

290290
.. versionadded:: 2.0
291291

api/docs/v2/liquid_class_definitions.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
Liquid Class Definitions
77
*************************
88

9-
A *liquid class definition* specifies nearly all transfer behavior a Flex pipette will perform during a :py:meth:`.InstrumentContext.transfer_with_liquid_class`, :py:meth:`.InstrumentContext.distribute_with_liquid_class`, or :py:meth:`InstrumentContext.consolidate_with_liquid_class`. Properties, like aspirate flow rate, submerge speed, or dispense position, are required in every liquid class definition.
9+
A *liquid class definition* specifies nearly all transfer behavior a Flex pipette will perform during a :py:meth:`.InstrumentContext.transfer_with_liquid_class`, :py:meth:`.InstrumentContext.distribute_with_liquid_class`, or :py:meth:`.InstrumentContext.consolidate_with_liquid_class`. Properties, like aspirate flow rate, submerge speed, or dispense position, are required in every liquid class definition.
1010

1111
This section details specific changes to transfer behavior for each Opentrons-verified liquid class. The transfer steps are listed in the order the robot performs them. Advanced settings like mix, pre-wet tip, touch tip, and blowout are automatically disabled in Opentrons-verified liquid class definitions.
1212

api/docs/v2/liquid_classes.rst

Lines changed: 85 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -78,13 +78,15 @@ Each Opentrons-verified liquid class is defined by a set of properties:
7878
* - .. image:: ../img/lc_icons/flow_rate_aspirate.png
7979

8080
**Aspirate flow rate**
81-
- The pipette aspirates liquid at this speed.
82-
- Varies by volume.
81+
-
82+
- The pipette aspirates liquid at this speed.
83+
- Varies by volume.
8384
* - .. image:: ../img/lc_icons/flow_rate_dispense.png
8485

8586
**Dispense flow rate**
86-
- The pipette dispenses liquid at this speed.
87-
- Varies by volume.
87+
-
88+
- The pipette dispenses liquid at this speed.
89+
- Varies by volume.
8890
* - .. image:: ../img/lc_icons/retract_position.png
8991

9092
**Retract position**
@@ -96,17 +98,19 @@ Each Opentrons-verified liquid class is defined by a set of properties:
9698
* - .. image:: ../img/lc_icons/push_out.png
9799

98100
**Push out**
99-
- The pipette dispenses a small amount of air to ensure all liquid leaves the tip.
100-
- Varies by volume.
101+
-
102+
- The pipette dispenses a small amount of air to ensure all liquid leaves the tip.
103+
- Varies by volume.
101104
* - .. image:: ../img/lc_icons/touch_tip.png
102105

103106
**Touch tip**
104107
- The pipette touches the attached tip to the sides of a well to remove droplets.
105108
* - .. image:: ../img/lc_icons/air_gap.png
106109

107110
**Air gap**
108-
- The pipette aspirates a small amount of air after an aspirate or dispense.
109-
- Varies by volume.
111+
-
112+
- The pipette aspirates a small amount of air after an aspirate or dispense.
113+
- Varies by volume.
110114
* - .. image:: ../img/lc_icons/blow_out.png
111115

112116
**Blow out**
@@ -131,43 +135,53 @@ Start by definining the tips, trash, pipette, and labware used in your transfers
131135
132136
from opentrons import protocol_api
133137
134-
requirements = {"robotType": "Flex", "apiLevel": "|2.23|"}
138+
requirements = {"robotType": "Flex", "apiLevel": "|2.24|"}
135139
136140
# define tips, trash, and pipette
137141
def run(protocol: protocol_api.ProtocolContext):
138-
tiprack1 = protocol_context.load_labware("opentrons_flex_96_tiprack_50ul", "D3")
139-
trash = protocol_context.load_trash_bin("A3")
140-
pipette_50 = protocol_context.load_instrument("flex_1channel_50", "left, tip_racks=[tiprack1]")
142+
tiprack = protocol.load_labware(
143+
load_name="opentrons_flex_96_tiprack_50ul",
144+
location="D3")
145+
trash = protocol.load_trash_bin(location="A3")
146+
pipette = protocol.load_instrument(
147+
instrument_name="flex_1channel_50",
148+
mount="left",
149+
tip_racks=[tiprack])
141150
142151
# load source and destination labware
143-
nest_plate = protocol_context.load_labware("nest_96_wellplate_200ul_flat", "C3")
144-
arma_plate = protocol_context.load_labware("armadillo_96_wellplate_200ul_pcr_full_skirt","C2")
152+
reservoir = protocol.load_labware(
153+
load_name="nest_12_reservoir_15ml",
154+
location="C3")
155+
plate = protocol.load_labware(
156+
load_name="nest_96_wellplate_200ul_flat",
157+
location="C2")
145158
146-
# select liquid classes to use in your protocol
147-
liquid_1 = protocol_context.get_liquid_class("glycerol_50")
148-
liquid_2 = protocol_context.get_liquid_class("ethanol_80")
149-
liquid_3 = protocol_context.get_liquid_class("glycerol_50")
159+
# select liquid class to use in your protocol
160+
viscous_liquid = protocol.get_liquid_class(name="glycerol_50")
150161
162+
.. versionadded:: 2.24
151163

152-
You'll need to add a label, like ``liquid_1``, to liquid classes in your protocol. This helps you keep track of multiple liquids of the same class in a protocol. It's also required by ``transfer_with_liquid_class()``, instead of a liquid class load name like ``glycerol_50``.
164+
Use :py:meth:`.ProtocolContext.get_liquid_class` to name the Opentrons-verified liquid class you'll use in the protocol. :py:meth:`~.get_liquid_class` also takes into account pipettes and tipracks in your protocol to define transfer behavior.
153165

154-
155-
Use the :py:meth:`.InstrumentContext.transfer_with_liquid_class` method to transfer an aqueous, volatile, or viscous liquid defined in a Flex protocol. This method accepts arguments that let you specify your liquid, volume, source and destination wells, tip handling preferences, and trash location.
166+
Next, use the :py:meth:`.InstrumentContext.transfer_with_liquid_class` method to transfer an aqueous, volatile, or viscous liquid defined in a Flex protocol. This method requires the stored set of properties defined earlier, ``viscous_liquid``, instead of the ``glycerol_50`` load name. It accepts additional arguments that let you specify your liquid, volume, source and destination wells, tip handling preferences, and trash location.
156167

157168
Opentrons-verified liquid class definitions are based on Flex pipette and tip combinations. The API will raise an error if you try to perform a liquid class transfer with an OT-2 pipette and tips.
158169

159-
In the example below, a Flex P50 1-channel pipette will transfer 50 µL of your viscous ``liquid_1`` from each well of the source plate to each well of the destination plate. A new tip is used for each well transfer, and each tip is dropped in the trash bin loaded in slot A3.
170+
In the example below, a Flex P50 1-channel pipette will transfer 50 µL of your ``viscous_liquid`` from well A1 of the reservoir to well A1 of the destination plate. A new tip is used for each well transfer, and each tip is dropped in the trash bin loaded in slot A3.
160171

161172
.. code-block:: python
162173
163-
pipette_50.transfer_with_liquid_class(
164-
liquid_class=liquid_1,
165-
volume=50,
166-
source=nest_plate.rows()[0],
167-
dest=arma_plate.rows()[0],
168-
new_tip="always",
169-
trash_location=trash
170-
)
174+
# transfer with the viscous liquid class
175+
pipette.transfer_with_liquid_class(
176+
liquid_class=viscous_liquid,
177+
volume=50,
178+
source=reservoir["A1"],
179+
dest=plate["A1"],
180+
new_tip="always",
181+
trash_location=trash
182+
)
183+
184+
.. versionadded:: 2.24
171185

172186

173187
Here, the ``glycerol_50`` viscous liquid class definition accounts for all other transfer behavior, like flow rate, whether or not to add an air gap or delay, and submerge and retract speeds. For each aspirate, the pipette:
@@ -202,57 +216,63 @@ Customizing Liquid Classes
202216

203217
You can create your own liquid class to customize transfer behavior for any liquid in a Flex protocol. To make changes, you can edit individual properties of an existing liquid class, or add properties to a new liquid class.
204218

205-
To customize an Opentrons-verified liquid class, use :py:meth:`InstrumentContext.define_liquid_class` to define your custom liquid class after adding your pipettes, tips, trash, and labware::
219+
To customize an Opentrons-verified liquid class, first add your pipettes, tips, trash, and labware. Then, use :py:meth:`~.ProtocolContext.get_liquid_class` to specify the liquid class you'll make changes to::
220+
221+
# get base liquid class and custom properties for the Flex pipette and tips
222+
custom_water = protocol.get_liquid_class(name="water")
223+
custom_water_properties=custom_water.get_for(pipette, tiprack)
206224

207-
## customize based on the aqueous liquid class
208-
custom_water = protocol_context.define_liquid_class(
209-
name="custom_water",
210-
properties=custom_liquid_class_properties,
211-
base_liquid_class="aqueous",
212-
display_name="Custom Water",
213-
)
225+
.. versionadded:: 2.24
214226

215227
Next, edit indivual liquid class properties based on your Flex pipette and tip combination.
216228

217229
.. code-block:: python
218-
219-
# access aqueous liquid class properties for the Flex 1-ch. pipette and tips
220-
custom_water_props = custom_water.get_for(pipette_20, tiprack)
221230
222-
# edit aspirate submerge speed
223-
custom_water_props.aspirate.submerge.speed = 80
231+
# edit aspirate submerge speed to 80 μL/sec
232+
custom_water_properties.aspirate.submerge.speed = 80
233+
234+
# edit aspirate flow rate by volume for 10 μL and 20 μL volumes
235+
custom_water_properties.aspirate.flow_rate_by_volume.set_for_volume = [(10.0, 40.0)
236+
custom_water_properties.aspirate.flow_rate_by_volume.set_for_volume = [(20.0, 30.0)]
237+
238+
# edit to delay for 1 sec before retracting after an aspirate
239+
custom_water_properties.aspirate.retract.delay.enabled = True
240+
custom_water_properties.aspirate.retract.delay.duration = 1.0
224241
225-
# edit aspirate flow rate by volume for 10 μL and 20 μL volumes
226-
custom_water_props.aspirate.flow_rate_by_volume = [(10.0, 40.0), (20.0, 30.0)]
242+
.. versionadded:: 2.24
227243
228-
# edit to delay before an aspirate
229-
custom_water_props.aspirate.delay = {"enabled": True}
244+
Then, complete your transfers with the modified ``custom_water`` liquid class.
230245
246+
All Opentrons-verified liquid classes position the pipette relative to the well. To customize your liquid class to use :ref:`meniscus-relative <well-meniscus>` locations, set the ``positionReference`` to ``"liquid-meniscus"`` for actions like an aspirate or dispense.
231247
232-
You can also create a new liquid class for your Flex protocols. Instead of using an Opentrons-verified ``base_liquid_class``, you'll start from scratch, providing a value for `every required property <https://github.com/Opentrons/opentrons/blob/edge/shared-data/liquid-class/schemas/1.json>`__ in your liquid class.
248+
You can also create a new liquid class for your Flex protocols. Instead of using an Opentrons-verified liquid class, you'll start from scratch, providing a value for `every required property <https://github.com/Opentrons/opentrons/blob/edge/shared-data/liquid-class/schemas/1.json>`__ in your liquid class.
233249
234250
.. code-block:: python
235251
236-
# add all required properties, like aspirate properties, for the pipette, tip rack, and liquid class
237-
custom_liquid_class_properties = {
238-
"p20_single_gen2": {
239-
"opentrons/opentrons_96_tiprack_20ul/1": {
240-
"aspirate": {
241-
"aspirate_position": {
242-
"offset": {"x": 1, "y": 2, "z": 3},
243-
"position_reference": "well-bottom",
244-
}
252+
# examples of required properties in a dictionary for your pipette and tip racks
253+
custom_liquid_class_properties = {
254+
"flex_1channel_50": {
255+
"opentrons/opentrons_flex_96_tiprack_50ul/1": {
256+
"aspirate": {
257+
"aspirate_position": {
258+
"offset": {"x": 1, "y": 2, "z": 3},
259+
"position_reference": "well-bottom",
260+
},
261+
},
262+
},
263+
}
245264
246-
# create a new liquid class
247-
custom_viscous = protocol_context.define_liquid_class(
248-
name="custom_viscous",
249-
properties=custom_liquid_class_properties,
250-
display_name="Custom Viscous",
251-
)
265+
# create a new liquid class
266+
custom_viscous = protocol.define_liquid_class(
267+
name="custom_viscous",
268+
properties=custom_liquid_class_properties,
269+
display_name="Custom Viscous"
270+
)
252271
272+
.. versionadded:: 2.24
253273
254-
The example above only includes aspirate position properties. To create your liquid class, you'll need to define values for `required properties <https://github.com/Opentrons/opentrons/blob/edge/shared-data/liquid-class/schemas/1.json>` like submerging before aspirating or after dispensing, speeds and flow rates, and position offsets.
274+
The example above is shortened and only includes aspirate position properties. To create your liquid class, you'll need to define values for all `required properties <https://github.com/Opentrons/opentrons/blob/edge/shared-data/liquid-class/schemas/1.json>` in your new liquid class, like submerging before aspirating or after dispensing, speeds and flow rates, and position offsets.
255275
256276
.. note::
257277
258-
The :py:meth:`.InstrumentContext.get_liquid_class` method only accepts Opentrons-verified liquid classes, like ``glycerol_50``. You'll need to use :py:meth:`.InstrumentContext.define_liquid_class` in each Flex protocol that uses a custom liquid class.
278+
The :py:meth:`.ProtocolContext.get_liquid_class` method only accepts Opentrons-verified liquid classes, like ``glycerol_50``. You'll need to use :py:meth:`.ProtocolContext.define_liquid_class` in each Flex protocol that uses a custom liquid class.

api/docs/v2/new_examples.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ This protocol uses some :ref:`building block commands <v2-atomic-commands>` to t
193193
Advanced Method
194194
---------------
195195

196-
These protocols accomplishes the same thing as the previous example, but does it a little more efficiently. Notice how it uses the :py:meth:`.InstrumentContext.transfer` or :py:meth:`InstrumentContext.transfer_with_liquid_class` method to move liquid between well plates. Because each is a complex command, you don't need separate calls to ``aspirate`` or ``dispense`` here.
196+
These protocols accomplishes the same thing as the previous example, but does it a little more efficiently. Notice how it uses the :py:meth:`.InstrumentContext.transfer` or :py:meth:`.InstrumentContext.transfer_with_liquid_class` method to move liquid between well plates. Because each is a complex command, you don't need separate calls to ``aspirate`` or ``dispense`` here.
197197

198198
Let's start with a basic complex command, using ``transfer()``. The source and destination well arguments (e.g., ``plate["A1"], plate["B1"]``) are part of ``transfer()`` method parameters.
199199

api/src/opentrons/protocol_api/instrument_context.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1837,7 +1837,6 @@ def transfer_with_liquid_class(
18371837
``False``, the last tip will be dropped or returned. If not set, behavior depends on the value of
18381838
``new_tip``. ``new_tip="never"`` keeps the tip, and all other values of ``new_tip`` drop or return the tip.
18391839
1840-
:meta private:
18411840
"""
18421841
if volume == 0.0:
18431842
_log.info(
@@ -1966,7 +1965,6 @@ def distribute_with_liquid_class(
19661965
``False``, the last tip will be dropped or returned. If not set, behavior depends on the value of
19671966
``new_tip``. ``new_tip="never"`` keeps the tip, and all other values of ``new_tip`` drop or return the tip.
19681967
1969-
:meta private:
19701968
"""
19711969
if volume == 0.0:
19721970
_log.info(
@@ -2104,7 +2102,6 @@ def consolidate_with_liquid_class(
21042102
``False``, the last tip will be dropped or returned. If not set, behavior depends on the value of
21052103
``new_tip``. ``new_tip="never"`` keeps the tip, and all other values of ``new_tip`` drop or return the tip.
21062104
2107-
:meta private:
21082105
"""
21092106
if volume == 0.0:
21102107
_log.info(

0 commit comments

Comments
 (0)