def setUp(self): Robot.reset() self.robot = Robot.get_instance() # self.robot.connect(port='/dev/tty.usbmodem1421') # self.robot.home() self.trash = containers.load('point', 'A1', 'trash') self.tiprack = containers.load('tiprack-200ul', 'B2', 'p200-rack') self.trough = containers.load('trough-12row', 'B2', 'trough') self.plate = containers.load('96-flat', 'A2', 'magbead') self.p200 = instruments.Pipette( name="p200", trash_container=self.trash, tip_racks=[self.tiprack], min_volume=10, # These are variable axis="b", channels=1) self.p1000 = instruments.Pipette( name="p1000", trash_container=self.trash, tip_racks=[self.tiprack], min_volume=100, # These are variable axis="a", channels=1)
def setUp(self): self.robot = Robot.reset() options = { 'limit_switches': True, 'firmware': 'v1.0.5', 'config': { 'ot_version': 'one_pro', 'version': 'v1.0.3', # config version 'alpha_steps_per_mm': 80.0, 'beta_steps_per_mm': 80.0 } } self.robot.connect(options=options) self.robot.home() self.trash = containers.load('point', 'A1') self.tiprack = containers.load('tiprack-10ul', 'B2') self.plate = containers.load('96-flat', 'A2') self.p200 = instruments.Pipette( trash_container=self.trash, tip_racks=[self.tiprack], min_volume=10, # These are variable axis="b", channels=1 ) self.p200.calibrate_plunger(top=0, bottom=10, blow_out=12, drop_tip=13) self.p200.set_max_volume(200)
def test_serial_dilution(self): plate = containers.load('96-flat', 'B1', 'plate') tiprack = containers.load( 'tiprack-200ul', # container type from library 'A1', # slot on deck 'tiprack' # calibration reference for 1.2 compatibility ) trough = containers.load('trough-12row', 'B1', 'trough') trash = containers.load('point', 'A2', 'trash') p200 = instruments.Pipette( trash_container=trash, tip_racks=[tiprack], min_volume=10, # These are variable axis="b", channels=1) p200.set_max_volume(200) p200.calibrate_plunger(top=0, bottom=10, blow_out=12, drop_tip=13) for t, col in enumerate(plate.cols): p200.pick_up_tip(tiprack[t]) p200.aspirate(10, trough[t]) p200.dispense(10, col[0]) for well, next_well in zip(col[:-1], col[1:]): p200.aspirate(10, well) p200.dispense(10, next_well).mix(3) p200.drop_tip(trash)
def test_get_instruments_by_name(self): self.p1000 = instruments.Pipette( trash_container=self.trash, tip_racks=[self.tiprack], min_volume=10, # These are variable axis="a", name="p1000", channels=1, aspirate_speed=300, dispense_speed=500 ) result = list(self.robot.get_instruments('p1000')) self.assertListEqual(result, [('A', self.p1000)])
def test_protocol_head(self): trash = containers.load('point', 'A1', 'myTrash') tiprack = containers.load('tiprack-10ul', 'B2') p200 = instruments.Pipette( name='myPipette', trash_container=trash, tip_racks=[tiprack], min_volume=10, # These are variable axis="b", channels=1 ) instruments_list = self.robot.get_instruments() self.assertEqual(instruments_list[0], ('B', p200)) instruments_list = self.robot.get_instruments('myPipette') self.assertEqual(instruments_list[0], ('B', p200))
def protocol(self): robot = Robot.get_instance() robot.get_serial_ports_list() options = { 'limit_switches': True, 'firmware': 'v1.0.5', 'config': { 'ot_version': 'one_pro', 'version': 'v1.0.3', # config version 'alpha_steps_per_mm': 80.0, 'beta_steps_per_mm': 80.0 } } robot.connect(options=options) robot.home() tiprack = containers.load( 'tiprack-200ul', # container type 'A1', # slot 'tiprack' # user-defined name ) plate = containers.load('96-flat', 'B1', 'plate') trash = containers.load('point', 'C2', 'trash') trough = containers.load('trough-12row', 'B2', 'trough') p200 = instruments.Pipette(name="p200", trash_container=trash, tip_racks=[tiprack], min_volume=0.5, axis="b", channels=1) p200.set_max_volume(200) calibration_data = """ { "b": { "blowout": 28.0, "bottom": 26.0, "droptip": 32.0, "resting": 0, "theContainers": { "plate": { "rel_x": 181.696, "rel_y": 0.700999999999965, "rel_z": 9.600999999999999, "x": 202.195, "y": 370.304, "z": 125.7 }, "tiprack": { "rel_x": 0.0, "rel_y": 0.0, "rel_z": 0.0, "x": 20.499, "y": 369.603, "z": 116.099 }, "trough": { "rel_x": 0.0, "rel_y": 0.0, "rel_z": 0.0, "x": 20.499, "y": 269.603, "z": 116.099 }, "trash": { "rel_x": 212.701, "rel_y": -200.801, "rel_z": -58.399, "x": 233.2, "y": 171.305, "z": 57.7 } }, "tip_rack_origin": "tiprack", "tip_racks": [ { "container": "tiprack" } ], "top": 13.0, "trash_container": { "container": "trash" }, "volume": 200 } } """ import_calibration_json(calibration_data, robot, True) robot.clear() # distribute p200.pick_up_tip(tiprack[0]) p200.aspirate(96 * 2, trough[0]) for i in range(96): p200.dispense(2, plate[i]).touch_tip() p200.drop_tip(tiprack[0]) p200.pick_up_tip(tiprack[1]) for i in range(96): p200.aspirate(2, plate[95 - i]) p200.dispense(trough[0]) p200.drop_tip(tiprack[1])
def process_head(self): """ res example: { name: { 'instance': .., 'settings': {'down-plunger-speed', ' } } :return: """ head_dict = self.protocol['head'] SUPPORTED_TOOL_OPTIONS = { 'tool', 'tip-racks', 'trash-container', 'multi-channel', 'axis', 'volume', 'down-plunger-speed', 'up-plunger-speed', 'tip-plunge', 'extra-pull-volume', 'extra-pull-delay', 'distribute-percentage', 'points' } head_obj = {} for tool_name, tool_config in head_dict.items(): # Validate tool_config keys # Create a warning if unknown keys are detected user_provided_tool_options = set(tool_config.keys()) if not (SUPPORTED_TOOL_OPTIONS >= user_provided_tool_options): invalid_options = (user_provided_tool_options - SUPPORTED_TOOL_OPTIONS) self.warnings.append( 'Encountered unsupported tool options for "{}": {}'.format( tool_name, ', '.join(invalid_options))) tool_config.pop('tool') tool_instance = instruments.Pipette( name=tool_name, axis=tool_config.pop('axis'), min_volume=0, channels=(8 if tool_config.pop('multi-channel') else 1), ) tool_instance.set_max_volume(tool_config.pop('volume')) # robot_containers = robot._deck.containers() tip_rack_objs = [ self.deck[item['container']]['instance'] for item in tool_config.pop('tip-racks') ] tool_config['tip-racks'] = tip_rack_objs trash_obj = self.deck[tool_config.pop('trash-container') ['container']]['instance'] tool_config['trash-container'] = trash_obj tool_config['points'] = [ dict(i) for i in tool_config.pop('points') ] head_obj[tool_name] = { 'instance': tool_instance, 'settings': dict(tool_config) } self.head = head_obj