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,13 +473,12 @@ if __name__ == "__main__":
print("包含: 仪器设置 + 完整实验步骤") print("包含: 仪器设置 + 完整实验步骤")
# 完整的步骤信息从biomek.py复制 # 完整的步骤信息从biomek.py复制
steps_info = ''' steps_info = {
{
"steps": [ "steps": [
{ {
"step_number": 1, "step_number": 1,
"operation": "transfer", "operation": "transfer",
"description": "转移PCR产物或酶促反应液至0.05ml 96孔板中", "description": "转移PCR产物或酶促反应液至0.5ml 96孔板中",
"parameters": { "parameters": {
"source": "P1", "source": "P1",
"target": "P11", "target": "P11",
@@ -490,7 +489,7 @@ if __name__ == "__main__":
{ {
"step_number": 2, "step_number": 2,
"operation": "transfer", "operation": "transfer",
"description": "加入2倍体积Bind Beads BC至产物中", "description": "加入2倍体积Bind Beads BC至产物中",
"parameters": { "parameters": {
"source": "P2", "source": "P2",
"target": "P11", "target": "P11",
@@ -500,52 +499,34 @@ if __name__ == "__main__":
}, },
{ {
"step_number": 3, "step_number": 3,
"operation": "move_labware",
"description": "移动P11至Orbital1用于振荡混匀",
"parameters": {
"source": "P11",
"target": "Orbital1"
}
},
{
"step_number": 4,
"operation": "oscillation", "operation": "oscillation",
"description": "在Orbital1上振荡混匀Bind Beads BC与PCR产物700-900rpm300秒", "description": "振荡混匀300秒",
"parameters": { "parameters": {
"rpm": 800, "rpm": 800,
"time": 300 "time": 300
} }
}, },
{ {
"step_number": 5, "step_number": 4,
"operation": "move_labware", "operation": "move_labware",
"description": "移动混匀后的板回P11", "description": "转移至96孔磁力架上吸附3分钟",
"parameters": {
"source": "Orbital1",
"target": "P11"
}
},
{
"step_number": 6,
"operation": "move_labware",
"description": "将P11移动到磁力架P12吸附3分钟",
"parameters": { "parameters": {
"source": "P11", "source": "P11",
"target": "P12" "target": "P12"
} }
}, },
{ {
"step_number": 7, "step_number": 5,
"operation": "incubation", "operation": "incubation",
"description": "磁力架上室温静置3分钟完成吸附", "description": "吸附3分钟",
"parameters": { "parameters": {
"time": 180 "time": 180
} }
}, },
{ {
"step_number": 8, "step_number": 6,
"operation": "transfer", "operation": "transfer",
"description": "去除上清液至废液槽", "description": "吸弃或倒除上清液",
"parameters": { "parameters": {
"source": "P12", "source": "P12",
"target": "P22", "target": "P22",
@@ -554,9 +535,9 @@ if __name__ == "__main__":
} }
}, },
{ {
"step_number": 9, "step_number": 7,
"operation": "transfer", "operation": "transfer",
"description": "加入300-500μl 75%乙醇清洗", "description": "加入300-500μl 75%乙醇",
"parameters": { "parameters": {
"source": "P3", "source": "P3",
"target": "P12", "target": "P12",
@@ -565,34 +546,34 @@ if __name__ == "__main__":
} }
}, },
{ {
"step_number": 10, "step_number": 8,
"operation": "move_labware", "operation": "move_labware",
"description": "移动清洗板到Orbital1进行振荡", "description": "移动至振荡器进行振荡混匀",
"parameters": { "parameters": {
"source": "P12", "source": "P12",
"target": "Orbital1" "target": "Orbital1"
} }
}, },
{ {
"step_number": 11, "step_number": 9,
"operation": "oscillation", "operation": "oscillation",
"description": "乙醇清洗液振荡混匀700-900rpm, 45秒", "description": "振荡混匀60秒",
"parameters": { "parameters": {
"rpm": 800, "rpm": 800,
"time": 45 "time": 60
} }
}, },
{ {
"step_number": 12, "step_number": 10,
"operation": "move_labware", "operation": "move_labware",
"description": "振荡后将板移回磁力架P12吸附", "description": "转移至96孔磁力架上吸附3分钟",
"parameters": { "parameters": {
"source": "Orbital1", "source": "Orbital1",
"target": "P12" "target": "P12"
} }
}, },
{ {
"step_number": 13, "step_number": 11,
"operation": "incubation", "operation": "incubation",
"description": "吸附3分钟", "description": "吸附3分钟",
"parameters": { "parameters": {
@@ -600,9 +581,9 @@ if __name__ == "__main__":
} }
}, },
{ {
"step_number": 14, "step_number": 12,
"operation": "transfer", "operation": "transfer",
"description": "去除乙醇上清液至废液槽", "description": "吸弃或倒弃废液",
"parameters": { "parameters": {
"source": "P12", "source": "P12",
"target": "P22", "target": "P22",
@@ -611,9 +592,9 @@ if __name__ == "__main__":
} }
}, },
{ {
"step_number": 15, "step_number": 13,
"operation": "transfer", "operation": "transfer",
"description": "第二次加入300-500μl 75%乙醇清洗", "description": "重复加入75%乙醇",
"parameters": { "parameters": {
"source": "P3", "source": "P3",
"target": "P12", "target": "P12",
@@ -622,44 +603,44 @@ if __name__ == "__main__":
} }
}, },
{ {
"step_number": 16, "step_number": 14,
"operation": "move_labware", "operation": "move_labware",
"description": "再次移动清洗板到Orbital1振荡", "description": "移动至振荡器进行振荡混匀",
"parameters": { "parameters": {
"source": "P12", "source": "P12",
"target": "Orbital1" "target": "Orbital1"
} }
}, },
{ {
"step_number": 17, "step_number": 15,
"operation": "oscillation", "operation": "oscillation",
"description": "再次乙醇清洗液振荡混匀700-900rpm, 45秒", "description": "振荡混匀60秒",
"parameters": { "parameters": {
"rpm": 800, "rpm": 800,
"time": 45 "time": 60
} }
}, },
{ {
"step_number": 18, "step_number": 16,
"operation": "move_labware", "operation": "move_labware",
"description": "振荡后板送回磁力架P12吸附", "description": "转移至96孔磁力架上吸附3分钟",
"parameters": { "parameters": {
"source": "Orbital1", "source": "Orbital1",
"target": "P12" "target": "P12"
} }
}, },
{ {
"step_number": 19, "step_number": 17,
"operation": "incubation", "operation": "incubation",
"description": "再次吸附3分钟", "description": "吸附3分钟",
"parameters": { "parameters": {
"time": 180 "time": 180
} }
}, },
{ {
"step_number": 20, "step_number": 18,
"operation": "transfer", "operation": "transfer",
"description": "去除乙醇上清液至废液槽", "description": "吸弃或倒弃废液",
"parameters": { "parameters": {
"source": "P12", "source": "P12",
"target": "P22", "target": "P22",
@@ -668,7 +649,16 @@ if __name__ == "__main__":
} }
}, },
{ {
"step_number": 21, "step_number": 19,
"operation": "move_labware",
"description": "正放96孔板空气干燥15分钟",
"parameters": {
"source": "P12",
"target": "P13"
}
},
{
"step_number": 20,
"operation": "incubation", "operation": "incubation",
"description": "空气干燥15分钟", "description": "空气干燥15分钟",
"parameters": { "parameters": {
@@ -676,71 +666,85 @@ if __name__ == "__main__":
} }
}, },
{ {
"step_number": 22, "step_number": 21,
"operation": "transfer", "operation": "transfer",
"description": "30-50μl Elution Buffer洗脱", "description": "加入30-50μl Elution Buffer",
"parameters": { "parameters": {
"source": "P4", "source": "P4",
"target": "P12", "target": "P13",
"tip_rack": "BC230", "tip_rack": "BC230",
"volume": 40 "volume": 40
} }
}, },
{ {
"step_number": 23, "step_number": 22,
"operation": "move_labware", "operation": "move_labware",
"description": "移动到Orbital1振荡混匀60秒", "description": "移动至振荡器进行振荡混匀",
"parameters": { "parameters": {
"source": "P12", "source": "P13",
"target": "Orbital1" "target": "Orbital1"
} }
}, },
{ {
"step_number": 24, "step_number": 23,
"operation": "oscillation", "operation": "oscillation",
"description": "Elution Buffer振荡混匀700-900rpm, 60秒", "description": "振荡混匀60秒",
"parameters": { "parameters": {
"rpm": 800, "rpm": 800,
"time": 60 "time": 60
} }
}, },
{ {
"step_number": 25, "step_number": 24,
"operation": "move_labware", "operation": "move_labware",
"description": "振荡后送回磁力架P12", "description": "室温静置3分钟",
"parameters": { "parameters": {
"source": "Orbital1", "source": "Orbital1",
"target": "P12" "target": "P13"
} }
}, },
{ {
"step_number": 26, "step_number": 25,
"operation": "incubation", "operation": "incubation",
"description": "室温静置3分钟(洗脱反应)", "description": "室温静置3分钟",
"parameters": { "parameters": {
"time": 180 "time": 180
} }
}, },
{
"step_number": 26,
"operation": "move_labware",
"description": "转移至96孔磁力架上吸附2分钟",
"parameters": {
"source": "P13",
"target": "P12"
}
},
{ {
"step_number": 27, "step_number": 27,
"operation": "incubation",
"description": "吸附2分钟",
"parameters": {
"time": 120
}
},
{
"step_number": 28,
"operation": "transfer", "operation": "transfer",
"description": "将上清液(DNA转移到新板P13", "description": "DNA转移至新的板中",
"parameters": { "parameters": {
"source": "P12", "source": "P12",
"target": "P13", "target": "P14",
"tip_rack": "BC230", "tip_rack": "BC230",
"volume": 40 "volume": 40
} }
} }
] ]
} }
''' # 完整的labware配置信息
labware_with_liquid = [
# 完整的labware配置信息从biomek.py复制
labware_with_liquid = '''
[
{ {
"id": "Tip Rack BC230 on TL1", "id": "Tip Rack BC230 TL1",
"parent": "deck", "parent": "deck",
"slot_on_deck": "TL1", "slot_on_deck": "TL1",
"class_name": "BC230", "class_name": "BC230",
@@ -749,7 +753,7 @@ if __name__ == "__main__":
"liquid_input_wells": [] "liquid_input_wells": []
}, },
{ {
"id": "Tip Rack BC230 on TL2", "id": "Tip Rack BC230 TL2",
"parent": "deck", "parent": "deck",
"slot_on_deck": "TL2", "slot_on_deck": "TL2",
"class_name": "BC230", "class_name": "BC230",
@@ -758,7 +762,7 @@ if __name__ == "__main__":
"liquid_input_wells": [] "liquid_input_wells": []
}, },
{ {
"id": "Tip Rack BC230 on TL3", "id": "Tip Rack BC230 TL3",
"parent": "deck", "parent": "deck",
"slot_on_deck": "TL3", "slot_on_deck": "TL3",
"class_name": "BC230", "class_name": "BC230",
@@ -767,7 +771,7 @@ if __name__ == "__main__":
"liquid_input_wells": [] "liquid_input_wells": []
}, },
{ {
"id": "Tip Rack BC230 on TL4", "id": "Tip Rack BC230 TL4",
"parent": "deck", "parent": "deck",
"slot_on_deck": "TL4", "slot_on_deck": "TL4",
"class_name": "BC230", "class_name": "BC230",
@@ -776,7 +780,7 @@ if __name__ == "__main__":
"liquid_input_wells": [] "liquid_input_wells": []
}, },
{ {
"id": "Tip Rack BC230 on TL5", "id": "Tip Rack BC230 TL5",
"parent": "deck", "parent": "deck",
"slot_on_deck": "TL5", "slot_on_deck": "TL5",
"class_name": "BC230", "class_name": "BC230",
@@ -785,7 +789,7 @@ if __name__ == "__main__":
"liquid_input_wells": [] "liquid_input_wells": []
}, },
{ {
"id": "Tip Rack BC230 on P5", "id": "Tip Rack BC230 P5",
"parent": "deck", "parent": "deck",
"slot_on_deck": "P5", "slot_on_deck": "P5",
"class_name": "BC230", "class_name": "BC230",
@@ -794,7 +798,7 @@ if __name__ == "__main__":
"liquid_input_wells": [] "liquid_input_wells": []
}, },
{ {
"id": "Tip Rack BC230 on P6", "id": "Tip Rack BC230 P6",
"parent": "deck", "parent": "deck",
"slot_on_deck": "P6", "slot_on_deck": "P6",
"class_name": "BC230", "class_name": "BC230",
@@ -803,7 +807,7 @@ if __name__ == "__main__":
"liquid_input_wells": [] "liquid_input_wells": []
}, },
{ {
"id": "Tip Rack BC230 on P15", "id": "Tip Rack BC230 P15",
"parent": "deck", "parent": "deck",
"slot_on_deck": "P15", "slot_on_deck": "P15",
"class_name": "BC230", "class_name": "BC230",
@@ -812,7 +816,7 @@ if __name__ == "__main__":
"liquid_input_wells": [] "liquid_input_wells": []
}, },
{ {
"id": "Tip Rack BC230 on P16", "id": "Tip Rack BC230 P16",
"parent": "deck", "parent": "deck",
"slot_on_deck": "P16", "slot_on_deck": "P16",
"class_name": "BC230", "class_name": "BC230",
@@ -824,53 +828,82 @@ if __name__ == "__main__":
"id": "stock plate on P1", "id": "stock plate on P1",
"parent": "deck", "parent": "deck",
"slot_on_deck": "P1", "slot_on_deck": "P1",
"class_name": "nest_12_reservoir_15ml", "class_name": "AgilentReservoir",
"liquid_type": [ "liquid_type": ["PCR product"],
"master_mix" "liquid_volume": [5000],
], "liquid_input_wells": ["A1"]
"liquid_volume": [10000],
"liquid_input_wells": [
"A1"
]
}, },
{ {
"id": "stock plate on P2", "id": "stock plate on P2",
"parent": "deck", "parent": "deck",
"slot_on_deck": "P2", "slot_on_deck": "P2",
"class_name": "nest_12_reservoir_15ml", "class_name": "AgilentReservoir",
"liquid_type": [ "liquid_type": ["bind beads"],
"bind beads" "liquid_volume": [100000],
], "liquid_input_wells": ["A1"]
"liquid_volume": [10000],
"liquid_input_wells": [
"A1"
]
}, },
{ {
"id": "stock plate on P3", "id": "stock plate on P3",
"parent": "deck", "parent": "deck",
"slot_on_deck": "P3", "slot_on_deck": "P3",
"class_name": "nest_12_reservoir_15ml", "class_name": "AgilentReservoir",
"liquid_type": [ "liquid_type": ["75% ethanol"],
"ethyl alcohol" "liquid_volume": [100000],
], "liquid_input_wells": ["A1"]
"liquid_volume": [10000],
"liquid_input_wells": [
"A1"
]
}, },
{ {
"id": "elution buffer on P4", "id": "stock plate on P4",
"parent": "deck", "parent": "deck",
"slot_on_deck": "P4", "slot_on_deck": "P4",
"class_name": "nest_12_reservoir_15ml", "class_name": "AgilentReservoir",
"liquid_type": [ "liquid_type": ["Elution Buffer"],
"elution buffer"
],
"liquid_volume": [5000], "liquid_volume": [5000],
"liquid_input_wells": [ "liquid_input_wells": ["A1"]
"A1" },
] {
"id": "working plate on P11",
"parent": "deck",
"slot_on_deck": "P11",
"class_name": "BCDeep96Round",
"liquid_type": [],
"liquid_volume": [],
"liquid_input_wells": []
},
{
"id": "working plate on P12",
"parent": "deck",
"slot_on_deck": "P12",
"class_name": "BCDeep96Round",
"liquid_type": [],
"liquid_volume": [],
"liquid_input_wells": []
},
{
"id": "working plate on P13",
"parent": "deck",
"slot_on_deck": "P13",
"class_name": "BCDeep96Round",
"liquid_type": [],
"liquid_volume": [],
"liquid_input_wells": []
},
{
"id": "working plate on P14",
"parent": "deck",
"slot_on_deck": "P14",
"class_name": "BCDeep96Round",
"liquid_type": [],
"liquid_volume": [],
"liquid_input_wells": []
},
{
"id": "waste on P22",
"parent": "deck",
"slot_on_deck": "P22",
"class_name": "AgilentReservoir",
"liquid_type": [],
"liquid_volume": [],
"liquid_input_wells": []
}, },
{ {
"id": "oscillation", "id": "oscillation",
@@ -880,45 +913,8 @@ if __name__ == "__main__":
"liquid_type": [], "liquid_type": [],
"liquid_volume": [], "liquid_volume": [],
"liquid_input_wells": [] "liquid_input_wells": []
},
{
"id": "working plate on P11",
"parent": "deck",
"slot_on_deck": "P11",
"class_name": "NEST 2ml Deep Well Plate",
"liquid_type": [],
"liquid_volume": [],
"liquid_input_wells": []
},
{
"id": "magnetics module on P12",
"parent": "deck",
"slot_on_deck": "P12",
"class_name": "magnetics module",
"liquid_type": [],
"liquid_volume": [],
"liquid_input_wells": []
},
{
"id": "working plate on P13",
"parent": "deck",
"slot_on_deck": "P13",
"class_name": "NEST 2ml Deep Well Plate",
"liquid_type": [],
"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()