mirror of
https://github.com/dptech-corp/Uni-Lab-OS.git
synced 2025-12-18 05:21:19 +00:00
fix biomek startup
add action handles
This commit is contained in:
@@ -23,8 +23,8 @@ class LiquidHandlerBiomek(LiquidHandlerAbstract):
|
|||||||
该类用于处理Biomek液体处理器的特定操作。
|
该类用于处理Biomek液体处理器的特定操作。
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, backend=None, deck=None, *args, **kwargs):
|
||||||
super().__init__(*args, **kwargs)
|
super().__init__(backend, deck, *args, **kwargs)
|
||||||
self._status = "Idle" # 初始状态为 Idle
|
self._status = "Idle" # 初始状态为 Idle
|
||||||
self._success = False # 初始成功状态为 False
|
self._success = False # 初始成功状态为 False
|
||||||
self._status_queue = kwargs.get("status_queue", None) # 状态队列
|
self._status_queue = kwargs.get("status_queue", None) # 状态队列
|
||||||
@@ -421,7 +421,6 @@ class LiquidHandlerBiomek(LiquidHandlerAbstract):
|
|||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
|
||||||
steps_info = '''
|
steps_info = '''
|
||||||
{
|
{
|
||||||
"steps": [
|
"steps": [
|
||||||
@@ -684,33 +683,20 @@ if __name__ == "__main__":
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
'''
|
'''
|
||||||
|
labware_with_liquid = '''
|
||||||
|
[ {
|
||||||
|
"id": "stock plate on P1",
|
||||||
labware_with_liquid = '''
|
"parent": "deck",
|
||||||
[ {
|
"slot_on_deck": "P1",
|
||||||
"id": "stock plate on P1",
|
"class_name": "nest_12_reservoir_15ml",
|
||||||
"parent": "deck",
|
"liquid_type": [
|
||||||
"slot_on_deck": "P1",
|
"master_mix"
|
||||||
"class_name": "nest_12_reservoir_15ml",
|
],
|
||||||
"liquid_type": [
|
"liquid_volume": [10000],
|
||||||
"master_mix"
|
"liquid_input_wells": [
|
||||||
],
|
"A1"
|
||||||
"liquid_volume": [10000],
|
]
|
||||||
"liquid_input_wells": [
|
},
|
||||||
"A1"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "Tip Rack BC230 TL2",
|
|
||||||
"parent": "deck",
|
|
||||||
"slot_on_deck": "TL2",
|
|
||||||
"class_name": "BC230",
|
|
||||||
"liquid_type": [],
|
|
||||||
"liquid_volume": [],
|
|
||||||
"liquid_input_wells": [
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"id": "Tip Rack BC230 TL2",
|
"id": "Tip Rack BC230 TL2",
|
||||||
"parent": "deck",
|
"parent": "deck",
|
||||||
@@ -722,215 +708,222 @@ labware_with_liquid = '''
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "Tip Rack BC230 on TL3",
|
"id": "Tip Rack BC230 TL2",
|
||||||
"parent": "deck",
|
"parent": "deck",
|
||||||
"slot_on_deck": "TL3",
|
"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 on TL4",
|
|
||||||
"parent": "deck",
|
|
||||||
"slot_on_deck": "TL4",
|
|
||||||
"class_name": "BC230",
|
|
||||||
"liquid_type": [],
|
|
||||||
"liquid_volume": [],
|
|
||||||
"liquid_input_wells": [
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "Tip Rack BC230 on TL5",
|
|
||||||
"parent": "deck",
|
|
||||||
"slot_on_deck": "TL5",
|
|
||||||
"class_name": "BC230",
|
|
||||||
"liquid_type": [],
|
|
||||||
"liquid_volume": [],
|
|
||||||
"liquid_input_wells": [
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"id": "Tip Rack BC230 on P5",
|
"id": "Tip Rack BC230 on TL3",
|
||||||
"parent": "deck",
|
"parent": "deck",
|
||||||
"slot_on_deck": "P5",
|
"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 on TL4",
|
||||||
|
"parent": "deck",
|
||||||
|
"slot_on_deck": "TL4",
|
||||||
|
"class_name": "BC230",
|
||||||
|
"liquid_type": [],
|
||||||
|
"liquid_volume": [],
|
||||||
|
"liquid_input_wells": [
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "Tip Rack BC230 on TL5",
|
||||||
|
"parent": "deck",
|
||||||
|
"slot_on_deck": "TL5",
|
||||||
|
"class_name": "BC230",
|
||||||
|
"liquid_type": [],
|
||||||
|
"liquid_volume": [],
|
||||||
|
"liquid_input_wells": [
|
||||||
|
]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"id": "Tip Rack BC230 on P6",
|
"id": "Tip Rack BC230 on P5",
|
||||||
"parent": "deck",
|
"parent": "deck",
|
||||||
"slot_on_deck": "P6",
|
"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 on P7",
|
"id": "Tip Rack BC230 on P6",
|
||||||
"parent": "deck",
|
"parent": "deck",
|
||||||
"slot_on_deck": "P7",
|
"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 on P8",
|
"id": "Tip Rack BC230 on P7",
|
||||||
"parent": "deck",
|
"parent": "deck",
|
||||||
"slot_on_deck": "P8",
|
"slot_on_deck": "P7",
|
||||||
"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 P8",
|
||||||
"parent": "deck",
|
"parent": "deck",
|
||||||
"slot_on_deck": "P16",
|
"slot_on_deck": "P8",
|
||||||
"class_name": "BC230",
|
"class_name": "BC230",
|
||||||
"liquid_type": [],
|
"liquid_type": [],
|
||||||
"liquid_volume": [],
|
"liquid_volume": [],
|
||||||
"liquid_input_wells": [
|
"liquid_input_wells": [
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"id": "stock plate on 4",
|
|
||||||
"parent": "deck",
|
|
||||||
"slot_on_deck": "P2",
|
|
||||||
"class_name": "nest_12_reservoir_15ml",
|
|
||||||
"liquid_type": [
|
|
||||||
"bind beads"
|
|
||||||
],
|
|
||||||
"liquid_volume": [10000],
|
|
||||||
"liquid_input_wells": [
|
|
||||||
"A1"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "stock plate on P2",
|
|
||||||
"parent": "deck",
|
|
||||||
"slot_on_deck": "P2",
|
|
||||||
"class_name": "nest_12_reservoir_15ml",
|
|
||||||
"liquid_type": [
|
|
||||||
"bind beads"
|
|
||||||
],
|
|
||||||
"liquid_volume": [10000],
|
|
||||||
"liquid_input_wells": [
|
|
||||||
"A1"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "stock plate on P3",
|
|
||||||
"parent": "deck",
|
|
||||||
"slot_on_deck": "P3",
|
|
||||||
"class_name": "nest_12_reservoir_15ml",
|
|
||||||
"liquid_type": [
|
|
||||||
"ethyl alcohol"
|
|
||||||
],
|
|
||||||
"liquid_volume": [10000],
|
|
||||||
"liquid_input_wells": [
|
|
||||||
"A1"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
|
|
||||||
{
|
|
||||||
"id": "oscillation",
|
|
||||||
"parent": "deck",
|
|
||||||
"slot_on_deck": "Orbital1",
|
|
||||||
"class_name": "Orbital",
|
|
||||||
"liquid_type": [],
|
|
||||||
"liquid_volume": [],
|
|
||||||
"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",
|
"id": "Tip Rack BC230 P16",
|
||||||
"parent": "deck",
|
"parent": "deck",
|
||||||
"slot_on_deck": "P12",
|
"slot_on_deck": "P16",
|
||||||
"class_name": "magnetics module",
|
"class_name": "BC230",
|
||||||
"liquid_type": [],
|
"liquid_type": [],
|
||||||
"liquid_volume": [],
|
"liquid_volume": [],
|
||||||
"liquid_input_wells": [
|
"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",
|
"id": "stock plate on 4",
|
||||||
"parent": "deck",
|
"parent": "deck",
|
||||||
"slot_on_deck": "P22",
|
"slot_on_deck": "P2",
|
||||||
"class_name": "nest_1_reservoir_195ml",
|
"class_name": "nest_12_reservoir_15ml",
|
||||||
"liquid_type": [
|
"liquid_type": [
|
||||||
],
|
"bind beads"
|
||||||
"liquid_volume": [],
|
],
|
||||||
"liquid_input_wells": [
|
"liquid_volume": [10000],
|
||||||
]
|
"liquid_input_wells": [
|
||||||
}
|
"A1"
|
||||||
]
|
]
|
||||||
|
},
|
||||||
'''
|
{
|
||||||
|
"id": "stock plate on P2",
|
||||||
|
"parent": "deck",
|
||||||
|
"slot_on_deck": "P2",
|
||||||
handler = LiquidHandlerBiomek()
|
"class_name": "nest_12_reservoir_15ml",
|
||||||
|
"liquid_type": [
|
||||||
handler.temp_protocol = {
|
"bind beads"
|
||||||
"meta": {},
|
],
|
||||||
"labwares": [],
|
"liquid_volume": [10000],
|
||||||
"steps": []
|
"liquid_input_wells": [
|
||||||
}
|
"A1"
|
||||||
|
]
|
||||||
input_steps = json.loads(steps_info)
|
},
|
||||||
labwares = json.loads(labware_with_liquid)
|
{
|
||||||
|
"id": "stock plate on P3",
|
||||||
for step in input_steps['steps']:
|
"parent": "deck",
|
||||||
operation = step['operation']
|
"slot_on_deck": "P3",
|
||||||
parameters = step['parameters']
|
"class_name": "nest_12_reservoir_15ml",
|
||||||
|
"liquid_type": [
|
||||||
if operation == 'transfer':
|
"ethyl alcohol"
|
||||||
handler.transfer_biomek(source=parameters['source'],
|
],
|
||||||
target=parameters['target'],
|
"liquid_volume": [10000],
|
||||||
volume=parameters['volume'],
|
"liquid_input_wells": [
|
||||||
tip_rack=parameters['tip_rack'],
|
"A1"
|
||||||
aspirate_techniques='MC P300 high',
|
]
|
||||||
dispense_techniques='MC P300 high')
|
},
|
||||||
elif operation == 'move_labware':
|
|
||||||
handler.move_biomek(source=parameters['source'],
|
{
|
||||||
target=parameters['target'])
|
"id": "oscillation",
|
||||||
elif operation == 'oscillation':
|
"parent": "deck",
|
||||||
handler.oscillation_biomek(rpm=parameters['rpm'],
|
"slot_on_deck": "Orbital1",
|
||||||
time=parameters['time'])
|
"class_name": "Orbital",
|
||||||
elif operation == 'incubation':
|
"liquid_type": [],
|
||||||
handler.incubation_biomek(time=parameters['time'])
|
"liquid_volume": [],
|
||||||
|
"liquid_input_wells": [
|
||||||
print(json.dumps(handler.temp_protocol, indent=4))
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"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 = LiquidHandlerBiomek()
|
||||||
|
|
||||||
|
handler.temp_protocol = {
|
||||||
|
"meta": {},
|
||||||
|
"labwares": [],
|
||||||
|
"steps": []
|
||||||
|
}
|
||||||
|
|
||||||
|
input_steps = json.loads(steps_info)
|
||||||
|
labwares = json.loads(labware_with_liquid)
|
||||||
|
|
||||||
|
for step in input_steps['steps']:
|
||||||
|
operation = step['operation']
|
||||||
|
parameters = step['parameters']
|
||||||
|
|
||||||
|
if operation == 'transfer':
|
||||||
|
handler.transfer_biomek(source=parameters['source'],
|
||||||
|
target=parameters['target'],
|
||||||
|
volume=parameters['volume'],
|
||||||
|
tip_rack=parameters['tip_rack'],
|
||||||
|
aspirate_techniques='MC P300 high',
|
||||||
|
dispense_techniques='MC P300 high')
|
||||||
|
elif operation == 'move_labware':
|
||||||
|
handler.move_biomek(source=parameters['source'],
|
||||||
|
target=parameters['target'])
|
||||||
|
elif operation == 'oscillation':
|
||||||
|
handler.oscillation_biomek(rpm=parameters['rpm'],
|
||||||
|
time=parameters['time'])
|
||||||
|
elif operation == 'incubation':
|
||||||
|
handler.incubation_biomek(time=parameters['time'])
|
||||||
|
|
||||||
|
print(json.dumps(handler.temp_protocol, indent=4))
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -340,6 +340,21 @@ liquid_handler.biomek:
|
|||||||
none_keys: none_keys
|
none_keys: none_keys
|
||||||
feedback: {}
|
feedback: {}
|
||||||
result: {}
|
result: {}
|
||||||
|
handles:
|
||||||
|
input:
|
||||||
|
- handler_key: liquid-input
|
||||||
|
label: Liquid Input
|
||||||
|
data_type: resource
|
||||||
|
io_type: target
|
||||||
|
data_source: handle
|
||||||
|
data_key: liquid
|
||||||
|
output:
|
||||||
|
- handler_key: liquid-output
|
||||||
|
label: Liquid Output
|
||||||
|
data_type: resource
|
||||||
|
io_type: source
|
||||||
|
data_source: executor
|
||||||
|
data_key: liquid
|
||||||
transfer_biomek:
|
transfer_biomek:
|
||||||
type: LiquidHandlerTransferBiomek
|
type: LiquidHandlerTransferBiomek
|
||||||
goal:
|
goal:
|
||||||
@@ -351,6 +366,21 @@ liquid_handler.biomek:
|
|||||||
dispense_techniques: dispense_techniques
|
dispense_techniques: dispense_techniques
|
||||||
feedback: {}
|
feedback: {}
|
||||||
result: {}
|
result: {}
|
||||||
|
handles:
|
||||||
|
input:
|
||||||
|
- handler_key: liquid-input
|
||||||
|
label: Liquid Input
|
||||||
|
data_type: resource
|
||||||
|
io_type: target
|
||||||
|
data_source: handle
|
||||||
|
data_key: liquid
|
||||||
|
output:
|
||||||
|
- handler_key: liquid-output
|
||||||
|
label: Liquid Output
|
||||||
|
data_type: resource
|
||||||
|
io_type: source
|
||||||
|
data_source: executor
|
||||||
|
data_key: liquid
|
||||||
schema:
|
schema:
|
||||||
type: object
|
type: object
|
||||||
properties: {}
|
properties: {}
|
||||||
|
|||||||
Reference in New Issue
Block a user