Labware Flow
Overview
This section covers the management of labware from initialization through tasks in a workflow as well as the assignment of labware to specific slots and instruments.
Starting conditions
All labware for a workflow must start somewhere before it begins traveling from task to task. Define these start conditions with the initial labware definition:
microplate = Labware(
id="sample_microplate",
labware_type=LabwareType(id="microplate_96"),
starting_location=LabwareLocation(
instrument=hotel,
slot=10
)
)
- class linq.workflow.Labware(*, id: str, labware_type: LabwareType, starting_instrument: Instrument | None = None, starting_slot: int | None = None, starting_location: LabwareLocation | list[LabwareLocation] | None = None, total_units: int = 1, batch: int | None = None, description: str | None = None, barcode: str | None = None)
A single piece of labware.
- id: str
Unique ID of this piece of labware.
- labware_type: LabwareType
Labware type.
- starting_instrument: Instrument | None
DEPRECATED, will be removed in February 2025 release
- starting_slot: int | None
DEPRECATED, will be removed in February 2025 release
- starting_location: LabwareLocation | list[LabwareLocation] | None
Location the labware is located in at the start of the workflow. Can be a single location or a list of locations. Option for None is to support deprecated starting_instrument and starting_slot. The field will not be optional in the next release.
- total_units: int
The number of consumable ‘units’ in a single piece of labware. Does not affect the workflow if ‘units_consumed’ is not defined on any tasks.
- batch: int | None
The batch that this labware belongs to. Leave as None for auto-assignment
- description: str | None
Description.
- barcode: str | None
Barcode (or None if labware has no barcode).
To start labware elsewhere (e.g. with an operator) see Operator Intervention
Slots
Instruments are configured with a capacity which dictates how much labware can occupy the instrument at a given time.
Specify the slot for a robot to load the labware into with the labware_sources
field of an ActionTask
. You can additionally specify the output slots with labware_outputs
- useful in the case labware moves within an instrument (typical in liquid handlers.)
Note
If slot is not specified, it defaults to 1
.
Note
If output is not specified, it defaults to mirroring inputs.
centrifuge_tubes = ActionTask(
id="centrifuge_tubes",
description="Centrifuge tubes",
instrument_type=centrifuge.type,
action="centrifuge",
time_estimate=60,
labware_sources=[
unload_tubes_from_hotel.forward(
labware=tubes,
destination_slot=1,
)
],
)
The above task specifies that the labware tubes
should be taken from the unload_tubes_from_hotel
task and placed in slot one of the centrifuge. It also implicitly specifies that the tubes
will be available at slot one once the task is complete.
Instruments with open, accessible decks have a number of slots matching the reachable positions on the deck. For example, a liquid handler with 3 reachable labware positions at the front will have three slots 1, 2, 3
.
Users may also want to define slotless instruments (for example an open bin), in which case the instrument can be given the is_slotless_container
property.
- class linq.task.LabwareSource(labware: Labware, destination_slot: int | SlotFillingRule = 1, source_task: ActionTask | ConditionalSourceTask | None = None, dependencies: list[ActionTask | CodeTask | Conditional] = ..., units_consumed: int | None = None)
Specifies the labware required for a task.
- destination_slot: int | SlotFillingRule
The instrument slot where the labware will be placed, or the rule for filling slots with labware (batching)
- source_task: ActionTask | ConditionalSourceTask | None
ID of the task the labware is being transported from. None for tasks retrieving labware from their initial instrument.
- dependencies: list[ActionTask | CodeTask | Conditional]
Additional tasks that have to be completed before the labware for the task is retrieved.
- units_consumed: int | None
The number of units of the labware that are consumed in the task. Tied to the total_units of the labware. Leave blank for no units to be consumed.
Parking Bays and Stored Labware
Slot 0
is reserved for instruments with a parking bay, which is always the same position in space from which all labware enters and exits an instrument. A typical example is a plate hotel.
Unloading labware from the instrument.
slot = 10 # slot is variable and maps to a slot in the instrument
labware = Labware(...)
ActionTask(
...,
static_arguments={"slot": slot},
labware_sources=[
StoredLabware(labware, slot=slot)
],
labware_outputs=[
LabwareOutput(
labware=labware,
slot=0, # slot 0 is the special unloading slot
)
],
)
Loading labware into the instrument
slot = 10 # slot is variable and maps to a slot in the instrument
labware = Labware(...)
ActionTask(
...,
static_arguments={"slot": slot},
labware_sources=[
StoredLabware(
labware,
slot=0 # slot 0 is the special loading slot
)
],
labware_outputs=[
LabwareOutput(labware=labware, slot=slot)
],
)
- class linq.task.StoredLabware(labware: linq.labware.Labware, slot: int)
Labware Dependencies
A labware dependency is added between two tasks linked via a SourceLabware relationship. For more information see Time and Sequence
Specifying a specific instrument
Note that tasks are specified by setting an instrument type, not a specific instrument. This enables the planner to find any available instrument of that type to complete the task on, allowing for plan optimization.
If a task should execute only on a specified instrument or group of instruments, set at mappings
group for the instrument and the task.