async def test_multi_single(main_router, protocol, protocol_file, dummy_db): robot.connect() robot.home() session = main_router.session_manager.create(name='<blank>', text=protocol.text) await main_router.wait_until(state('session', 'loaded')) main_router.calibration_manager.move_to(session.instruments[0], session.containers[2])
def opentrons_connect(): try: # physical robot ports = robot.get_serial_ports_list() print(ports) robot.connect(ports[0]) except IndexError: # simulator robot.connect('Virtual Smoothie') robot.home(now=True)
def add_base_reagent(reaction_condition): id_header = "reaction" reaction_to_start = "Coupling_urea_sulpho" solvent_trough_location_header = "additional solvent location" volume_solvent_header = "Additional solvent to add (uL)" base_trough_location_header = "Location Base" reagent_trough_location_header = "Location Reagent 3" volume_base_header = "Volume to dispense Base" volume_reagent_header = "Volume to dispense Reagent 3" rows_number_header = "Number rows" for index, value in enumerate(reaction_conditions_df[id_header].tolist()): if value == reaction_to_start: volume_solvent = float( reaction_conditions_df[volume_solvent_header].tolist()[index]) solvent_trough_location = reaction_conditions_df[ solvent_trough_location_header].tolist()[index] volume_base = float( reaction_conditions_df[volume_base_header].tolist()[index]) volume_reagent = float( reaction_conditions_df[volume_reagent_header].tolist()[index]) base_trough_location = reaction_conditions_df[ base_trough_location_header].tolist()[index] reagent_trough_location = reaction_conditions_df[ reagent_trough_location_header].tolist()[index] number_rows = int( reaction_conditions_df[rows_number_header].tolist()[index]) volume_list = [volume_reagent] concentration_list = [reagent_trough_location] for i, v in enumerate(volume_list): p300_multi.pick_up_tip() p300_multi.distribute( v, source_trough12row.wells(concentration_list[i]), [ x.top() for x in reaction_rack.rows(0, to=number_rows - 1) ], new_tip="never") p300_multi.distribute( v, source_trough12row.wells(concentration_list[i]), [ x.top() for x in reaction_rack2.rows(0, to=number_rows - 1) ], new_tip="never") p300_multi.distribute( v, source_trough12row.wells(concentration_list[i]), [ x.top() for x in reaction_rack3.rows(0, to=number_rows - 1) ], new_tip="never") p300_multi.drop_tip() robot.home()
def test_robot_move_to(virtual_smoothie_env): robot.reset() robot.home() p300 = instruments.P300_Single(mount='right') robot.move_to((robot._deck, (100, 0, 0)), p300) assert isclose( pose_tracker.absolute( robot.poses, p300), (100, 0, 0) ).all()
async def test_move_mount(virtual_smoothie_env, loop, test_client): app = init(loop) cli = await loop.create_task(test_client(app)) robot.home() # from opentrons.trackers import pose_tracker # print("Before: {}".format(tuple( # pose_tracker.absolute( # robot.poses, robot._actuators['right']['carriage'])))) data = {'target': 'mount', 'point': [100, 200, 50], 'mount': 'right'} res = await cli.post('/robot/move', json=data) assert res.status == 200
def _test_offset(x, y, z): robot.reset() robot.config = robot.config._replace(mount_offset=(x, y, z)) left = instruments.P300_Single(mount='left') right = instruments.P300_Single(mount='right') robot.home() left_pos = pose_tracker.absolute(robot.poses, left) right_pos = pose_tracker.absolute(robot.poses, right) assert left_pos[0] == right_pos[0] + x assert left_pos[1] == right_pos[1] + y assert left_pos[2] == right_pos[2] + z
def mainReactant_transfer(reactant, reaction): # Deck setup tiprack_1000 = containers.load("tiprack-1000ul-H", "B3") #source_trough12row = containers.load("trough-12row", "C1") location_stock = containers.load("FluidX_24_2ml", "A1") reaction_rack = containers.load("StarLab_96_tall", "D1") trash = containers.load("point", "C3") # Pipettes SetUp p1000 = instruments.Pipette( name='eppendorf1000', axis='b', trash_container=trash, tip_racks=[tiprack_1000], max_volume=1000, min_volume=30, channels=1, ) id_header = "reaction" reaction_to_start = "Coupling_sequence" main_reactant_volume_header = "main reactant volume to add - per reaction (uL)" main_reactant_location_header = "Location 24 vial rack" volume_max_header = "Volume max per vial" nb_reaction_header = "Number reaction" for index, value in enumerate(reaction_conditions_df[id_header].tolist()): if value == reaction_to_start: volume_per_reaction = float(reaction_conditions_df[main_reactant_volume_header].tolist()[index]) nb_reactions = int(reaction_conditions_df[nb_reaction_header].tolist()[index]) reaction_counter = 0 """In each well, the volume per reaction of reaction is dispensed, successively in the logical order ("A1", "A2"...). When the maximum amount of reactant in one vial is taken out, the following vial in the fluidx rack is used. The transfer stops when the reactant is dispensed in all the wells of the 96 plate or all the wells used for the batch.""" for index, value in enumerate(reaction_df[main_reactant_location_header].tolist()): if reaction_counter < nb_reactions: nb_reaction_per_vial = int(float(reaction_df[volume_max_header].tolist()[index]) // volume_per_reaction) source_location = value if nb_reactions - reaction_counter < nb_reaction_per_vial: if nb_reactions - reaction_counter == 1: p1000.distribute(volume_per_reaction, location_stock.wells(source_location), reaction_rack.wells(reaction_counter).top()) nb_reaction_per_vial =1 else: p1000.distribute(volume_per_reaction, location_stock.wells(source_location), [x.top() for x in reaction_rack.wells(reaction_counter, to=nb_reactions)]) else: p1000.distribute(volume_per_reaction, location_stock.wells(source_location), [x.top() for x in reaction_rack.wells( reaction_counter, to=reaction_counter + nb_reaction_per_vial - 1)]) reaction_counter = reaction_counter + nb_reaction_per_vial robot.home()
def dmf_iodomethane_multi(reaction_conditions_df): # Deck setup tiprack_300 = containers.load("tiprack-300ul", "D3") source_trough12row = containers.load('trough-12row', "E2") reaction_rack = containers.load("StarLab_96_tall", "D1") trash = containers.load("point", 'C3') # Pipettes SetUp p300_multi = instruments.Pipette( name='dlab_300multi', axis="a", trash_container=trash, tip_racks=[tiprack_300], max_volume=300, min_volume=30, channels=8, ) # The protocol id_header = "reaction" reaction_to_start = "Coupling_sequence" reagent_trough_location_header = "reagent 2 location" volume_reagent_header = "reagent 2 volume" solvent_trough_location_header = "post work up solvent location" solvent_volume_header = "post workup solvent volume" row_number_header = "Number rows" for index, value in enumerate(reaction_conditions_df[id_header].tolist()): if value == reaction_to_start: solvent_volume = float( reaction_conditions_df[solvent_volume_header].tolist()[index]) reagent_volume = float( reaction_conditions_df[volume_reagent_header].tolist()[index]) reagent_trough_location = reaction_conditions_df[ reagent_trough_location_header].tolist()[index] solvent_trough_location = reaction_conditions_df[ solvent_trough_location_header].tolist()[index] number_rows = int( reaction_conditions_df[row_number_header].tolist()[index]) p300_multi.distribute( solvent_volume, source_trough12row.wells(solvent_trough_location), [x.top(-5) for x in reaction_rack.rows(0, to=number_rows)], air_gap=10) robot.pause() p300_multi.distribute( reagent_volume, source_trough12row.wells(reagent_trough_location), [x.top(-5) for x in reaction_rack.rows(0, to=number_rows)], air_gap=10) robot.home()
async def test_move_pipette(virtual_smoothie_env, loop, test_client): app = init(loop) cli = await loop.create_task(test_client(app)) robot.home() data = { 'target': 'pipette', 'point': [100, 200, 50], 'mount': 'right', 'model': 'p300_single_v1' } res = await cli.post('/robot/move', json=data) assert res.status == 200
def stock_solution(amine, solvent): # Deck setup tiprack_1000 = containers.load("tiprack-1000ul-H", "B3") source_trough4row = containers.load("trough-12row", "C2") destination_stock = containers.load("Starlab_96_Square_2mL", "A1", "2mL_rack") trash = containers.load("point", "C3") # Pipettes SetUp p1000 = instruments.Pipette( name='eppendorf1000', axis='b', trash_container=trash, tip_racks=[tiprack_1000], max_volume=1000, min_volume=30, channels=1, ) id_header = "CPD ID" solvent = "DMA" stock_sol1 = "stock reagent 1" location_header = "Location_trough" destination_location_header = "Location" volume_stock_header = "Volume to dispense (uL)" volume_per_vial = "Volume to dispense" volume_inreactionrack_header = "Volume_stock per reaction" for i, x in enumerate(solvent_df[id_header].tolist()): if x == solvent: solvent_location = solvent_df[location_header].tolist()[i] if x == stock_sol1: stock_sol1_loc = solvent_df[location_header].tolist()[i] stock_sol1_volume = solvent_df[volume_stock_header].tolist()[i] # Reagents 1 and/or 2 are transfered to the 24 Fluidx vial rack. p1000.pick_up_tip() for i, x in enumerate( stock_reagent_df[destination_location_header].tolist()): destination_location = x vol_to_dispense = [ stock_reagent_df[volume_inreactionrack_header].tolist()[i] ] stock_id = stock_reagent_df[id_header].tolist()[i] if stock_id == stock_sol1: if vol_to_dispense != 0: p1000.transfer( vol_to_dispense, source_trough4row.wells(stock_sol1_loc), destination_stock.wells(destination_location).top(-5), new_tip='never') p1000.drop_tip() robot.home()
async def test_disengage_axes(virtual_smoothie_env, loop, test_client, monkeypatch): app = init(loop) cli = await loop.create_task(test_client(app)) def mock_send(self, command, timeout=None): pass monkeypatch.setattr(SmoothieDriver_3_0_0, '_send_command', mock_send) alltrue = { "x": { "enabled": True }, "y": { "enabled": True }, "z": { "enabled": True }, "a": { "enabled": True }, "b": { "enabled": True }, "c": { "enabled": True } } res0 = await cli.get('/motors/engaged') result0 = await res0.text() assert res0.status == 200 assert json.loads(result0) == alltrue postres = await cli.post('/motors/disengage', json={'axes': ['X', 'B']}) assert postres.status == 200 xbfalse = deepcopy(alltrue) xbfalse["x"]["enabled"] = False xbfalse["b"]["enabled"] = False res1 = await cli.get('/motors/engaged') result1 = await res1.text() assert res1.status == 200 assert json.loads(result1) == xbfalse robot.home() res2 = await cli.get('/motors/engaged') result2 = await res2.text() assert res2.status == 200 assert json.loads(result2) == alltrue
def web_transfer1(data): opentrons_connect() robot.home('xyzab') # calibrate pipette p200 = instruments.Pipette(axis='b', max_volume=200) p200.calibrate_plunger(top=3, bottom=18, blow_out=18, drop_tip=18) p200.update_calibrations() # calibrate labware tiprack = calibrateToSlot(labwareDict[data['tiprack']['labware']], 'tiprack', data['tiprack']['slot'], data['tiprack']['coords'], p200) source = calibrateToSlot(labwareDict[data['source']['labware']], 'source', data['source']['slot'], data['source']['coords'], p200) dest = calibrateToSlot(labwareDict[data['dest']['labware']], 'dest', data['dest']['slot'], data['dest']['coords'], p200) print("type labware", type(source)) # the actual transfer source_wells = data['source']['wells'] dest_wells = data['dest']['wells'] vol = data['parameters']['volume'] print("volume: ", vol) print("source", source_wells) print("dest", dest_wells) # make well dictionary wells = {} for source_well, dest_well in zip(source_wells, dest_wells): wells.update({source_well: dest_well}) print("wells", wells) print("starting transfers") p200.pick_up_tip(tiprack.wells('A1')) for key, value in wells.items(): p200.aspirate(vol, source.wells(key)) p200.dispense(dest.wells(value)) # robot.run() print("finished transfers") # somehow the opentrons transfer functions calls an error???!! # since demo is tomorrow, easier to make my own dumb transfer functionf or now # p200.transfer(vol, source.wells(source_wells), dest.wells(dest_wells)) print("transfer done!") robot.home('xyzab') robot.disconnect()
def stock_solution_main(reaction_conditions, reactants): # Deck setup tiprack_1000 = containers.load("tiprack-1000ul-H", "B3") source_trough4row = containers.load("trough-12row", "C2") trash = containers.load("point", "C3") # Pipettes SetUp p1000 = instruments.Pipette( name='eppendorf1000', axis='b', trash_container=trash, tip_racks=[tiprack_1000], max_volume=1000, min_volume=30, channels=1, ) id_header = "reaction" reaction_to_start = "Coupling_sequence" solvent_trough_location_header = "main reactant solvent Location" volume_stock_header = "main reactant volume to add - stock (uL)" destination_header = "main reactant location" additional_base_header = "Additional solvent to add (uL)" additional_base_location_header = "additional solvent location" for index, value in enumerate(reaction_conditions_df[id_header].tolist()): if value == reaction_to_start: solvent_location = reaction_conditions_df[ solvent_trough_location_header].tolist()[index] solvent_volume = reaction_conditions_df[ volume_stock_header].tolist()[index] destination_location = reaction_conditions_df[ destination_header].tolist()[index] base_to_add = reaction_conditions_df[ additional_base_header].tolist()[index] base_location = reaction_conditions_df[ additional_base_location_header].tolist()[index] p1000.pick_up_tip() p1000.transfer([solvent_volume], source_trough4row.wells(solvent_location), source_trough4row.wells(destination_location).top(-5), new_tip='never') p1000.drop_tip() p1000.pick_up_tip() p1000.transfer([base_to_add], source_trough4row.wells(base_location), source_trough4row.wells(destination_location).top(-5), new_tip='never') p1000.drop_tip() robot.home()
def home(axis): status = 'success' result = '' try: if axis == 'undefined' or axis == '' or axis.lower() == 'all': result = robot.home(enqueue=False) else: result = robot.home(axis, enqueue=False) emit_notifications(["Successfully homed"], 'info') except Exception as e: result = str(e) status = 'error' emit_notifications([result], 'danger') return flask.jsonify({'status': status, 'data': result})
def opentrons_connect(ignore=''): try: # physical robot ports = robot.get_serial_ports_list() print(ports) for port in ports: if port == ignore: continue robot.connect(port) break except IndexError: # simulator robot.connect('Virtual Smoothie') robot.home(now=True)
def main(): """ A CLI application for performing factory calibration of an Opentrons robot Instructions: - Robot must be set up with a 300ul single-channel pipette installed on the right-hand mount. - Put a GEB 300ul tip onto the pipette. - Use the arrow keys to jog the robot over an open area of the deck (the base deck surface, not over a ridge or numeral engraving). You can use the '-' and '=' keys to decrease or increase the amount of distance moved with each jog action. - Use the 'q' and 'a' keys to jog the pipette up and down respectively until the tip is just touching the deck surface, then press 'z'. - Press '1' to automatically go to the expected location of the first calibration point. Jog the robot until the tip is actually at the point, then press 'enter'. - Repeat with '2' and '3'. - After calibrating all three points, press the space bar to save the configuration. - Optionally, press 4,5,6 or 7 to validate the new configuration. - Press 'p' to perform tip probe. - Press 'esc' to exit the program. """ prompt = input( ">>> Warning! Running this tool backup and clear any previous " "calibration data. Proceed (y/[n])? ") if prompt not in ['y', 'Y', 'yes']: print('Exiting--prior configuration data not changed') sys.exit() backup_configuration_and_reload() robot.connect() robot.home() # lights help the script user to see the points on the deck robot.turn_on_rail_lights() atexit.register(robot.turn_off_rail_lights) # Notes: # - 200ul tip is 51.7mm long when attached to a pipette # - For xyz coordinates, (0, 0, 0) is the lower-left corner of the robot cli = CLITool( point_set=get_calibration_points(), tip_length=51.7) cli.ui_loop.run() print('Robot config: \n', robot.config)
async def home(request): """ This initializes a call to pipette.home() which, as a side effect will: 1. Check the pipette is actually connected (will throw an error if you try to home a non-connected pipette) 2. Re-engages the motor :param request: Information obtained from a POST request. The content type is application/json. The correct packet form should be as follows: { 'target': Can be, 'robot' or 'pipette' 'mount': 'left' or 'right', only used if target is pipette } :return: A success or non-success message. """ req = await request.text() data = json.loads(req) target = data.get('target') if target in ['robot', 'pipette']: if target == 'robot': robot.home() status = 200 message = "Homing robot." else: mount = data.get('mount') if mount in ['left', 'right']: pipette = _fetch_or_create_pipette(mount) pipette.home() robot.remove_instrument(mount) status = 200 message = "Pipette on {} homed successfully.".format(mount) else: status = 400 message = "Expected 'left' or 'right' as values for mount" \ "got {} instead.".format(mount) else: status = 400 message = "Expected 'robot' or 'pipette' got {}.".format(target) return web.json_response({"message": message}, status=status)
def add_base_reagent(reaction_condition): id_header = "reaction" reaction_to_start = "Sulpho_sequence" reagent_trough_location_header = "post reaction 1 dilution solvent location" volume_reagent_header = "post reaction 1 dilution solvent volume" rows_number_header = "Number rows" for index, value in enumerate(reaction_conditions_df[id_header].tolist()): if value == reaction_to_start: volume_reagent = float(reaction_conditions_df[volume_reagent_header].tolist()[index]) reagent_trough_location = reaction_conditions_df[reagent_trough_location_header].tolist()[index] number_rows = int(reaction_conditions_df[rows_number_header].tolist()[index]) p300_multi.distribute(volume_reagent, source_trough12row.wells(reagent_trough_location), [x.top() for x in reaction_rack.rows(0, to=number_rows-1)]) robot.home()
def add_base_reagent(reaction_condition): id_header = "reaction" reaction_to_start = "Coupling_urea_sulpho" reagent_trough_location_header = "split 2 location solvent" volume_reagent_header = "split 2 volume solvent to add" rows_number_header = "split 2 number rows" for index, value in enumerate(reaction_conditions_df[id_header].tolist()): if value == reaction_to_start: volume_reagent = float(reaction_conditions_df[volume_reagent_header].tolist()[index]) reagent_trough_location = reaction_conditions_df[reagent_trough_location_header].tolist()[index] number_rows = int(reaction_conditions_df[rows_number_header].tolist()[index]) p300_multi.distribute(volume_reagent, source_trough12row.wells(reagent_trough_location), [x.top() for x in reaction_rack.rows(0, to=number_rows-1)]) robot.home()
def check_calibration(robot, pipette, container, height=20): if 's' in pipette.name or '200' in pipette.name: sub_location = container.wells(0) elif container.get_type() == 'point': sub_location = container elif 'tiprack' in str(container.get_type()): sub_location = container[0] else: sub_location = container.rows(0) pipette.move_to(sub_location.top(z=height), strategy='arc') ans = ot.request_info('Does it line up? (y/n): ', type='string') if ans != 'n': if 'tiprack' in str(container.get_type()): pipette.move_to(sub_location) else: pipette.move_to(sub_location.top()) ans = ot.request_info('Still aligned? (y/n): ', type='string') if ans != 'n': pipette.move_to(sub_location.bottom()) else: print('Drive OT from here') else: ans = ot.request_info('Need to rehome? (y/n): ', type='string') if ans != 'n': robot.home() ans = ot.request_info('Try a little higher? (y/n): ', type='string') if ans != 'n': return check_calibration(robot, pipette, container, height=height + 20) print("Adjust {} calibration".format(container.get_type())) move_ot(pipette) if 'tiprack' in str(container.get_type()): print("Adjust tiprack calibration") check_tips(pipette, sub_location) else: pipette.calibrate_position( (container, container[0].from_center(x=0, y=0, z=-1, reference=container))) return sub_location
def dmf_iodomethane_multi(solvent): # Deck setup tiprack_300 = containers.load("tiprack-300ul", "D3") source_trough12row = containers.load('trough-12row', "E2") reaction_rack = containers.load("StarLab_96_tall", "D1") trash = containers.load("point", 'C3') # Pipettes SetUp p300_multi = instruments.Pipette( name='dlab_300multi', axis="a", trash_container=trash, tip_racks=[tiprack_300], max_volume=300, min_volume=30, channels=8, ) # The protocol id_header = "CPD ID" solvent = "MeCN2" reagent = "MeI" solvent_location_header = "Location_trough" volume_to_dispense_header = "Volume to dispense (uL)" nb_rows_header = "nb_rows" for i, x in enumerate(solvent_df[id_header].tolist()): if x == solvent: solvent_location = solvent_df[solvent_location_header].tolist()[i] solvent_volume = int( solvent_df[volume_to_dispense_header].tolist()[i]) nb_rows = solvent_df[nb_rows_header].tolist()[i] if x == reagent: reagent_location = solvent_df[solvent_location_header].tolist()[i] reagent_volume = int( solvent_df[volume_to_dispense_header].tolist()[i]) p300_multi.distribute( solvent_volume, source_trough12row.wells(solvent_location), [x.top(-5) for x in reaction_rack.rows(0, to=nb_rows)]) p300_multi.distribute( reagent_volume, source_trough12row.wells(reagent_location), [x.top(-5) for x in reaction_rack.rows(0, to=nb_rows)]) robot.home()
def transfer_storageVial(condition, reactant): # Deck setup tiprack_1000 = containers.load("tiprack-1000ul-H", "B3") source_trough4row = containers.load("trough-12row", "C2") #destination_stock = containers.load("Starlab_96_Square_2mL", "A1", "2mL_rack") destination_stock = containers.load("FluidX_24_5ml", "A1", "stock") trash = containers.load("point", "C3") # Pipettes SetUp p1000 = instruments.Pipette( name='eppendorf1000', axis='b', trash_container=trash, tip_racks=[tiprack_1000], max_volume=1000, min_volume=30, channels=1, ) id_header = "reaction" reaction_to_start = "Coupling_sequence" solvent_trough_location_header = "main reactant solvent Location" reactant_trough_location_header = "main reactant location" storage_vial_location_header = "Location 24 vial rack" volume_per_vial_header = "Volume to dispense" for index, value in enumerate(reaction_conditions_df[id_header].tolist()): if value == reaction_to_start: reactant_trough_location = reaction_conditions_df[ reactant_trough_location_header].tolist()[index] # Reactant 1 is transfered to the 24 Fluidx storage vial rack. p1000.pick_up_tip() for i, v in enumerate( stock_reagent_df[storage_vial_location_header].tolist()): vial_location = v volume_to_dispense = [ stock_reagent_df[volume_per_vial_header].tolist()[i] ] if volume_to_dispense != 0: p1000.transfer(volume_to_dispense, source_trough4row.wells(reactant_trough_location), destination_stock.wells(vial_location).top(-5), new_tip='never') p1000.drop_tip() robot.home()
def add_base_reagent(reaction_condition): id_header = "reaction" reaction_to_start = "Coupling_urea_sulpho" split_volume_header = "split volume to take out per reaction" split_number_header = "split number" for index, value in enumerate(reaction_conditions_df[id_header].tolist()): if value == reaction_to_start: volume_per_vial = float( reaction_conditions_df[split_volume_header].tolist()[index]) number_rows = int( reaction_conditions_df[split_number_header].tolist()[index]) #source_location1 = [well.bottom(4) for well in reaction_rack.rows(0, to=number_rows-1)] source_location1 = [reaction_rack.rows(0).bottom(2)] source_location2 = [reaction_rack.rows(1).bottom(2)] source_location3 = [reaction_rack.rows(2).bottom(2)] destination_1 = [ x.top() for x in destination_rack1.rows(0, to=number_rows - 1) ] destination_2 = [ x.top() for x in destination_rack2.rows(0, to=number_rows - 1) ] destination_3 = [ x.top() for x in destination_rack3.rows(0, to=number_rows - 1) ] p300_multi.distribute(volume_per_vial, source_location1, destination_1, air_gap=10) p300_multi.distribute(volume_per_vial, source_location2, destination_2, air_gap=10) p300_multi.distribute(volume_per_vial, source_location3, destination_3, air_gap=10) robot.home()
async def test_move_and_home_existing_pipette(virtual_smoothie_env, loop, test_client): from opentrons import instruments app = init(loop) cli = await loop.create_task(test_client(app)) robot.reset() robot.home() instruments.P300_Single(mount='right') move_data = { 'target': 'pipette', 'point': [100, 200, 50], 'mount': 'right', 'model': 'p300_single_v1' } res = await cli.post('/robot/move', json=move_data) assert res.status == 200 move_data = {'target': 'pipette', 'mount': 'right'} res1 = await cli.post('/robot/home', json=move_data) assert res1.status == 200
async def test_save_z(dc_session): robot.reset() mount = 'left' model = 'p10_single_v1' pip = instruments.P10_Single(mount=mount) dc_session.pipettes = {mount: pip} dc_session.current_mount = 'Z' dc_session.current_model = model dc_session.tip_length = 25 dc_session.pipettes.get(mount)._add_tip(dc_session.tip_length) robot.home() z_target = 80.0 dc_session.pipettes.get(mount).move_to((robot.deck, (0, 0, z_target))) await endpoints.save_z({}) new_z = dc_session.z_value expected_z = z_target assert new_z == expected_z
def web_transfer(source_data, dest_data, vol): opentrons_connect() robot.home('xyzab') p200 = instruments.Pipette(axis='b', max_volume=200) # "drop_tip": 18.01, # "top": 3.01, # "blow_out": 18.01, # "bottom": 18.01 p200.calibrate_plunger(top=3, bottom=18, blow_out=18, drop_tip=18) p200.update_calibrations() # make well dictionary wells = {} for source, dest in zip(source_data['wells'], dest_data['wells']): wells.update({source: dest}) print("protocols.py:", wells) transfer(p200, source_data, dest_data, wells, vol) print("robot homing") robot.home('xyzab') robot.disconnect()
async def test_save_xy(dc_session): robot.reset() mount = 'left' pip = instruments.P10_Single(mount=mount) dc_session.pipettes = {mount: pip} dc_session.current_mount = 'Z' dc_session.tip_length = 25 dc_session.pipettes.get(mount)._add_tip(dc_session.tip_length) robot.home() x = 100 y = 101 dc_session.pipettes.get(mount).move_to((robot.deck, (x, y, 102))) point = '1' data = {'point': point} await endpoints.save_xy(data) actual = dc_session.points[point] expected = (robot._driver.position['X'] + robot.config.mount_offset[0], robot._driver.position['Y']) assert actual == expected
def add_base_reagent(reaction_condition): id_header = "reaction" reaction_to_start = "Coupling_sequence" split_volume_header = "split volume to take out per reaction" number_rows_header = "Number rows" for index, value in enumerate(reaction_conditions_df[id_header].tolist()): if value == reaction_to_start: volume_per_reaction = float( reaction_conditions_df[split_volume_header].tolist()[index]) number_rows = int( reaction_conditions_df[number_rows_header].tolist()[index]) #source_location1 = [well.bottom(4) for well in reaction_rack.rows(0, to=number_rows-1)] #source_location2 = [reaction_rack.rows(1).bottom(2)] #source_location3 = [reaction_rack.rows(2).bottom(2)] for i in range(0, 9): #p300_multi.pick_up_tip() source_location = reaction_rack.rows(i).bottom(5) destination_1 = destination_rack1.rows(i).top() #destination_2 = destination_rack2.rows(i).top() #destination_3 = destination_rack3.rows(i).top() p300_multi.distribute(volume_per_reaction, source_location, destination_1, air_gap=10, blow_out=True) #p300_multi.distribute(volume_per_reaction, source_location,destination_2, air_gap=10, new_tip='never') #p300_multi.distribute(volume_per_reaction, source_location,destination_3, air_gap=10, new_tip='never') #p300_multi.drop_tip() #p300_multi.distribute(volume_per_reaction, source_location,destination_2, air_gap=10,change_tip = "never") #p300_multi.distribute(volume_per_reaction, source_location,destination_3, air_gap=10,change_tip = "never") robot.home()
def stock_solution(amine, solvent): # Deck setup tiprack_1000 = containers.load("tiprack-1000ul-H", "B3") source_trough4row = containers.load("trough-12row", "C2") trash = containers.load("point", "C3") # Pipettes SetUp p1000 = instruments.Pipette( name='eppendorf1000', axis='b', trash_container=trash, tip_racks=[tiprack_1000], max_volume=1000, min_volume=30, channels=1, ) id_header = "CPD ID" solvent = "DMA" stock_sol1 = "stock reagent 2" location_header = "Location_trough" destination_location_header = "Location" volume_stock_header = "Volume to dispense (uL)" volume_per_vial = "Volume to dispense" for i, x in enumerate(solvent_df[id_header].tolist()): if x == solvent: solvent_location = solvent_df[location_header].tolist()[i] if x == stock_sol1: stock_sol1_loc = solvent_df[location_header].tolist()[i] stock_sol1_volume = solvent_df[volume_stock_header].tolist()[i] # Using the desired solvent, dilution of reagents 1 and/or 2 to the desired conc, in the big trough p1000.pick_up_tip() p1000.transfer([stock_sol1_volume], source_trough4row.wells(solvent_location), source_trough4row.wells(stock_sol1_loc).top(-5), new_tip='never') p1000.drop_tip() robot.home()
def add_base_reagent(reaction_condition): id_header = "reaction" reaction_to_start = "Coupling_standard" base_trough_location_header = "Location Base" reagent_trough_location_header = "Location Reagent 3" volume_base_header = "Volume to dispense Base" volume_reagent_header = "Volume to dispense Reagent 3" rows_number_header = "Number rows" for index, value in enumerate(reaction_conditions_df[id_header].tolist()): if value == reaction_to_start: volume_base = float(reaction_conditions_df[volume_base_header].tolist()[index]) volume_reagent = float(reaction_conditions_df[volume_reagent_header].tolist()[index]) base_trough_location = reaction_conditions_df[base_trough_location_header].tolist()[index] reagent_trough_location = reaction_conditions_df[reagent_trough_location_header].tolist()[index] number_rows = int(reaction_conditions_df[rows_number_header].tolist()[index]) p300_multi.distribute(volume_base, source_trough12row.wells(base_trough_location), [x.top() for x in reaction_rack.rows(0, to=number_rows)]) p300_multi.distribute(volume_reagent, source_trough12row.wells(reagent_trough_location), [x.top() for x in reaction_rack.rows(0, to=number_rows)]) robot.home()