Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(api): liquid meniscus in API 2.23 #17971

Open
wants to merge 5 commits into
base: chore_release-8.4.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions api/docs/v2/basic_commands/liquids.rst
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,19 @@ You can also aspirate from a location along the center vertical axis within a we
depth = plate["A1"].bottom(z=2) # tip is 2 mm above well bottom
pipette.aspirate(200, depth)


Use the :py:meth:`~.Labware.Well.mensicus` method to aspirate from the meniscus of liquid in a well with a Flex pipette. First, you'll need to define the volume of liquid in your well:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"relative to the meniscus"? "from" sounds like the exact location of the meniscus (which is not the usual behavior).

- Specify your starting liquid volume with :py:meth:`~.Labware.load_liquid`, or
- Use :py:meth:`~.InstrumentContext.measure_liquid_height` to define liquid height in a well before aspirating, or earlier in the protocol.

pipette.pick_up_tip()
pipette.measure_liquid_height(plate["A2"])
pipette.aspirate(200, location=plate["A2"].meniscus(target="end", z=-1)) # aspirates at 1 mm below the liquid meniscus

The liquid meniscus changes when you aspirate liquid from a well. Set ``target`` to the ending position of the liquid within a well to ensure the pipette stays submerged while aspirating. For more information, see :ref:`well-meniscus`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We'll sometimes shorten things by putting the parameter and value together in running text:

Suggested change
The liquid meniscus changes when you aspirate liquid from a well. Set ``target`` to the ending position of the liquid within a well to ensure the pipette stays submerged while aspirating. For more information, see :ref:`well-meniscus`.
The liquid meniscus changes when you aspirate liquid from a well. Set ``target=end`` to ensure the pipette stays submerged while aspirating. For more information, see :ref:`well-meniscus`.


.. versionadded:: 2.23

See also:

- :ref:`new-default-op-positions` for information about controlling pipette height for a particular pipette.
Expand Down Expand Up @@ -105,6 +118,18 @@ You can also dispense from a location along the center vertical axis within a we
depth = plate["B1"].bottom(z=2) # tip is 2 mm above well bottom
pipette.dispense(200, depth)


Use the :py:meth:`~.Labware.Well.Meniscus` method to dispense at the meniscus of liquid in your well with a Flex pipette. First, you'll need to define the volume of liquid in your well:
- Specify your starting liquid volume with :py:meth:`~.Labware.load_liquid`, or
- Use :py:meth:`~.InstrumentContext.measure_liquid_height` to define liquid height in a well before aspirating, or earlier in the protocol.

pipette.measure_liquid_height(plate["B1"])
pipette.dispense(200, location=plate["B1"].meniscus(target="start", z=-1)) #dispenses 1 mm below the liquid meniscus

The liquid meniscus changes when you dispense liquid into a well. Set ``target`` to the starting position of the liquid within a well to ensure the pipette begins the dispense at the liquid meniscus. For more information, see :ref:`well-meniscus`.

.. versionadded:: 2.23

See also:

- :ref:`new-default-op-positions` for information about controlling pipette height for a particular pipette.
Expand Down Expand Up @@ -323,3 +348,18 @@ The :py:meth:`.InstrumentContext.require_liquid_presence` method tells a Flex pi
You can also require liquid presence for all aspirations performed with a given pipette. See :ref:`lpd`.

.. versionadded:: 2.20

Measure Liquids
===============

The :py:meth:`~.InstrumentContext.measure_liquid_height` method tells a Flex pipette to measure the height of liquid relative to the bottom of a well. When ``measure_liquid_height()`` finds an empty well, it raises and error and pauses the protocol to let you resove the problem.

``measure_liquid_height`` is a standalone method that records the height of liquid in a well during a protocol. You can use the liquid height to aspirate or dispense from, or move to, the liquid meniscus, either immediately after or later in your protocol.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

measure_liquid_height() with parentheses 🐍 🧐


.. code-block:: python

pipette.pick_up_tip()
pipette.measure_liquid_height(plate["A1"])
pipette.aspirate(200, location=plate["A1"].meniscus(target="end", z=-1)) #aspirates from 1 mm below the liquid meniscus

You don't have to aspirate after measuring liquid height, but you should always pick up a tip immediately prior to measuring the liquid height, and either aspirate or drop the tip immediately after. This ensures that the pipette uses a clean, dry tip to check for liquid, and prevents cross-contamination.
2 changes: 1 addition & 1 deletion api/docs/v2/pipettes/loading.rst
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ Let's take a look at how all this works. With automatic liquid detection enabled

Liquid detection takes place prior to aspiration. Upon detecting a liquid, the pipette stops, raises itself above the liquid's surface, and then aspirates according to your protocol. Checking for a liquid adds time to your protocol run, so be aware of that before using it. If Flex doesn't detect liquid, it raises an error and stops the protocol until the problem is resolved.

However, aspiration isn't required for liquid level detection. Two standalone methods, :py:meth:`.detect_liquid_presence` and :py:meth:`.require_liquid_presence`, let you add liquid detection to a protocol with or without aspirating. Automatic detection is the same as calling ``require_liquid_presence()`` before every aspiration. See :ref:`detect-liquid-presence` and :ref:`require-liquid-presence` for details.
However, aspiration isn't required for liquid level detection. Three standalone methods, :py:meth:`.detect_liquid_presence`, :py:meth:`.require_liquid_presence`, and :py:meth:`.measure_liquid_height`, let you add liquid detection to a protocol with or without aspirating. Automatic detection is the same as calling ``require_liquid_presence()`` before every aspiration. See :ref:`detect-liquid-presence` and :ref:`require-liquid-presence` for details.

.. versionadded:: 2.20

Expand Down
48 changes: 43 additions & 5 deletions api/docs/v2/robot_position.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,12 @@ Position Relative to Labware

When the robot positions itself relative to a piece of labware, where it moves is determined by the labware definition, the actions you want it to perform, and the labware offsets for a specific deck slot. This section describes how these positional components are calculated and how to change them.

Top, Bottom, and Center
-----------------------
Top, Bottom, Center, and Meniscus
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Getting kinda long. Maybe we can call this section "Well positions" now.

---------------------------------

Every well on every piece of labware has three addressable positions: top, bottom, and center. The position is determined by the labware definition and what the labware is loaded on top of. You can use these positions as-is or calculate other positions relative to them.
Every well on every piece of labware has four addressable positions: top, bottom, center, and meniscus.

The top, bottom, and center positions are determined by the labware definition and what the labware is loaded on top of. The meniscus position is determined by the height of the liquid inside a well. You can use these positions as-is or calculate other positions relative to them.

.. _well-top:

Expand Down Expand Up @@ -79,13 +81,37 @@ Let's look at the :py:meth:`.Well.center` method. It returns a position centered

.. versionadded:: 2.0

.. _well-meniscus:

Meniscus
^^^^^^^^

Let's look at the :py:meth:`~.Labware.well-meniscus` method. It returns a position at the surface of liquid, or meniscus, inside a well. Like the `.Well.top` and `.Well.bottom` methods, you can adjust the height of the meniscus with the optional argument ``z``, which is measured in mm. Positive numbers move the position up, negative ``z`` numbers move it down.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Let's look at the :py:meth:`~.Labware.well-meniscus` method. It returns a position at the surface of liquid, or meniscus, inside a well. Like the `.Well.top` and `.Well.bottom` methods, you can adjust the height of the meniscus with the optional argument ``z``, which is measured in mm. Positive numbers move the position up, negative ``z`` numbers move it down.
Let's look at the :py:meth:`~.Labware.well-meniscus` method. It returns a position at the surface of liquid, or meniscus, inside a well. Like the `.Well.top` and `.Well.bottom` methods, you can adjust the height of the meniscus with the optional argument ``z``, which is measured in mm. Positive ``z`` values move the position up, and negative ones move it down.


.. code-block:: python

plate["A1"].meniscus(target= "end", z=-1) # 1 mm below the meniscus of liquid inside the well


The liquid meniscus in a well changes during aspirating or dispensing, so you'll also need to specify a ``target`` position for the pipette:
- Set ``target= "end"`` to ensure the pipette stays submerged while aspirating.
- Set ``target= "start"`` or ``end`` to choose where the pipette begins dispensing.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

might be useful to split these out and describe how they would create a contact or non-contact dispense.


.. note::
To use the :py:meth: `~.Labware.well-meniscus` method, you'll first need to determine the volume of liquid inside the well. You can do this at any time in your protocol by:
- Specifying your starting liquid volume with :py:meth:`~.Labware.load_liquid`, or
- Using :py:meth:`~.InstrumentContext.measure_liquid_height` to define liquid volume in the well.

Detecting liquid in a well requires pipette sensors, so you can only measure liquid height with a Flex pipette.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think this should also be inside the note (indented)


.. versionadded:: 2.23

.. _new-default-op-positions:

Default Positions
-----------------

By default, your robot will aspirate and dispense 1 mm above the bottom of wells. This default clearance may not be suitable for some labware geometries, liquids, or protocols. You can change this value by using the :py:meth:`.Well.bottom` method with the ``z`` argument, though it can be cumbersome to do so repeatedly.
By default, your robot will aspirate and dispense 1 mm above the bottom of wells. This default clearance may not be suitable for some labware geometries, liquids, or protocols. You can change this value based on your labware with the :py:meth:`.Well.bottom` method and the ``z`` argument, though it can be cumbersome to do so repeatedly.

If you need to change the aspiration or dispensing height for multiple operations, specify the distance in mm from the well bottom with the :py:obj:`.InstrumentContext.well_bottom_clearance` object. It has two attributes: ``well_bottom_clearance.aspirate`` and ``well_bottom_clearance.dispense``. These change the aspiration height and dispense height, respectively.

Expand All @@ -111,6 +137,18 @@ Modifying these attributes will affect all subsequent aspirate and dispense acti

.. versionadded:: 2.0

Alternatively, use the :py:meth:`~.Labware.well-meniscus` method with a Flex pipette to change the aspiration or dispensing height. First, you'll need to define the amount of liquid in your well, either by loading a volume of liquid in your protocol or using :py:meth:`~.InstrumentContext.measure_liquid_height`.

.. code-block:: python

pipette.pick_up_tip()
pipette.measure_liquid_height(plate["A1"])
pipette.aspirate(100, location=plate["A1"].meniscus(target= "end", z=-2)) # aspirates 2 mm below the liquid meniscus

Because the liquid meniscus changes throughout a protocol, you'll need to specify the meniscus as the location for each aspirate and dispense.

.. versionadded:: 2.23

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe add a Flex vs OT-2 sentence here if applicable.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we need this section here — as you say, you need to specify meniscus-relative every time, and this section is about what happens if you don't specify a location.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree. I was reading this as "well, this is one way you can change aspiration and dispensing height, here's another" but it's really "here's a way to change that height for many aspirations and dispenses, basically like changing the default" of which meniscus-relative pipetting is not that.

Using Labware Position Check
============================

Expand Down Expand Up @@ -169,7 +207,7 @@ Move To

The :py:meth:`.InstrumentContext.move_to` method moves a pipette to any reachable location on the deck. If the pipette has picked up a tip, it will move the end of the tip to that position; if it hasn't, it will move the pipette nozzle to that position.

The :py:meth:`~.InstrumentContext.move_to` method requires the :py:class:`.Location` argument. The location can be automatically generated by methods like ``Well.top()`` and ``Well.bottom()`` or one you've created yourself, but you can't move a pipette to a well directly:
The :py:meth:`~.InstrumentContext.move_to` method requires the :py:class:`.Location` argument. The location can be automatically generated by methods like ``Well.top()``, ``Well.bottom()``, and ``Well.mensicus``, or one you've created yourself. However, you can't move a pipette to a well directly:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

parens again

Suggested change
The :py:meth:`~.InstrumentContext.move_to` method requires the :py:class:`.Location` argument. The location can be automatically generated by methods like ``Well.top()``, ``Well.bottom()``, and ``Well.mensicus``, or one you've created yourself. However, you can't move a pipette to a well directly:
The :py:meth:`~.InstrumentContext.move_to` method requires the :py:class:`.Location` argument. The location can be automatically generated by methods like ``Well.top()``, ``Well.bottom()``, and ``Well.mensicus()``, or one you've created yourself. However, you can't move a pipette to a well directly:


.. code-block:: python

Expand Down
1 change: 0 additions & 1 deletion api/src/opentrons/protocol_api/instrument_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -2523,7 +2523,6 @@ def measure_liquid_height(self, well: labware.Well) -> LiquidTrackingType:

:returns: The height, in mm, of the liquid from the deck.

:meta private:

This is intended for Opentrons internal use only and is not a guaranteed API.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Becoming public now, so this line should be removed.

"""
Expand Down
1 change: 0 additions & 1 deletion api/src/opentrons/protocol_api/labware.py
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,6 @@ def meniscus(
:param target: The relative position inside the well to target when performing a liquid handling operation.
:return: A :py:class:`~opentrons.types.Location` that indicates location is meniscus and that holds the ``z`` offset in its point.z field.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These need some improvement, either in this PR or separately.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated this today. Started to document start and end more, but remembered that we want to hold off on mentions of dynamic. Can ticket beefing this reference up for API 2.24 docs.

Other than that, roughly followed the structure of the other well position API refs.


:meta private:
"""
return Location(
point=Point(x=0, y=0, z=z),
Expand Down
Loading