Skip to content

Commit a3259a1

Browse files
docs(api): re-add creating a liquid class (#19000)
<!-- Thanks for taking the time to open a Pull Request (PR)! Please make sure you've read the "Opening Pull Requests" section of our Contributing Guide: https://github.com/Opentrons/opentrons/blob/edge/CONTRIBUTING.md#opening-pull-requests GitHub provides robust markdown to format your PR. Links, diagrams, pictures, and videos along with text formatting make it possible to create a rich and informative PR. For more information on GitHub markdown, see: https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax To ensure your code is reviewed quickly and thoroughly, please fill out the sections below to the best of your ability! --> # Overview adding back our defining/creating liquid class sections to the API docs for the 8.5.1 release. this text was taken out ~ a week ago because of a multi-dispense bug with custom liquid class definitions. this text also includes some changes to clarify _how_ to customize a liquid class, including a full dictionary example for users creating a liquid class definition from scratch. <!-- Describe your PR at a high level. State acceptance criteria and how this PR fits into other work. Link issues, PRs, and other relevant resources. --> ## Test Plan and Hands on Testing <!-- Describe your testing of the PR. Emphasize testing not reflected in the code. Attach protocols, logs, screenshots and any other assets that support your testing. --> sandbox: http://sandbox.docs.opentrons.com/docs-creating-liquid-class/v2/ ## Changelog <!-- List changes introduced by this PR considering future developers and the end user. Give careful thought and clear documentation to breaking changes. --> ## Review requests <!-- - What do you need from reviewers to feel confident this PR is ready to merge? - Ask questions. --> triple check dictionary example. ## Risk assessment <!-- - Indicate the level of attention this PR needs. - Provide context to guide reviewers. - Discuss trade-offs, coupling, and side effects. - Look for the possibility, even if you think it's small, that your change may affect some other part of the system. - For instance, changing return tip behavior may also change the behavior of labware calibration. - How do your unit tests and on hands on testing mitigate this PR's risks and the risk of future regressions? - Especially in high risk PRs, explain how you know your testing is enough. --> low- adding in text that was previously in API docs.
1 parent cff1817 commit a3259a1

File tree

4 files changed

+137
-3
lines changed

4 files changed

+137
-3
lines changed

api/docs/v2/complex_commands/parameters.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ If this poses a contamination risk, you can work around it in a few ways:
9494

9595
* Use ``transfer()`` or ``transfer_with_liquid_class()`` with ``new_tip="always"`` instead.
9696
* Set :py:obj:`.well_bottom_clearance` high enough that the tip doesn't contact liquid in the destination well.
97+
* :ref:`Customize your liquid class <customizing-liquid-classes>` to change dispense heights or add touch tip behavior.
9798
* Use :ref:`building block commands <v2-atomic-commands>` instead of complex commands.
9899

99100

api/docs/v2/liquid_class_definitions.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,12 @@ A *liquid class definition* specifies nearly all transfer behavior a Flex pipett
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

13+
.. note::
14+
15+
You can customize a liquid class definition for your workflow, either by customizing individual properties of an Opentrons-verified liquid class definition or by creating your own definition from scratch.
16+
17+
For more information, see :ref:`customizing-liquid-classes`.
18+
1319
To use the tables below, select your liquid class: :ref:`aqueous`, :ref:`viscous`, or :ref:`volatile`. Then, click different tabs to view your pipette and tip combination.
1420

1521
In a liquid class transfer, flow rates and air gap or push out volumes vary based on the pipette and tip combination used in your protocol. Let's say you use a Flex P1000 1-channel pipette and Flex 200 µL tips to aspirate a volatile liquid. The transfer volume specifies the flow rate:

api/docs/v2/liquid_classes.rst

Lines changed: 129 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Liquid Classes
88

99
Accounting for properties of liquids in your protocol can increase pipetting accuracy on the Flex. For example, a slower flow rate can improve pipetting for a viscous liquid, and an air gap can prevent a volatile liquid from dripping onto the deck.
1010

11-
This page covers the properties of Opentrons-verified liquid classes and how to use them in your protocols.
11+
This page covers the properties of Opentrons-verified liquid classes, how to use a verified liquid class in your protocol, and how to customize a liquid class.
1212

1313

1414
.. _opentrons-verified-liquid-classes:
@@ -190,15 +190,15 @@ Here, the ``glycerol_50`` viscous liquid class definition accounts for all other
190190

191191
* Moves to 2 mm above the top of the source well at 4 mm/sec.
192192
* Submerges to 2 mm above the bottom of the source well at 4mm/sec.
193-
* Aspirates 50 µL at 50 µL/sec with a correction of -0.2 µL.
193+
* Aspirates 50 µL at 50 µL/sec with a volume correction.
194194
* Delays for 1 second.
195195
* Retracts to 2 mm above the top of the well at 4 mm/sec.
196196

197197
And for each dispense, the pipette:
198198

199199
* Moves to 2 mm above the top of the destination well at 4 mm/sec.
200200
* Submerges to 2 mm above the top of the destination well at 4 mm/sec.
201-
* Dispenses 50 µL at 25 µL/sec with a correction of -0.2 µL.
201+
* Dispenses 50 µL at 25 µL/sec with a volume correction.
202202
* Pushes out a volume of air equivalent to 3.9 µL
203203
* Delays for 0.5 second.
204204
* Retracts to 2 mm above the top of the well at 4 mm/sec.
@@ -212,4 +212,130 @@ In many cases, the liquid class definition represents fine-tuned changes optimiz
212212

213213
Not all transfer behavior is easily visible. See :ref:`liquid-class-definitions` for a full list of changes based on liquid class, pipette, and tip combination. For more detail on individual transfer settings, see :ref:`liquid-control`.
214214

215+
.. _customizing-liquid-classes:
216+
217+
Customizing Liquid Classes
218+
===========================
219+
220+
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.
221+
222+
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::
223+
224+
custom_water = protocol.get_liquid_class(name="water")
225+
custom_water_properties=custom_water.get_for(pipette, tiprack)
226+
227+
.. versionadded:: 2.24
228+
229+
Next, edit indivual liquid class properties based on your Flex pipette and tip combination.
230+
231+
.. code-block:: python
232+
233+
# edit aspirate submerge speed to 80 μL/sec
234+
custom_water_properties.aspirate.submerge.speed = 80
235+
# edit aspirate flow rate by volume for 10 μL and 20 μL volumes
236+
custom_water_properties.aspirate.flow_rate_by_volume.set_for_volume = [(10.0, 40.0)
237+
custom_water_properties.aspirate.flow_rate_by_volume.set_for_volume = [(20.0, 30.0)]
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
241+
242+
.. versionadded:: 2.24
243+
244+
Then, complete your transfers with the modified ``custom_water`` liquid class.
245+
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.
247+
248+
.. _new-liquid-classes:
249+
250+
Defining New Liquid Classes
251+
============================
252+
253+
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 in your liquid class.
254+
255+
.. code-block:: python
256+
257+
custom_liquid_class_properties = {
258+
"p20_single_gen2": {
259+
"opentrons/opentrons_96_tiprack_20ul/1": {
260+
"aspirate": {
261+
"aspirate_position": {
262+
"offset": {"x": 1, "y": 2, "z": 3},
263+
"position_reference": "well-bottom",
264+
},
265+
"correction_by_volume": [(0.0, 0.0)],
266+
"delay": {"enabled": False},
267+
"flow_rate_by_volume": [(10.0, 40.0), (20.0, 30.0)],
268+
"mix": {"enabled": False},
269+
"pre_wet": True,
270+
"retract": {
271+
"air_gap_by_volume": [(5.0, 3.0), (10.0, 4.0)],
272+
"delay": {"enabled": False},
273+
"end_position": {
274+
"offset": {"x": 1, "y": 2, "z": 3},
275+
"position_reference": "well-bottom",
276+
},
277+
"speed": 40,
278+
"touch_tip": {"enabled": False},
279+
},
280+
"submerge": {
281+
"delay": {"enabled": False},
282+
"speed": 100,
283+
"start_position": {
284+
"offset": {"x": 1, "y": 2, "z": 3},
285+
"position_reference": "well-bottom",
286+
},
287+
},
288+
},
289+
"dispense": {
290+
"correction_by_volume": [(0.0, 0.0)],
291+
"delay": {"enabled": False},
292+
"dispense_position": {
293+
"offset": {"x": 1, "y": 2, "z": 3},
294+
"position_reference": "well-bottom",
295+
},
296+
"flow_rate_by_volume": [(10.0, 40.0), (20.0, 30.0)],
297+
"mix": {"enabled": False},
298+
"push_out_by_volume": [(10.0, 7.0), (20.0, 10.0)],
299+
"retract": {
300+
"air_gap_by_volume": [(5.0, 3.0), (10.0, 4.0)],
301+
"blowout": {"enabled": False},
302+
"delay": {"enabled": False},
303+
"end_position": {
304+
"offset": {"x": 1, "y": 2, "z": 3},
305+
"position_reference": "well-bottom",
306+
},
307+
"speed": 40,
308+
"touch_tip": {"enabled": False},
309+
},
310+
"submerge": {
311+
"delay": {"enabled": False},
312+
"speed": 100,
313+
"start_position": {
314+
"offset": {"x": 1, "y": 2, "z": 3},
315+
"position_reference": "well-bottom",
316+
},
317+
},
318+
},
319+
}
320+
}
321+
}
322+
323+
Then, use the defined properties and :py:meth:`~.ProtocolContext.define_liquid_class` to create your new liquid class::
324+
325+
# create a new liquid class
326+
custom_viscous = protocol.define_liquid_class(
327+
name="custom_viscous",
328+
properties=custom_liquid_class_properties,
329+
display_name="Custom Viscous"
330+
)
331+
332+
.. versionadded:: 2.24
333+
334+
You'll need to define values for all required properties in your new liquid class, like submerging before aspirating or after dispensing, speeds and flow rates, and position offsets. See the Opentrons-verified `liquid class properties <https://github.com/Opentrons/opentrons/tree/edge/shared-data/liquid-class/definitions/1>`__ for examples.
335+
336+
You can also define optional properties, like a mix or blowout, in your liquid class. See `the liquid class schema <https://github.com/Opentrons/opentrons/blob/edge/shared-data/liquid-class/schemas/1.json>`__ for a complete list of properties.
337+
338+
.. note::
339+
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.
340+
215341

api/docs/v2/versioning.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@ Version 2.24
147147
- Adds the ability to perform liquid handling actions using :ref:`liquid classes <liquid-classes>`.
148148

149149
- :py:meth:`.ProtocolContext.get_liquid_class` accesses :ref:`Opentrons-verified liquid class definitions <liquid-class-definitions>` for aqueous, volatile, and viscous liquids.
150+
- :py:meth:`.ProtocolContext.define_liquid_class` lets you create your own liquid classes from verified classes or from scratch.
150151
- New :py:class:`.InstrumentContext` methods — :py:meth:`.transfer_with_liquid_class`, :py:meth:`.distribute_with_liquid_class`, and :py:meth:`.consolidate_with_liquid_class` — move liquids according to their properties.
151152
- :py:meth:`.air_gap`, :py:meth:`.blow_out`, :py:meth:`.dispense`, :py:meth:`.mix`, and :py:meth:`.touch_tip` have new parameters for advanced settings that are also available in Protocol Designer.
152153

0 commit comments

Comments
 (0)