Exemple #1
0
 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
Exemple #2
0
def run_custom_protocol(
        pipette_type: 'StringSelection...' = 'p300-Single',
        dilution_factor: float = 2.0,
        num_of_dilutions: int = 4,
        total_mixing_volume: float = 200.0,
        tip_use_strategy: 'StringSelection...' = 'use one tip'):

    pip_name = pipette_type.split('-')[1]

    if pipette_type == 'p300-Single':
        pipette = instruments.P300_Single(mount='right', tip_racks=[tiprack])
    else:
        raise ValueError('wrong pipette')

    transfer_volume = total_mixing_volume / dilution_factor
    diluent_volume = total_mixing_volume - transfer_volume

    logging.info(pipette)
    pipette.pick_up_tip()

    for col in []:  #liquid_output.cols('2', length=(num_of_dilutions)):
        logging.info(col)

        pipette.distribute(diluent_volume, liquid_input['A1'], col)

    for row in liquid_output.rows():
        pipette.transfer(transfer_volume,
                         row.wells('1', to=(num_of_dilutions - 1)),
                         row.wells('2', to=(num_of_dilutions)),
                         mix_after=(3, total_mixing_volume / 2))

        pipette.transfer(transfer_volume, row.wells(num_of_dilutions),
                         liquid_trash)
Exemple #3
0
def test_fixed_trash():
    robot.reset()
    p300 = instruments.P300_Single(mount='right')

    p300.move_to(p300.trash_container)
    assert isclose(pose_tracker.absolute(robot.poses, p300),
                   (345.0, 351.5, 85.0)).all()
Exemple #4
0
def test_use_filter_tips():
    # test tips with lower working volume than max volume of pipette used to
    # ensure that the pipette never over-aspirates with a smaller pipette tip
    tipracks = [
        'opentrons_96_filtertiprack_10ul',
        'opentrons_96_filtertiprack_200ul',
        'opentrons_96_filtertiprack_1000ul'
    ]
    for t in tipracks:
        robot.reset()
        tip_rack = containers_load(robot, t, '3')
        plate = containers_load(robot, '96-flat', '1')
        p300 = instruments.P300_Single(
            mount='left', tip_racks=[tip_rack])

        p300.pick_up_tip()
        p300.aspirate(plate[0])

        # working volume should be the lesser of the pipette max volume
        # and the tip max volume
        assert p300.current_volume == p300._working_volume
        assert p300.current_volume == min(
            tip_rack[0].max_volume(), p300.max_volume)

        # working volume should revert back to pipette max volume if no tip
        # is attached
        p300.return_tip()
        assert p300._working_volume == p300.max_volume
Exemple #5
0
def test_aspirate_move_to(old_aspiration):
    # TODO: it seems like this test is checking that the aspirate point is
    # TODO: *fully* at the bottom of the well, which isn't the expected
    # TODO: behavior of aspirate when a location is not specified. This should
    # TODO: be split into two tests--one for this behavior (specifying a place)
    # TODO: and another one for the default
    robot.reset()
    tip_rack = containers_load(robot, 'tiprack-200ul', '3')
    p300 = instruments.P300_Single(
        mount='left', tip_racks=[tip_rack])
    p300.pick_up_tip()

    x, y, z = (161.0, 116.7, 0.0)
    plate = containers_load(robot, '96-flat', '1')
    well = plate[0]
    pos = well.from_center(x=0, y=0, z=-1, reference=plate)
    location = (plate, pos)

    robot.poses = p300._move(robot.poses, x=x, y=y, z=z)
    robot.calibrate_container_with_instrument(plate, p300, False)

    p300.aspirate(100, location)
    current_pos = pose_tracker.absolute(
        robot.poses,
        p300.instrument_actuator)

    assert (current_pos == (6.889964, 0.0, 0.0)).all()

    current_pos = pose_tracker.absolute(robot.poses, p300)
    assert isclose(current_pos, (161,  116.7,   10.5)).all()
Exemple #6
0
async def test_move_and_home_existing_pipette(async_server, async_client):
    hw = async_server['com.opentrons.hardware']
    if async_server['api_version'] == 1:
        hw.reset()
    else:
        await hw.reset()
    resp = await async_client.post('/robot/home', json={'target': 'robot'})
    assert resp.status == 200
    if async_server['api_version'] == 1:
        from opentrons import instruments
        instruments.P300_Single(mount='right')
    move_data = {
        'target': 'pipette',
        'point': [100, 200, 50],
        'mount': 'right',
        'model': 'p300_single_v1'
    }
    res = await async_client.post('/robot/move', json=move_data)
    assert res.status == 200

    move_data = {
        'target': 'pipette',
        'mount': 'right'
    }
    res1 = await async_client.post('/robot/home', json=move_data)
    assert res1.status == 200
Exemple #7
0
def test_dispense_move_to(old_aspiration):
    # TODO: same as for aspirate
    robot.reset()
    tip_rack = containers_load(robot, 'tiprack-200ul', '3')
    p300 = instruments.P300_Single(
                   mount='left',
                   tip_racks=[tip_rack])

    x, y, z = (161.0, 116.7, 0.0)
    plate = containers_load(robot, '96-flat', '1')
    well = plate[0]
    pos = well.from_center(x=0, y=0, z=-1, reference=plate)
    location = (plate, pos)

    robot.poses = p300._move(robot.poses, x=x, y=y, z=z)
    robot.calibrate_container_with_instrument(plate, p300, False)

    p300.pick_up_tip()
    p300.aspirate(100, location)
    p300.dispense(100, location)
    current_pos = pose_tracker.absolute(
        robot.poses,
        p300.instrument_actuator)
    assert (current_pos == (1.5, 0.0, 0.0)).all()

    current_pos = pose_tracker.absolute(robot.poses, p300)
    assert isclose(current_pos, (161,  116.7,   10.5)).all()
Exemple #8
0
def test_delay_calls(monkeypatch):
    from opentrons import robot
    from opentrons.legacy_api.instruments import pipette
    robot.reset()
    p300 = instruments.P300_Single(mount='right')

    cmd = []

    def mock_pause():
        nonlocal cmd
        cmd.append('pause')

    def mock_resume():
        nonlocal cmd
        cmd.append('resume')

    def mock_sleep(seconds):
        cmd.append("sleep {}".format(seconds))

    def mock_is_simulating():
        return False

    monkeypatch.setattr(robot, 'is_simulating', mock_is_simulating)
    monkeypatch.setattr(robot, 'pause', mock_pause)
    monkeypatch.setattr(robot, 'resume', mock_resume)
    monkeypatch.setattr(pipette, '_sleep', mock_sleep)

    p300.delay(seconds=4, minutes=1)

    assert 'pause' in cmd
    assert 'sleep 64.0' in cmd
    assert 'resume' in cmd
Exemple #9
0
def run_custom_protocol(
    well_volume: float = 1.0,
    pipette_type: StringSelection('p300-Single', 'p50-Single', 'p10-Single',
                                  'p300-Multi', 'p50-Multi',
                                  'p10-Multi') = 'p300-Single'):
    pip_name = pipette_type.split('-')  # Check which pipette type

    if pipette_type == 'p300-Single':
        pipette = instruments.P300_Single(mount='left', tip_racks=[tiprack])
    elif pipette_type == 'p50-Single':
        pipette = instruments.P50_Single(mount='left', tip_racks=[tiprack])
    elif pipette_type == 'p10-Single':
        pipette = instruments.P10_Single(mount='left', tip_racks=[tiprack])
    elif pipette_type == 'p300-Multi':
        pipette = instruments.P300_Multi(mount='left', tip_racks=[tiprack])
    elif pipette_type == 'p50-Multi':
        pipette = instruments.P50_Multi(mount='left', tip_racks=[tiprack])
    elif pipette_type == 'p10-Multi':
        pipette = instruments.P10_Multi(mount='left', tip_racks=[tiprack])

    alternating_wells = []
    for column in plate.cols():
        if pip_name[1] == 'Multi':
            alternating_wells.append(column.wells('A'))
            alternating_wells.append(column.wells('B'))
        else:
            alternating_wells.append(column.wells('A', length=8, step=2))
            alternating_wells.append(column.wells('B', length=8, step=2))

    pipette.distribute(well_volume, trough.wells('A1'), alternating_wells)
Exemple #10
0
def run_custom_protocol(
        pipette_type: 'StringSelection...' = 'p300-Single',
        dye_labware_type: 'StringSelection...' = 'trough-12row'):
    if pipette_type == 'p300-Single':
        tiprack = labware.load('tiprack-200ul', '1')
        pipette = instruments.P300_Single(mount='right', tip_racks=[tiprack])
    elif pipette_type == 'p50-Single':
        tiprack = labware.load('tiprack-200ul', '1')
        pipette = instruments.P50_Single(mount='right', tip_racks=[tiprack])
    elif pipette_type == 'p10-Single':
        tiprack = labware.load('tiprack-10ul', '1')
        pipette = instruments.P10_Single(mount='right', tip_racks=[tiprack])

    if dye_labware_type == 'trough-12row':
        dye_container = labware.load('trough-12row', '2')
    else:
        dye_container = labware.load('tube-rack-2ml', '2')

    output = labware.load('96-flat', '3')
    # Well Location set-up
    dye1_wells = [
        'C4', 'B4', 'A3', 'A2', 'B1', 'C1', 'D1', 'D2', 'E2', 'E1', 'F1', 'G1',
        'H2', 'H3', 'G4', 'F4'
    ]

    dye2_wells = [
        'C5', 'C6', 'C7', 'C8', 'C9', 'B10', 'C11', 'D12', 'E12', 'F11', 'G10',
        'E9', 'F9', 'F8', 'F7', 'F6', 'F5', 'G8'
    ]

    dye2 = dye_container.wells('A1')
    dye1 = dye_container.wells('A2')

    pipette.distribute(50, dye1, output.wells(dye1_wells), new_tip='once')
    pipette.distribute(50, dye2, output.wells(dye2_wells), new_tip='once')
Exemple #11
0
def run_custom_protocol(pipette_type: 'StringSelection...'='p300-Single',
                        source_labware_type: 'StringSelection...'='trough-12row',
                        destination_labware_type: 'StringSelection...'='96-flat',
                        micro_liters: 'NumberSelection...'=1,
                        new_tip_type: 'StringSelection...'='once'):
    if pipette_type == 'p300-Single':
        tiprack = labware.load('tiprack-200ul', '1')
        pipette = instruments.P300_Single(
            mount='right',
            tip_racks=[tiprack])
    elif pipette_type == 'p50-Single':
        tiprack = labware.load('tiprack-200ul', '1')
        pipette = instruments.P50_Single(
            mount='right',
            tip_racks=[tiprack])
    elif pipette_type == 'p10-Single':
        tiprack = labware.load('tiprack-10ul', '1')
        pipette = instruments.P10_Single(
            mount='right',
            tip_racks=[tiprack])
    else:
        print('Unknown pipette type: ' + pipette_type)
        return

    source_container = labware.load(source_labware_type, '2')
    destination_container = labware.load(destination_labware_type, '3')

    source_wells = source_container.wells('A1')
    destination_wells = destination_container.wells('A1')

    pipette.distribute(
        micro_liters,
        source_wells,
        destination_wells,
        new_tip=new_tip_type)
Exemple #12
0
def run_custom_protocol(
    total_mixing_volume: float = 10.0,
    final_conc: float = 1000,
):

    pipette_10 = instruments.P10_Single(mount='left', tip_racks=tiprack_10)

    pipette_300 = instruments.P300_Single(mount='right', tip_racks=tiprack_300)

    final_conc = final_conc / 2
    no_dilutions = 6

    dilution_factor = 1 / ((final_conc)**(1 / no_dilutions))

    transfer_volume = total_mixing_volume / dilution_factor
    diluent_volume = total_mixing_volume - transfer_volume

    # Reverse pipette diluent from wells B12 to H12
    pipette_300.pick_up_tip()
    pipette_300.aspirate(100, tube_rack['A2'])
    pipette_300.dispense(90, plate.cols('12').wells()[0])
    pipette_300.aspirate(diluent_volume + 10, tube_rack['A2'])
    pipette_300.dispense(diluent_volume, plate.cols('12').wells()[1])
    for well in plate.cols('12').wells()[2:-1]:
        pipette_300.aspirate(diluent_volume, tube_rack['A2'])
        pipette_300.dispense(diluent_volume, well)
    pipette_300.blow_out(tube_rack['A2'])
    pipette_300.aspirate(total_mixing_volume, tube_rack['A2'])
    pipette_300.dispense(total_mixing_volume, plate.cols('12').wells()[-1])

    pipette_300.drop_tip()

    #Add sample to well A12 for dilution
    pipette_10.pick_up_tip()
    pipette_10.aspirate(10, tube_rack['A1'])
    pipette_10.dispense(10, plate.cols('12').wells('A'))

    if transfer_volume > 30:
        pipette_10.drop_tip()
        pipette_300.pick_up_tip()
        for row in range(0, 6):
            pipette_300.transfer(transfer_volume,
                                 plate.cols('12').wells(row),
                                 plate.cols('12').wells(row + 1),
                                 mix_after=(3, total_mixing_volume / 2),
                                 new_tip='never')

        pipette_300.drop_tip()

    else:
        for row in range(0, 6):
            pipette_10.transfer(transfer_volume,
                                plate.cols('12').wells(row),
                                plate.cols('12').wells(row + 1),
                                mix_after=(3, total_mixing_volume / 2),
                                new_tip='never')

        pipette_10.drop_tip()
Exemple #13
0
def setup():
    global header, p50, p300, stock_wells, tube_rack, df
    df = np.genfromtxt('solutionmaker.csv',
                       delimiter=',',
                       skip_header=1,
                       missing_values='')
    with open('solutionmaker.csv') as csvfile:
        reader_object = csv.reader(csvfile)
        header = [row for i_row, row in enumerate(reader_object) if i_row == 0]

    (nrows, ncols) = df.shape
    for n_row in range(nrows):
        if (df[n_row, :].sum() > 1500):
            raise ValueError(
                'Individual wells will not tolerate addition of this much volume'
            )
    """
	The following are constants for instantiation (mm/sec or ul/sec)
	-----------------------------------------
	"""
    XSPEED = 600
    YSPEED = 600
    ZSPEED = 125
    P300_ASPIRATERATE = 150
    P50_ASPIRATE = 25
    P50_DISPENSERATE = 100
    P300_DISPENSERATE = 600
    """
	------------------------------------------
	"""

    # connects robot and sets robot settings
    robot.home()
    robot.connect()
    robot.head_speed(x=XSPEED, y=YSPEED, z=ZSPEED)

    # sets up labware and the layout of the experiment
    m300rack_1 = containers.load('tiprack-200ul', '10', share='True')
    m300rack_2 = containers.load('tiprack-200ul', '11', share='True')
    stock_wells = []
    slot_plate_wells = ['4', '5']
    for slot in slot_plate_wells:
        stock_wells.append(containers.load('plate_6_well', slot, share='True'))
    stock_wells.append(containers.load('96-flat', '6', share='True'))
    tube_rack = []
    slots_tube_rack = ['1', '2', '3']
    for slot in slots_tube_rack:
        tube_rack.append(containers.load('4x6_Tube_rack', slot, share='True'))

    # instantiates pipettes
    p50 = instruments.P50_Single(mount="right",
                                 tip_racks=[m300rack_1],
                                 aspirate_flow_rate=P50_ASPIRATE,
                                 dispense_flow_rate=P50_DISPENSERATE)
    p300 = instruments.P300_Single(mount="left",
                                   tip_racks=[m300rack_2],
                                   aspirate_flow_rate=P300_ASPIRATERATE,
                                   dispense_flow_rate=P300_DISPENSERATE)
Exemple #14
0
def run_custom_protocol():

    p300 = instruments.P300_Single(
            mount='left',
            tip_racks=[p200rack]
    )

    for color in pixels_by_color:
        distribute_to_agar(p300, 0.1, palette_colors[color], pixels_by_color[color], disposal_vol=4)
def run_custom_protocol(pipette_type: 'StringSelection...'='p300-Single',
    pipette_mount: 'StringSelection...'='right',
    dye_labware_type: 'StringSelection...'='trough-12row'):

    if pipette_mount == 'left' or pipette_mount == 'l':
        mount_position = 'left'
    elif pipette_mount == 'right' or pipette_mount == 'r':
        mount_position = 'right'
    else:
        raise Exception(
        "You can only mount the pipette on the 'left' or 'right' mount")

    if pipette_type == 'p300-Single':
        tiprack = labware.load('tiprack-200ul', '1')
        pipette = instruments.P300_Single(
            mount=mount_position,
            tip_racks=[tiprack])
    elif pipette_type == 'p50-Single':
        tiprack = labware.load('tiprack-200ul', '1')
        pipette = instruments.P50_Single(
            mount=mount_position,
            tip_racks=[tiprack])
    elif pipette_type == 'p10-Single':
        tiprack = labware.load('tiprack-10ul', '1')
        pipette = instruments.P10_Single(
            mount=mount_position,
            tip_racks=[tiprack])

    if dye_labware_type == 'trough-12row':
        dye_container = labware.load('trough-12row', '2')
    elif dye_labware_type == '6-well-plate':
        dye_container = labware.load('6-well-plate', '2')
    else:
        dye_container = labware.load('tube-rack-2ml', '2')

    output = labware.load('96-flat', '3')
    # Well Location set-up
    dye1_wells = ['A5', 'A6', 'A8', 'A9', 'B4', 'B10', 'C3', 'C11', 'D3',
                  'D11', 'E3', 'E11', 'F3', 'F11', 'G4', 'G10',
                  'H5', 'H6', 'H7', 'H8', 'H9']

    dye2_wells = ['C7', 'D6', 'D7', 'D8', 'E5', 'E6', 'E7', 'E8',
                  'E9', 'F5', 'F6', 'F7', 'F8', 'F9', 'G6', 'G7', 'G8']

    dye2 = dye_container.wells('A1')
    dye1 = dye_container.wells('A2')

    pipette.distribute(
        50,
        dye1,
        output.wells(dye1_wells),
        new_tip='once')
    pipette.distribute(
        50,
        dye2,
        output.wells(dye2_wells),
        new_tip='once')
Exemple #16
0
def run_custom_protocol(
        pipette_axis: 'StringSelection...'='left'):

    p300 = instruments.P300_Single(
            mount=pipette_axis,
            tip_racks=[p200rack]
    )

    for color in pixels_by_color:
        distribute_to_agar(p300, 0.1, palette_colors[color], pixels_by_color[color], disposal_vol=1)
Exemple #17
0
def test_pipette_max_deck_height():
    robot.reset()
    tallest_point = robot._driver.homed_position['Z']
    p = instruments.P300_Single(mount='left')
    assert p._max_deck_height() == tallest_point

    for tip_length in [10, 25, 55, 100]:
        p._add_tip(length=tip_length)
        assert p._max_deck_height() == tallest_point - tip_length
        p._remove_tip(length=tip_length)
Exemple #18
0
def test_pos_tracker_persistance(virtual_smoothie_env):
    robot.reset()
    p300 = instruments.P300_Single(mount='left')
    plate = containers_load(robot, 'trough-12row', '5')
    assert robot.max_placeable_height_on_deck(plate) == 40.0

    robot.poses = p300._move(robot.poses, x=10, y=10, z=10)
    robot.calibrate_container_with_instrument(plate, p300, save=False)

    assert robot.max_placeable_height_on_deck(plate) == 10.0
Exemple #19
0
def run_custom_protocol(
    volumes_csv: FileInput = example_csv,
    pipette_axis: StringSelection('B (left side)',
                                  'A (right side)') = 'B (left side)',
    pipette_model: StringSelection('p1000', 'p300', 'p50', 'p10') = 'p300',
    source_plate_type: StringSelection('96-flat', '384-plate') = '96-flat',
    destination_plate_type: StringSelection('96-flat',
                                            '384-plate') = '96-flat',
    tip_reuse: StringSelection('new tip each time',
                               'reuse tip') = 'new tip each time'):

    pipette_max_vol = int(pipette_model[1:])
    mount = 'right'
    if pipette_axis[0] == 'B':
        mount = 'left'

    tiprack_slots = ['1', '4', '7', '10']

    if pipette_max_vol == 300:
        tipracks = [
            labware.load('tiprack-200ul', slot) for slot in tiprack_slots
        ]
        pipette = instruments.P300_Single(mount=mount, tip_racks=tipracks)
    elif pipette_max_vol == 50:
        tipracks = [
            labware.load('tiprack-200ul', slot) for slot in tiprack_slots
        ]
        pipette = instruments.P50_Single(mount=mount, tip_racks=tipracks)
    elif pipette_max_vol == 10:
        tipracks = [
            labware.load('tiprack-200ul', slot) for slot in tiprack_slots
        ]
        pipette = instruments.P10_Single(mount=mount, tip_racks=tipracks)
    elif pipette_max_vol == 1000:
        tipracks = [
            labware.load('tiprack-200ul', slot) for slot in tiprack_slots
        ]
        pipette = instruments.P1000_Single(mount=mount, tip_racks=tipracks)

    data = [
        [well, vol] for well, vol in
        [row.split(',') for row in volumes_csv.strip().splitlines() if row]
    ]

    source_plate = labware.load(source_plate_type, '2')
    dest_plate = labware.load(destination_plate_type, '3')

    tip_strategy = 'always' if tip_reuse == 'new tip each time' else 'once'
    for well_idx, (source_well, vol) in enumerate(data):
        if source_well and vol:
            vol = float(vol)
            pipette.transfer(vol,
                             source_plate.wells(source_well),
                             dest_plate.wells(well_idx),
                             new_tip=tip_strategy)
Exemple #20
0
def test_set_flow_rate():
    # Test new flow-rate functionality on all pipettes with different max vols
    robot.reset()
    p10 = instruments.P10_Single(mount='right')

    p10.set_flow_rate(aspirate=10)
    ul_per_mm = Pipette._p10_single_piecewise(p10, p10.max_volume, 'aspirate')
    expected_mm_per_sec = round(10 / ul_per_mm, 6)
    assert p10.speeds['aspirate'] == expected_mm_per_sec

    p10.set_flow_rate(dispense=20)
    ul_per_mm = Pipette._p10_single_piecewise(p10, p10.max_volume, 'dispense')
    expected_mm_per_sec = round(20 / ul_per_mm, 6)
    assert p10.speeds['dispense'] == expected_mm_per_sec

    robot.reset()
    p50 = instruments.P50_Single(mount='right')

    p50.set_flow_rate(aspirate=50)
    ul_per_mm = Pipette._p50_single_piecewise(p50, p50.max_volume, 'aspirate')
    expected_mm_per_sec = round(50 / ul_per_mm, 6)
    assert p50.speeds['aspirate'] == expected_mm_per_sec

    p50.set_flow_rate(dispense=60)
    ul_per_mm = Pipette._p50_single_piecewise(p50, p50.max_volume, 'dispense')
    expected_mm_per_sec = round(60 / ul_per_mm, 6)
    assert p50.speeds['dispense'] == expected_mm_per_sec

    robot.reset()
    p300 = instruments.P300_Single(mount='right')

    p300.set_flow_rate(aspirate=300)
    ul_per_mm = Pipette._p300_single_piecewise(p300, p300.max_volume,
                                               'aspirate')
    expected_mm_per_sec = round(300 / ul_per_mm, 6)
    assert p300.speeds['aspirate'] == expected_mm_per_sec

    p300.set_flow_rate(dispense=310)
    ul_per_mm = Pipette._p300_single_piecewise(p300, p300.max_volume,
                                               'dispense')
    expected_mm_per_sec = round(310 / ul_per_mm, 6)
    assert p300.speeds['dispense'] == expected_mm_per_sec

    robot.reset()
    p1000 = instruments.P1000_Single(mount='right')

    p1000.set_flow_rate(aspirate=1000)
    ul_per_mm = Pipette._p1000_piecewise(p1000, p1000.max_volume, 'aspirate')
    expected_mm_per_sec = round(1000 / ul_per_mm, 6)
    assert p1000.speeds['aspirate'] == expected_mm_per_sec

    p1000.set_flow_rate(dispense=1100)
    ul_per_mm = Pipette._p1000_piecewise(p1000, p1000.max_volume, 'dispense')
    expected_mm_per_sec = round(1100 / ul_per_mm, 6)
    assert p1000.speeds['dispense'] == expected_mm_per_sec
Exemple #21
0
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()
Exemple #22
0
def test_trough_move_to():
    from opentrons.instruments.pipette_config import Y_OFFSET_MULTI
    robot.reset()
    tip_rack = containers_load(robot, 'tiprack-200ul', '3')
    p300 = instruments.P300_Single(mount='left', tip_racks=[tip_rack])

    trough = containers_load(robot, 'trough-12row', '1')
    p300.pick_up_tip()
    p300.move_to(trough)
    current_pos = pose_tracker.absolute(robot.poses, p300)

    assert isclose(current_pos, (14.34, 7.75 + 35 + Y_OFFSET_MULTI, 40)).all()
Exemple #23
0
def run_custom_protocol(
        pipette_axis: StringSelection(
            'left', 'right')='left',
        pipette_model: StringSelection(
            'p10', 'p50', 'p300', 'p1000')='p300',
        consolidate_volume: float=20.0,
        source_container: StringSelection(
            '96-flat', 'tube-rack-2ml')='96-flat',
        number_of_source_wells: int=4,
        destination_container: StringSelection(
            '96-flat', 'tube-rack-2ml')='96-flat',
        destination_well: str='A1',
        tip_reuse_strategy: StringSelection(
            'reuse one tip', 'new tip each time')='reuse one tip'):

    pipette_max_vol = int(pipette_model[1:])
    new_tip = 'always' if tip_reuse_strategy == 'new tip each time' else 'once'
    tip_rack = labware.load(tiprack_from_pipette(pipette_max_vol), '1')

    source = labware.load(source_container, '2')
    dest = labware.load(destination_container, '3')

    try:
        dest_well = dest.wells(destination_well)
    except ValueError:
        raise RuntimeError(
            'Invalid destination well "{}". Expected well name like A1, H11, '
            .format(destination_well) + 'etc. The destination plate may not ' +
            'have a well of that name (eg a 96-well plate has no well "T18")')

    if pipette_model == 'p10':
        pipette = instruments.P10_Single(
            mount=pipette_axis,
            tip_racks=[tip_rack])
    elif pipette_model == 'p50':
        pipette = instruments.P50_Single(
            mount=pipette_axis,
            tip_racks=[tip_rack])
    elif pipette_model == 'p300':
        pipette = instruments.P300_Single(
            mount=pipette_axis,
            tip_racks=[tip_rack])
    else:
        pipette = instruments.P1000_Single(
            mount=pipette_axis,
            tip_racks=[tip_rack])

    pipette.consolidate(
        consolidate_volume,
        source[:number_of_source_wells],
        dest_well,
        new_tip=new_tip)
Exemple #24
0
def test_trough_move_to():
    # TODO: new labware system should center multichannel pipettes within wells
    # TODO: (correct single-channel position currently corresponds to back-
    # TODO: most tip of multi-channel), so calculate against that
    robot.reset()
    tip_rack = containers_load(robot, 'tiprack-200ul', '3')
    p300 = instruments.P300_Single(mount='left', tip_racks=[tip_rack])

    trough = containers_load(robot, 'trough-12row', '1')
    p300.pick_up_tip()
    p300.move_to(trough)
    current_pos = pose_tracker.absolute(robot.poses, p300)
    assert isclose(current_pos, (0, 0, 38)).all()
Exemple #25
0
def test_robot():
    robot.reset()
    containers.load('trough-12row', '3', 'trough')
    containers.load('96-PCR-flat', '1', 'plate')

    # a tip rack for our pipette
    p200rack = containers.load('tiprack-200ul', '2', 'tiprack')

    # create a p200 pipette on robot axis B
    instruments.P300_Single(mount="left", tip_racks=[p200rack])

    # Robot tree is pretty big and hard to verify
    # Making sure we can serialize it into json
    tree, refs = serialize.get_object_tree(robot)
Exemple #26
0
def run_custom_protocol(pipette_type: 'StringSelection...'='p300-Single',
    dye_labware_type: 'StringSelection...'='trough-12row'):
    if pipette_type == 'p300-Single':
        tiprack = labware.load('tiprack-200ul', '1')
        pipette = instruments.P300_Single(
            mount='left',
            tip_racks=[tiprack])
    elif pipette_type == 'p50-Single':
        tiprack = labware.load('tiprack-200ul', '1')
        pipette = instruments.P50_Single(
            mount='left',
            tip_racks=[tiprack])
    elif pipette_type == 'p10-Single':
        tiprack = labware.load('tiprack-10ul', '1')
        pipette = instruments.P10_Single(
            mount='left',
            tip_racks=[tiprack])

    if dye_labware_type == 'trough-12row':
        dye_container = labware.load('trough-12row', '2')
    else:
        dye_container = labware.load('tube-rack-2ml', '2')

    output = labware.load('96-flat', '3')
    # Well Location set-up
    dye1_wells = ['B2']

    dye2_wells = ['A1','A2','A3','A4','A5','A6','A7','A8','A9','A10','A11','A12'
				 'B1','B6','B7', 'B12',
				  'C1','C3','C4','C5','C6','C7', 'C9', 'C10','C11','C12'
				 'D1','D3','D4','D5','D6','D7','D12',
				  'E1', 'E3', 'E4','E4','E5','E6','E7','E9','E10','E11','E12'
				  'F1','F3','F4','F5','F6','F7','F9','F10','F11','F12'
				  'G1','G6','G7','G9','G10','G11','G12'
				  'H1','H2','H3','H4','H5','H6','H7','H8','H9','H10','H11','H12'
				 ]

    dye2 = dye_container.wells('A1')
    dye1 = dye_container.wells('A2')

    pipette.distribute(
        15,
        dye1,
        output.wells(dye1_wells),
        new_tip='once')
    pipette.distribute(
        15,
        dye2,
        output.wells(dye2_wells),
        new_tip='once')
Exemple #27
0
def run_custom_protocol(
        pipette_axis: StringSelection(
            'left', 'right')='left'):

    p300 = instruments.P300_Single(
        mount=pipette_axis,
        tip_racks=[p200rack]
    )

    # macro commands like .distribute() make writing long sequences easier:
    # distribute green solution to the body
    p300.distribute(50, green, green_wells, disposal_vol=0, blow_out=True)
    # distribute blue solution to the dinosaur's back
    p300.distribute(50, blue, blue_wells, disposal_vol=0, blow_out=True)
Exemple #28
0
def test_drop_tip_default_trash(virtual_smoothie_env):
    robot.reset()
    tiprack = containers_load(robot, 'tiprack-200ul', '1')
    pip = instruments.P300_Single(mount='right', tip_racks=[tiprack])

    trash_loc = vector.Vector([80.00, 80.00, 80.00])

    pip.pick_up_tip()

    with mock.patch.object(robot, 'move_to') as move_to:  # NOQA
        pip.drop_tip()

        move_to.assert_called_with((robot.fixed_trash[0], trash_loc),
                                   instrument=pip,
                                   strategy='arc')
Exemple #29
0
def test_new_containers():
    robot.reset()
    trash_box = containers_load(robot, 'trash-box', '1')
    tip_rack = containers_load(robot, 'tiprack-200ul', '3')
    wheaton_vial_rack = containers_load(robot, 'wheaton_vial_rack', '4')
    tube_rack_80well = containers_load(robot, 'tube-rack-80well', '7')
    T75_flask = containers_load(robot, 'T75-flask', '2')
    T25_flask = containers_load(robot, 'T25-flask', '5')
    p300 = instruments.P300_Single(mount='right', tip_racks=[tip_rack])

    p300.pick_up_tip()
    p300.aspirate(100, wheaton_vial_rack[0]).dispense(trash_box)
    p300.aspirate(100, tube_rack_80well[0]).dispense(trash_box)
    p300.aspirate(100, T75_flask[0]).dispense(trash_box)
    p300.aspirate(100, T25_flask[0]).dispense(trash_box)
Exemple #30
0
def test_create_arc(virtual_smoothie_env):
    from opentrons.legacy_api.robot.robot import (TIP_CLEARANCE_DECK,
                                                  TIP_CLEARANCE_LABWARE)
    robot.reset()

    p300 = instruments.P300_Single(mount='left')
    plate = containers_load(robot, '96-flat', '1')
    plate2 = containers_load(robot, '96-flat', '2')

    new_labware_height = 10
    robot.poses = p300._move(robot.poses, x=10, y=10, z=new_labware_height)
    robot.calibrate_container_with_instrument(plate, p300, save=False)

    trash_height = robot.max_placeable_height_on_deck(robot.fixed_trash)
    assert robot.max_deck_height() == trash_height

    res = robot._create_arc(p300, (0, 0, 0), plate[0])
    arc_top = robot.max_deck_height() + TIP_CLEARANCE_DECK
    expected = [
        {'z': arc_top},
        {'x': 0, 'y': 0},
        {'z': 0}
    ]
    assert res == expected

    res = robot._create_arc(p300, (0, 0, 0), plate[1])
    arc_top = robot.max_placeable_height_on_deck(plate) + TIP_CLEARANCE_LABWARE
    expected = [
        {'z': arc_top},
        {'x': 0, 'y': 0},
        {'z': 0}
    ]
    assert res == expected

    new_labware_height = 200
    robot.poses = p300._move(robot.poses, x=10, y=10, z=new_labware_height)
    robot.calibrate_container_with_instrument(plate2, p300, save=False)

    assert robot.max_deck_height() == new_labware_height

    res = robot._create_arc(p300, (0, 0, 0), plate2[0])
    arc_top = p300._max_deck_height()
    expected = [
        {'z': arc_top},
        {'x': 0, 'y': 0},
        {'z': 0}
    ]
    assert res == expected