skills/opentrons-integration/references/liquid_handling.md
Choose commands from the physical behavior the assay needs, not from which call is shortest to write. Every command still depends on correct liquid volumes, labware geometry, pipette range, tips, and contamination controls.
Use when aspiration and dispensing need independent control:
pipette.pick_up_tip()
pipette.aspirate(50, source.bottom(z=1), flow_rate=25)
protocol.delay(seconds=1)
pipette.dispense(50, destination.bottom(z=2), flow_rate=20, push_out=5)
pipette.blow_out(destination.top(z=-1))
pipette.drop_tip()
Advantages:
Costs:
Use for conventional source-to-destination mappings:
pipette.transfer(
volume=50,
source=source_plate.wells()[:8],
dest=destination_plate.wells()[:8],
new_tip="always",
mix_after=(3, 30),
)
transfer(): one or more source-to-destination transfers.distribute(): one source to many destinations, normally with an excess
disposal volume.consolidate(): many sources into one destination.Inspect the simulation run log. Complex commands expand into many building blocks, and their expansion changes with parameters and API level.
Use an Opentrons-verified class when the pipette/tip combination is supported and the liquid resembles the verified model:
viscous = protocol.get_liquid_class("glycerol_50")
pipette.transfer_with_liquid_class(
liquid_class=viscous,
volume=50,
source=reservoir["A1"],
dest=plate["A1"],
new_tip="always",
trash_location=trash,
)
Related methods:
distribute_with_liquid_class()consolidate_with_liquid_class()Verified classes include water, 80% ethanol, and 50% glycerol. A liquid class controls multiple coupled properties such as flow rate, submerge and retract behavior, delays, air gaps, positions, and push-out. Do not casually override one property without testing the full result.
Opentrons-verified liquid classes are for supported Flex pipette and tip combinations, not OT-2 pipettes.
Complex commands accept a single well or a sequence. Make the intended mapping explicit:
Do not assume row-major ordering:
# Explicit sample order is easier to audit.
sample_wells = [plate[name] for name in ("A1", "B1", "C1", "D1")]
For multi-channel pipettes, the referenced well anchors the pipette's primary channel:
new_tip is a contamination decision.
| Policy | Typical use | Primary risk |
|---|---|---|
"always" | Independent samples, controls, or source-destination pairs | Higher tip consumption |
"once" | Reagent distribution within one contamination domain | Returning a contaminated tip to a shared source |
"never" | Explicit surrounding pick_up_tip() and drop_tip() | Hidden or invalid tip state |
For a shared reagent:
Calculate tips for every conditional path. Multi-channel operations consume sets, not individual command calls.
rate= multiplies the configured flow rate:
pipette.aspirate(50, source, rate=0.5)
Supported modern APIs also accept absolute flow-rate arguments:
pipette.aspirate(50, source, flow_rate=25)
Use one form per action. Absolute units are µL/s. Establish values through liquid-specific testing rather than copying another pipette's settings.
source.bottom(z=1)
source.top(z=-2)
destination.center()
touch_tip() can be unsafe in large wells and reservoirs; API 2.28+ rejects
certain large-space uses.Air gaps can reduce dripping but occupy pipette capacity:
pipette.aspirate(80, source)
pipette.air_gap(10)
pipette.dispense(90, destination)
The total liquid plus air must fit the pipette. Use push_out to move the
plunger a small extra amount after dispensing:
pipette.dispense(80, destination, push_out=5)
Use blowout for a larger purge. Avoid blowing into liquid when aerosols, bubbles, or cross-contamination matter.
Standard mixing:
pipette.mix(
repetitions=5,
volume=40,
location=plate["A1"].bottom(z=1),
aspirate_flow_rate=20,
dispense_flow_rate=30,
final_push_out=5,
)
Choose a mix volume below the available liquid volume and pipette maximum. Account for pellets, beads, cells, foaming, and plate seals.
API 2.27 adds dynamic mixing:
well = plate["A1"]
pipette.dynamic_mix(
aspirate_start_location=well.bottom(z=1),
aspirate_end_location=well.bottom(z=4),
dispense_start_location=well.bottom(z=4),
dispense_end_location=well.bottom(z=1),
repetitions=3,
volume=50,
)
Dynamic movement is geometry-sensitive. Simulate, inspect the path, and dry-run with the exact labware before using it on samples.
API 2.27 can move between two locations during one plunger action:
pipette.aspirate(
volume=100,
location=well.bottom(z=1),
end_location=well.bottom(z=5),
movement_delay=1,
)
This can follow a changing meniscus or sweep through a liquid column. It does not automatically prove that the declared liquid volume or geometry is correct.
Declare setup volumes with labware-level methods:
buffer = protocol.define_liquid(
name="Buffer",
description="Assay buffer",
display_color="#1F77B4",
)
reservoir.load_liquid(
wells=["A1"],
volume=12_000,
liquid=buffer,
)
API 2.23 adds well.meniscus():
start_surface = reservoir["A1"].meniscus(z=-1, target="start")
end_surface = reservoir["A1"].meniscus(z=-1, target="end")
The calculated surface depends on liquid volume and labware geometry. With
dynamic aspiration or dispensing, target="start" and target="end" can
represent the expected surface at either end of the operation.
Do not rely on meniscus targeting until declared volumes, well geometry, and liquid-level behavior have been checked on the robot.
Flex pressure sensors support three explicit operations:
present = pipette.detect_liquid_presence(reservoir["A1"])
pipette.require_liquid_presence(reservoir["A1"])
height = pipette.measure_liquid_height(reservoir["A1"])
Or enable a check before every aspiration:
pipette = protocol.load_instrument(
"flex_1channel_1000",
"left",
tip_racks=[tips],
liquid_presence_detection=True,
)
Operational constraints:
Use explicit checks at critical sources when global detection would add too much time.
Supported layouts:
| Pipette | Layout | Minimum API |
|---|---|---|
| Flex 96-channel | column | 2.16 |
| Flex 96-channel | row, single | 2.20 |
| Flex 8-channel | single, partial column | 2.20 |
| OT-2 multi-channel | single, partial column | 2.20 |
from opentrons.protocol_api import ALL, COLUMN
pipette.configure_nozzle_layout(
style=COLUMN,
start="A12",
tip_racks=[partial_rack],
)
# Partial-column operations...
pipette.configure_nozzle_layout(
style=ALL,
tip_racks=[full_rack],
)
Critical rules:
configure_nozzle_layout() resets pipette.tip_racks.See the official Partial Tip Pickup guide for layout-specific target-well rules.
For a full 96-well plate and an 8-channel pipette:
Referencing A-row wells addresses full columns:
pipette.transfer(
100,
source=plate.rows()[0][0:11],
dest=plate.rows()[0][1:12],
mix_after=(3, 50),
new_tip="always",
)
Verify that the tip budget covers 11 serial steps plus diluent addition and final-volume removal.