[ PROMPT_NODE_27112 ]
liquid-handling
[ SKILL_DOCUMENTATION ]
# PyLabRobot 液体处理
## 概述
液体处理模块 (`pylabrobot.liquid_handling`) 为控制液体处理机器人提供了统一的接口。`LiquidHandler` 类作为所有移液操作的主要接口,通过后端抽象在不同的硬件平台上工作。
## 基本设置
### 初始化液体处理工作站
python
from pylabrobot.liquid_handling import LiquidHandler
from pylabrobot.liquid_handling.backends import STAR
from pylabrobot.resources import STARLetDeck
# 创建带有 STAR 后端的液体处理工作站
lh = LiquidHandler(backend=STAR(), deck=STARLetDeck())
await lh.setup()
# 完成后
await lh.stop()
### 在后端之间切换
通过更换后端来切换机器人,而无需重写协议:
python
# Hamilton STAR
from pylabrobot.liquid_handling.backends import STAR
lh = LiquidHandler(backend=STAR(), deck=STARLetDeck())
# Opentrons OT-2
from pylabrobot.liquid_handling.backends import OpentronsBackend
lh = LiquidHandler(backend=OpentronsBackend(host="192.168.1.100"), deck=OTDeck())
# 模拟 (无需硬件)
from pylabrobot.liquid_handling.backends.simulation import ChatterboxBackend
lh = LiquidHandler(backend=ChatterboxBackend(), deck=STARLetDeck())
## 核心操作
### 吸头管理
拾取和丢弃吸头是液体处理操作的基础:
python
# 从特定位置拾取吸头
await lh.pick_up_tips(tip_rack["A1"]) # 单个吸头
await lh.pick_up_tips(tip_rack["A1:H1"]) # 8 个吸头的一行
await lh.pick_up_tips(tip_rack["A1:A12"]) # 12 个吸头的一列
# 丢弃吸头
await lh.drop_tips() # 在当前位置丢弃
await lh.drop_tips(waste) # 在特定位置丢弃
# 将吸头放回原位
await lh.return_tips()
**吸头追踪**: 启用自动吸头追踪以监控吸头使用情况:
python
from pylabrobot.resources import set_tip_tracking
set_tip_tracking(True) # 全局启用
### 吸液
从孔或容器中抽取液体:
python
# 基本吸液
await lh.aspirate(plate["A1"], vols=100) # 从 A1 吸取 100 µL
# 多个孔相同体积
await lh.aspirate(plate["A1:H1"], vols=100) # 每个孔吸取 100 µL
# 多个孔不同体积
await lh.aspirate(
plate["A1:A3"],
vols=[100, 150, 200] # 不同体积
)
# 高级参数
await lh.aspirat