Pylabrobot

Pylabrobot

Advanced Pylabrobot automation and integration for liquid handling and lab robotics

Category: productivity Source: K-Dense-AI/claude-scientific-skills

PyLabRobot is a community skill for controlling laboratory automation hardware using the PyLabRobot Python library, covering liquid handler programming, plate management, pipetting protocols, deck layout configuration, and hardware abstraction for automated laboratory workflows.

What Is This?

Overview

PyLabRobot provides tools for programming laboratory robots through a hardware-agnostic Python interface that works across different automation platforms. It covers liquid handler programming that controls aspirate and dispense operations with volume and speed parameters, plate management that tracks labware positions and well contents across the robot deck, pipetting protocols that define multi-step liquid transfer workflows with tip tracking, deck layout configuration that maps physical hardware positions to software coordinate systems, and hardware abstraction that supports multiple robot brands through a unified API. The skill enables scientists to automate laboratory protocols programmatically.

Who Should Use This

This skill serves laboratory automation engineers programming liquid handling robots, research scientists automating repetitive pipetting protocols, and core facility managers standardizing workflows across different robot platforms.

Why Use It?

Problems It Solves

Each liquid handler manufacturer provides proprietary software with different programming interfaces requiring separate training for each platform. Manual pipetting protocols are error-prone and produce inconsistent results across operators. Complex liquid transfer patterns involving multiple source and destination plates are tedious to program without high-level abstractions. Tracking tip usage and plate contents during automated runs requires careful bookkeeping.

Core Highlights

Liquid handler controller executes aspirate and dispense operations with precise volume control. Plate tracker manages labware positions and well contents on the robot deck. Protocol builder defines multi-step workflows with automatic tip management. Hardware abstractor provides a unified API across different robot platforms.

How to Use It?

Basic Usage

from pylabrobot\
  .liquid_handling import (
    LiquidHandler)
from pylabrobot\
  .liquid_handling\
  .backends import (
    ChatterBoxBackend)
from pylabrobot\
  .resources import (
    Deck, Plate,
    TipRack)

backend = (
  ChatterBoxBackend())
lh = LiquidHandler(
  backend=backend)
await lh.setup()

tips = TipRack(
  name='tips_01',
  size_x=127.0,
  size_y=86.0,
  size_z=20.0)
plate = Plate(
  name='plate_01',
  size_x=127.0,
  size_y=86.0,
  size_z=14.0)

lh.deck.assign_child_resource(
  tips, rails=1)
lh.deck.assign_child_resource(
  plate, rails=3)

await lh.pick_up_tips(
  tips['A1:H1'])

await lh.aspirate(
  plate['A1:H1'],
  vols=[100.0] * 8)
await lh.dispense(
  plate['A2:H2'],
  vols=[100.0] * 8)

Real-World Examples

from pylabrobot\
  .liquid_handling import (
    LiquidHandler)

class SerialDilution:
  def __init__(
    self,
    lh: LiquidHandler,
    plate,
    tips
  ):
    self.lh = lh
    self.plate = plate
    self.tips = tips

  async def run(
    self,
    start_col: int,
    num_dilutions:
      int = 6,
    transfer_vol:
      float = 50.0,
    diluent_vol:
      float = 100.0
  ):
    rows = 'ABCDEFGH'
    for step in range(
      num_dilutions
    ):
      src_col = (
        start_col + step)
      dst_col = (
        src_col + 1)
      src = [
        f'{r}{src_col}'
        for r in rows]
      dst = [
        f'{r}{dst_col}'
        for r in rows]
      await (
        self.lh
          .pick_up_tips(
            self.tips[
              f'A{step+1}:'
              f'H{step+1}'
            ]))
      await (
        self.lh.aspirate(
          self.plate[
            src],
          vols=[
            transfer_vol]
            * 8))
      await (
        self.lh.dispense(
          self.plate[
            dst],
          vols=[
            transfer_vol]
            * 8))
      await (
        self.lh
          .drop_tips(
            self.tips[
              f'A{step+1}:'
              f'H{step+1}'
            ]))

Advanced Tips

Use the simulation backend during protocol development to validate liquid transfers and tip tracking without running the physical robot. Define plate layouts as reusable configuration objects to share deck setups across multiple protocols. Implement error recovery by checking tip and volume states before each transfer step to catch issues during long automated runs.

When to Use It?

Use Cases

Automate a serial dilution protocol across a 96-well plate with precise volume transfers and tip changes. Program a liquid handler to perform plate-to-plate transfers for high-throughput screening assays. Create reusable protocol scripts that run on different robot platforms through the hardware abstraction layer.

Related Topics

PyLabRobot, laboratory automation, liquid handling, robotics, pipetting, high-throughput screening, and lab protocols.

Important Notes

Requirements

PyLabRobot Python package with async support for hardware communication. Compatible liquid handling robot or simulation backend for protocol testing. Labware definitions matching the physical plates and tip racks on the robot deck.

Usage Recommendations

Do: test all protocols in simulation mode before running on physical hardware to catch programming errors. Track tip usage throughout the protocol to prevent cross-contamination from reusing tips. Define deck layouts precisely matching physical positions to avoid collisions.

Don't: skip volume validation since aspirating more liquid than available introduces air bubbles that affect results. Hardcode deck positions when labware definitions provide named access to wells and racks. Run untested protocols on expensive reagents without first validating with water.

Limitations

Hardware backend support varies by manufacturer with some robots requiring additional driver configuration. Async programming model adds complexity for users unfamiliar with Python async patterns. Physical robot calibration differences mean protocol volumes may need adjustment between instruments.