Update biomek_test.py

This commit is contained in:
qxw138
2025-06-08 15:52:20 +08:00
parent c0b7f2decd
commit 9b3377aedb

View File

@@ -276,14 +276,14 @@ class LiquidHandlerBiomek:
"Class": f"LabwareClasses\\{class_name}", "Class": f"LabwareClasses\\{class_name}",
"DataSets": {"Volume": {}}, "DataSets": {"Volume": {}},
"RuntimeDataSets": {"Volume": {}}, "RuntimeDataSets": {"Volume": {}},
"EvalAmounts": (float(liquid_volume[0]),) if liquid_volume else (0.0,), "EvalAmounts": (float(liquid_volume[0]),) if liquid_volume else (0,),
"Nominal": False, "Nominal": False,
"EvalLiquids": (liquid_type[0],) if liquid_type else ("Water",) "EvalLiquids": (liquid_type[0],) if liquid_type else ("Water",)
} }
elif instrument_type == "plate_96": elif instrument_type == "plate_96":
# 96孔板类型配置 # 96孔板类型配置
volume_per_well = float(liquid_volume[0]) if liquid_volume else 500.0 volume_per_well = float(liquid_volume[0]) if liquid_volume else 0
liquid_per_well = liquid_type[0] if liquid_type else "Water" liquid_per_well = liquid_type[0] if liquid_type else "Water"
config = { config = {
@@ -473,452 +473,448 @@ if __name__ == "__main__":
print("包含: 仪器设置 + 完整实验步骤") print("包含: 仪器设置 + 完整实验步骤")
# 完整的步骤信息从biomek.py复制 # 完整的步骤信息从biomek.py复制
steps_info = ''' steps_info = {
"steps": [
{ {
"steps": [ "step_number": 1,
{ "operation": "transfer",
"step_number": 1, "description": "转移PCR产物或酶促反应液至0.5ml 96孔板中",
"operation": "transfer", "parameters": {
"description": "转移PCR产物或酶促反应液至0.05ml 96孔板中", "source": "P1",
"parameters": { "target": "P11",
"source": "P1", "tip_rack": "BC230",
"target": "P11", "volume": 50
"tip_rack": "BC230", }
"volume": 50 },
} {
}, "step_number": 2,
{ "operation": "transfer",
"step_number": 2, "description": "加入2倍体积的Bind Beads BC至产物中",
"operation": "transfer", "parameters": {
"description": "加入2倍体积Bind Beads BC至产物中", "source": "P2",
"parameters": { "target": "P11",
"source": "P2", "tip_rack": "BC230",
"target": "P11", "volume": 100
"tip_rack": "BC230", }
"volume": 100 },
} {
}, "step_number": 3,
{ "operation": "oscillation",
"step_number": 3, "description": "振荡混匀300秒",
"operation": "move_labware", "parameters": {
"description": "移动P11至Orbital1用于振荡混匀", "rpm": 800,
"parameters": { "time": 300
"source": "P11", }
"target": "Orbital1" },
} {
}, "step_number": 4,
{ "operation": "move_labware",
"step_number": 4, "description": "转移至96孔磁力架上吸附3分钟",
"operation": "oscillation", "parameters": {
"description": "在Orbital1上振荡混匀Bind Beads BC与PCR产物700-900rpm300秒", "source": "P11",
"parameters": { "target": "P12"
"rpm": 800, }
"time": 300 },
} {
}, "step_number": 5,
{ "operation": "incubation",
"step_number": 5, "description": "吸附3分钟",
"operation": "move_labware", "parameters": {
"description": "移动混匀后的板回P11", "time": 180
"parameters": { }
"source": "Orbital1", },
"target": "P11" {
} "step_number": 6,
}, "operation": "transfer",
{ "description": "吸弃或倒除上清液",
"step_number": 6, "parameters": {
"operation": "move_labware", "source": "P12",
"description": "将P11移动到磁力架P12吸附3分钟", "target": "P22",
"parameters": { "tip_rack": "BC230",
"source": "P11", "volume": 150
"target": "P12" }
} },
}, {
{ "step_number": 7,
"step_number": 7, "operation": "transfer",
"operation": "incubation", "description": "加入300-500μl 75%乙醇",
"description": "磁力架上室温静置3分钟完成吸附", "parameters": {
"parameters": { "source": "P3",
"time": 180 "target": "P12",
} "tip_rack": "BC230",
}, "volume": 400
{ }
"step_number": 8, },
"operation": "transfer", {
"description": "去除上清液至废液槽", "step_number": 8,
"parameters": { "operation": "move_labware",
"source": "P12", "description": "移动至振荡器进行振荡混匀",
"target": "P22", "parameters": {
"tip_rack": "BC230", "source": "P12",
"volume": 150 "target": "Orbital1"
} }
}, },
{ {
"step_number": 9, "step_number": 9,
"operation": "transfer", "operation": "oscillation",
"description": "加入300-500μl 75%乙醇清洗", "description": "振荡混匀60秒",
"parameters": { "parameters": {
"source": "P3", "rpm": 800,
"target": "P12", "time": 60
"tip_rack": "BC230", }
"volume": 400 },
} {
}, "step_number": 10,
{ "operation": "move_labware",
"step_number": 10, "description": "转移至96孔磁力架上吸附3分钟",
"operation": "move_labware", "parameters": {
"description": "移动清洗板到Orbital1进行振荡", "source": "Orbital1",
"parameters": { "target": "P12"
"source": "P12", }
"target": "Orbital1" },
} {
}, "step_number": 11,
{ "operation": "incubation",
"step_number": 11, "description": "吸附3分钟",
"operation": "oscillation", "parameters": {
"description": "乙醇清洗液振荡混匀700-900rpm, 45秒", "time": 180
"parameters": { }
"rpm": 800, },
"time": 45 {
} "step_number": 12,
}, "operation": "transfer",
{ "description": "吸弃或倒弃废液",
"step_number": 12, "parameters": {
"operation": "move_labware", "source": "P12",
"description": "振荡后将板移回磁力架P12吸附", "target": "P22",
"parameters": { "tip_rack": "BC230",
"source": "Orbital1", "volume": 400
"target": "P12" }
} },
}, {
{ "step_number": 13,
"step_number": 13, "operation": "transfer",
"operation": "incubation", "description": "重复加入75%乙醇",
"description": "吸附3分钟", "parameters": {
"parameters": { "source": "P3",
"time": 180 "target": "P12",
} "tip_rack": "BC230",
}, "volume": 400
{ }
"step_number": 14, },
"operation": "transfer", {
"description": "去除乙醇上清液至废液槽", "step_number": 14,
"parameters": { "operation": "move_labware",
"source": "P12", "description": "移动至振荡器进行振荡混匀",
"target": "P22", "parameters": {
"tip_rack": "BC230", "source": "P12",
"volume": 400 "target": "Orbital1"
} }
}, },
{ {
"step_number": 15, "step_number": 15,
"operation": "transfer", "operation": "oscillation",
"description": "第二次加入300-500μl 75%乙醇清洗", "description": "振荡混匀60秒",
"parameters": { "parameters": {
"source": "P3", "rpm": 800,
"target": "P12", "time": 60
"tip_rack": "BC230", }
"volume": 400 },
} {
}, "step_number": 16,
{ "operation": "move_labware",
"step_number": 16, "description": "转移至96孔磁力架上吸附3分钟",
"operation": "move_labware", "parameters": {
"description": "再次移动清洗板到Orbital1振荡", "source": "Orbital1",
"parameters": { "target": "P12"
"source": "P12", }
"target": "Orbital1" },
} {
}, "step_number": 17,
{ "operation": "incubation",
"step_number": 17, "description": "吸附3分钟",
"operation": "oscillation", "parameters": {
"description": "再次乙醇清洗液振荡混匀700-900rpm, 45秒", "time": 180
"parameters": { }
"rpm": 800, },
"time": 45 {
} "step_number": 18,
}, "operation": "transfer",
{ "description": "吸弃或倒弃废液",
"step_number": 18, "parameters": {
"operation": "move_labware", "source": "P12",
"description": "振荡后板送回磁力架P12吸附", "target": "P22",
"parameters": { "tip_rack": "BC230",
"source": "Orbital1", "volume": 400
"target": "P12" }
} },
}, {
{ "step_number": 19,
"step_number": 19, "operation": "move_labware",
"operation": "incubation", "description": "正放96孔板空气干燥15分钟",
"description": "再次吸附3分钟", "parameters": {
"parameters": { "source": "P12",
"time": 180 "target": "P13"
} }
}, },
{ {
"step_number": 20, "step_number": 20,
"operation": "transfer", "operation": "incubation",
"description": "去除乙醇上清液至废液槽", "description": "空气干燥15分钟",
"parameters": { "parameters": {
"source": "P12", "time": 900
"target": "P22", }
"tip_rack": "BC230", },
"volume": 400 {
} "step_number": 21,
}, "operation": "transfer",
{ "description": "加入30-50μl Elution Buffer",
"step_number": 21, "parameters": {
"operation": "incubation", "source": "P4",
"description": "空气干燥15分钟", "target": "P13",
"parameters": { "tip_rack": "BC230",
"time": 900 "volume": 40
} }
}, },
{ {
"step_number": 22, "step_number": 22,
"operation": "transfer", "operation": "move_labware",
"description": "加30-50μl Elution Buffer洗脱", "description": "移动至振荡器进行振荡混匀",
"parameters": { "parameters": {
"source": "P4", "source": "P13",
"target": "P12", "target": "Orbital1"
"tip_rack": "BC230", }
"volume": 40 },
} {
}, "step_number": 23,
{ "operation": "oscillation",
"step_number": 23, "description": "振荡混匀60秒",
"operation": "move_labware", "parameters": {
"description": "移动到Orbital1振荡混匀60秒", "rpm": 800,
"parameters": { "time": 60
"source": "P12", }
"target": "Orbital1" },
} {
}, "step_number": 24,
{ "operation": "move_labware",
"step_number": 24, "description": "室温静置3分钟",
"operation": "oscillation", "parameters": {
"description": "Elution Buffer振荡混匀700-900rpm, 60秒", "source": "Orbital1",
"parameters": { "target": "P13"
"rpm": 800, }
"time": 60 },
} {
}, "step_number": 25,
{ "operation": "incubation",
"step_number": 25, "description": "室温静置3分钟",
"operation": "move_labware", "parameters": {
"description": "振荡后送回磁力架P12", "time": 180
"parameters": { }
"source": "Orbital1", },
"target": "P12" {
} "step_number": 26,
}, "operation": "move_labware",
{ "description": "转移至96孔磁力架上吸附2分钟",
"step_number": 26, "parameters": {
"operation": "incubation", "source": "P13",
"description": "室温静置3分钟洗脱反应", "target": "P12"
"parameters": { }
"time": 180 },
} {
}, "step_number": 27,
{ "operation": "incubation",
"step_number": 27, "description": "吸附2分钟",
"operation": "transfer", "parameters": {
"description": "将上清液DNA转移到新板P13", "time": 120
"parameters": { }
"source": "P12", },
"target": "P13", {
"tip_rack": "BC230", "step_number": 28,
"volume": 40 "operation": "transfer",
} "description": "将DNA转移至新的板中",
} "parameters": {
] "source": "P12",
"target": "P14",
"tip_rack": "BC230",
"volume": 40
}
} }
''' ]
}
# 完整的labware配置信息从biomek.py复制 # 完整的labware配置信息
labware_with_liquid = ''' labware_with_liquid = [
[ {
{ "id": "Tip Rack BC230 TL1",
"id": "Tip Rack BC230 on TL1", "parent": "deck",
"parent": "deck", "slot_on_deck": "TL1",
"slot_on_deck": "TL1", "class_name": "BC230",
"class_name": "BC230", "liquid_type": [],
"liquid_type": [], "liquid_volume": [],
"liquid_volume": [], "liquid_input_wells": []
"liquid_input_wells": [] },
}, {
{ "id": "Tip Rack BC230 TL2",
"id": "Tip Rack BC230 on TL2", "parent": "deck",
"parent": "deck", "slot_on_deck": "TL2",
"slot_on_deck": "TL2", "class_name": "BC230",
"class_name": "BC230", "liquid_type": [],
"liquid_type": [], "liquid_volume": [],
"liquid_volume": [], "liquid_input_wells": []
"liquid_input_wells": [] },
}, {
{ "id": "Tip Rack BC230 TL3",
"id": "Tip Rack BC230 on TL3", "parent": "deck",
"parent": "deck", "slot_on_deck": "TL3",
"slot_on_deck": "TL3", "class_name": "BC230",
"class_name": "BC230", "liquid_type": [],
"liquid_type": [], "liquid_volume": [],
"liquid_volume": [], "liquid_input_wells": []
"liquid_input_wells": [] },
}, {
{ "id": "Tip Rack BC230 TL4",
"id": "Tip Rack BC230 on TL4", "parent": "deck",
"parent": "deck", "slot_on_deck": "TL4",
"slot_on_deck": "TL4", "class_name": "BC230",
"class_name": "BC230", "liquid_type": [],
"liquid_type": [], "liquid_volume": [],
"liquid_volume": [], "liquid_input_wells": []
"liquid_input_wells": [] },
}, {
{ "id": "Tip Rack BC230 TL5",
"id": "Tip Rack BC230 on TL5", "parent": "deck",
"parent": "deck", "slot_on_deck": "TL5",
"slot_on_deck": "TL5", "class_name": "BC230",
"class_name": "BC230", "liquid_type": [],
"liquid_type": [], "liquid_volume": [],
"liquid_volume": [], "liquid_input_wells": []
"liquid_input_wells": [] },
}, {
{ "id": "Tip Rack BC230 P5",
"id": "Tip Rack BC230 on P5", "parent": "deck",
"parent": "deck", "slot_on_deck": "P5",
"slot_on_deck": "P5", "class_name": "BC230",
"class_name": "BC230", "liquid_type": [],
"liquid_type": [], "liquid_volume": [],
"liquid_volume": [], "liquid_input_wells": []
"liquid_input_wells": [] },
}, {
{ "id": "Tip Rack BC230 P6",
"id": "Tip Rack BC230 on P6", "parent": "deck",
"parent": "deck", "slot_on_deck": "P6",
"slot_on_deck": "P6", "class_name": "BC230",
"class_name": "BC230", "liquid_type": [],
"liquid_type": [], "liquid_volume": [],
"liquid_volume": [], "liquid_input_wells": []
"liquid_input_wells": [] },
}, {
{ "id": "Tip Rack BC230 P15",
"id": "Tip Rack BC230 on P15", "parent": "deck",
"parent": "deck", "slot_on_deck": "P15",
"slot_on_deck": "P15", "class_name": "BC230",
"class_name": "BC230", "liquid_type": [],
"liquid_type": [], "liquid_volume": [],
"liquid_volume": [], "liquid_input_wells": []
"liquid_input_wells": [] },
}, {
{ "id": "Tip Rack BC230 P16",
"id": "Tip Rack BC230 on P16", "parent": "deck",
"parent": "deck", "slot_on_deck": "P16",
"slot_on_deck": "P16", "class_name": "BC230",
"class_name": "BC230", "liquid_type": [],
"liquid_type": [], "liquid_volume": [],
"liquid_volume": [], "liquid_input_wells": []
"liquid_input_wells": [] },
}, {
{ "id": "stock plate on P1",
"id": "stock plate on P1", "parent": "deck",
"parent": "deck", "slot_on_deck": "P1",
"slot_on_deck": "P1", "class_name": "AgilentReservoir",
"class_name": "nest_12_reservoir_15ml", "liquid_type": ["PCR product"],
"liquid_type": [ "liquid_volume": [5000],
"master_mix" "liquid_input_wells": ["A1"]
], },
"liquid_volume": [10000], {
"liquid_input_wells": [ "id": "stock plate on P2",
"A1" "parent": "deck",
] "slot_on_deck": "P2",
}, "class_name": "AgilentReservoir",
{ "liquid_type": ["bind beads"],
"id": "stock plate on P2", "liquid_volume": [100000],
"parent": "deck", "liquid_input_wells": ["A1"]
"slot_on_deck": "P2", },
"class_name": "nest_12_reservoir_15ml", {
"liquid_type": [ "id": "stock plate on P3",
"bind beads" "parent": "deck",
], "slot_on_deck": "P3",
"liquid_volume": [10000], "class_name": "AgilentReservoir",
"liquid_input_wells": [ "liquid_type": ["75% ethanol"],
"A1" "liquid_volume": [100000],
] "liquid_input_wells": ["A1"]
}, },
{ {
"id": "stock plate on P3", "id": "stock plate on P4",
"parent": "deck", "parent": "deck",
"slot_on_deck": "P3", "slot_on_deck": "P4",
"class_name": "nest_12_reservoir_15ml", "class_name": "AgilentReservoir",
"liquid_type": [ "liquid_type": ["Elution Buffer"],
"ethyl alcohol" "liquid_volume": [5000],
], "liquid_input_wells": ["A1"]
"liquid_volume": [10000], },
"liquid_input_wells": [ {
"A1" "id": "working plate on P11",
] "parent": "deck",
}, "slot_on_deck": "P11",
{ "class_name": "BCDeep96Round",
"id": "elution buffer on P4", "liquid_type": [],
"parent": "deck", "liquid_volume": [],
"slot_on_deck": "P4", "liquid_input_wells": []
"class_name": "nest_12_reservoir_15ml", },
"liquid_type": [ {
"elution buffer" "id": "working plate on P12",
], "parent": "deck",
"liquid_volume": [5000], "slot_on_deck": "P12",
"liquid_input_wells": [ "class_name": "BCDeep96Round",
"A1" "liquid_type": [],
] "liquid_volume": [],
}, "liquid_input_wells": []
{ },
"id": "oscillation", {
"parent": "deck", "id": "working plate on P13",
"slot_on_deck": "Orbital1", "parent": "deck",
"class_name": "Orbital", "slot_on_deck": "P13",
"liquid_type": [], "class_name": "BCDeep96Round",
"liquid_volume": [], "liquid_type": [],
"liquid_input_wells": [] "liquid_volume": [],
}, "liquid_input_wells": []
{ },
"id": "working plate on P11", {
"parent": "deck", "id": "working plate on P14",
"slot_on_deck": "P11", "parent": "deck",
"class_name": "NEST 2ml Deep Well Plate", "slot_on_deck": "P14",
"liquid_type": [], "class_name": "BCDeep96Round",
"liquid_volume": [], "liquid_type": [],
"liquid_input_wells": [] "liquid_volume": [],
}, "liquid_input_wells": []
{ },
"id": "magnetics module on P12", {
"parent": "deck", "id": "waste on P22",
"slot_on_deck": "P12", "parent": "deck",
"class_name": "magnetics module", "slot_on_deck": "P22",
"liquid_type": [], "class_name": "AgilentReservoir",
"liquid_volume": [], "liquid_type": [],
"liquid_input_wells": [] "liquid_volume": [],
}, "liquid_input_wells": []
{ },
"id": "working plate on P13", {
"parent": "deck", "id": "oscillation",
"slot_on_deck": "P13", "parent": "deck",
"class_name": "NEST 2ml Deep Well Plate", "slot_on_deck": "Orbital1",
"liquid_type": [], "class_name": "Orbital",
"liquid_volume": [], "liquid_type": [],
"liquid_input_wells": [] "liquid_volume": [],
}, "liquid_input_wells": []
{ }
"id": "waste on P22", ]
"parent": "deck",
"slot_on_deck": "P22",
"class_name": "nest_1_reservoir_195ml",
"liquid_type": [],
"liquid_volume": [],
"liquid_input_wells": []
}
]
'''
# 创建handler实例 # 创建handler实例
handler = LiquidHandlerBiomek() handler = LiquidHandlerBiomek()