How to use the opentrons.instruments function in opentrons

To help you get started, we’ve selected a few opentrons examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Opentrons / Protocols / protocols / 1328-wuest-lab-at-emory-university / Wuest_Lab_2018-11-12.ot2.py View on Github external
from opentrons import instruments, labware

# labware setup
tiprack = labware.load('tiprack-200ul', '1')
trough = labware.load('trough-12row', '2')
output = labware.load('96-PCR-flat', '3')
tiprack2 = labware.load('tiprack-200ul', '4')

# instrument setup
pip = instruments.P300_Multi(
    mount='left',
    tip_racks=[tiprack, tiprack2])


def run_custom_protocol(
        water_location: str='A1',
        cells_location: str='A4',
        dilution_factor: float=10):

    if water_location == cells_location:
        raise Exception("Water and cells cannot be in the same compartment.")

    # variables and reagents
    water = trough.well(water_location)
    cells = trough.well(cells_location)
github Opentrons / Protocols / protocols / plate_mapping_hc / plate_mapping_hc.ot1.py View on Github external
p200rack = containers.load('tiprack-200ul', 'A2')
trash = containers.load('trash-box', 'B3')

source_plate = containers.load('96-PCR-flat', 'C2')

dest_plates = [
    containers.load('96-PCR-flat', 'D1'),
    containers.load('96-PCR-flat', 'D2'),
    containers.load('96-PCR-flat', 'E1'),
    containers.load('96-PCR-flat', 'E2'),
    containers.load('96-PCR-flat', 'D3'),
    containers.load('96-PCR-flat', 'E3')
]

p200_multi = instruments.Pipette(
    axis="a",
    name='p200_multi',
    max_volume=200,
    min_volume=10,
    channels=8,
    trash_container=trash,
    tip_racks=[p200rack]
)


def run_custom_protocol(odd_volume: float=45, even_volume: float=90,
                        number_of_destination_plates: int=6):
    if number_of_destination_plates > len(dest_plates):
        raise RuntimeError((
            'Number of destination plates is too high. {} was specified, ' +
            'but the max is {}').format(
github Opentrons / Protocols / protocols / 1458-erasme-hospital-part3 / QIAseq_targeted_DNA_panel-part3.ot2.py View on Github external
"""
Cleanup of Universal PCR
"""

# labware setup
mag_module = modules.load('magdeck', '4')
mag_plate = labware.load('biorad-hardshell-96-PCR', '4', share=True)
plate = labware.load('biorad-hardshell-96-PCR', '1')
trough = labware.load('trough-12row', '5')
tipracks_300 = [labware.load('opentrons-tiprack-300ul', slot)
                for slot in ['6', '7', '8', '9', '10', '11']]
tipracks_50 = [labware.load('opentrons-tiprack-300ul', slot)
               for slot in ['2', '3']]

# instrument setup
p50 = instruments.P50_Single(
    mount='left',
    tip_racks=tipracks_50)

m300 = instruments.P300_Multi(
    mount='right',
    tip_racks=tipracks_300)

# reagent setup
water = trough.wells('A1')
beads = trough.wells('A2')
ethanol_1 = trough.wells('A3')
ethanol_2 = trough.wells('A4')
ethanol_3 = trough.wells('A5')
ethanol_4 = trough.wells('A6')

m300_tip_count = 0
github Opentrons / Protocols / protocols / 1456-terra-chem-llc / pcr_prep.ot2.py View on Github external
'protocolName': 'PCR Prep',
    'author': 'Alise ',
    'source': 'Custom Protocol Request'
    }

# labware setup
source_plate = labware.load('96-PCR-tall', '4', 'Source Plate')
output_plate = labware.load('96-PCR-tall', '2', 'Master Plate')
tiprack_300 = labware.load('opentrons-tiprack-300ul', '3')
tiprack_10 = labware.load('tiprack-10ul', '5')
# instruments setup
p300 = instruments.P300_Single(
    mount='left',
    tip_racks=[tiprack_300])

m10 = instruments.P10_Multi(
    mount='right',
    tip_racks=[tiprack_10])


def run_custom_protocols(
    tuberack_type: StringSelection(
        'opentrons-tuberack-2ml-eppendorf',
        'opentrons-tuberack-2ml-screwcap')='opentrons-tuberack-2ml-eppendorf'
        ):

    tuberack = labware.load(tuberack_type, '1')

    # distribute master mix A1
    p300.distribute(
        90,
        tuberack.wells('A1'),
github Opentrons / Protocols / protocols / 1526-university-of-manchester / blocks_to_plates.ot2.py View on Github external
)

# load labware
plates = [labware.load(plate_name, slot)
          for slot in ['1', '2', '3', '4', '5', '6', '8', '9', '11']]

block = labware.load(block_name, '7')

tips = labware.load('opentrons-tiprack-300ul', '10')

# load pipette
m50 = instruments.P50_Multi(
    mount='right',
    tip_racks=[tips]
)
m300 = instruments.P300_Multi(
    mount='left',
    tip_racks=[tips]
)


def run_custom_protocol(
        number_of_full_decks: int = 2,
        volume_of_transfer: float = 30.0,
        pipette_type: StringSelection('P50-Multi', 'P300-Multi') = 'P50-Multi'
        ):
    def perform_deck_transfer(vol):
        for ind, source_col in enumerate(block.cols()):
            source = source_col[0]
            pipette.pick_up_tip(tips.cols(ind))
            for plate in plates:
                pipette.aspirate(vol, source)
github Opentrons / Protocols / protocols / 1404-mogl / dilution_first_qPCR.ot2.py View on Github external
trough = labware.load('trough-12row', '5')

tiprack_50 = labware.load('opentrons-tiprack-300ul', '9')
tiprack_10 = labware.load('tiprack-10ul', '6')

# reagent setup
water = trough.wells('A1')
master_mix = tuberack.wells('A1')
standards = strips.cols('12')[:6]

# instruments setup
p10 = instruments.P10_Single(
    mount='left',
    tip_racks=[tiprack_10])

p50 = instruments.P50_Single(
    mount='right',
    tip_racks=[tiprack_50])

temp_deck.set_temperature(4)
temp_deck.wait_for_temp()

# add water with p50
p50.pick_up_tip()
p50.transfer(49, water, strips.rows('A').wells('2', to='9'), new_tip='never')
p50.transfer(45, water, strips.rows('D').wells('2', to='9'), new_tip='never')
p50.transfer(20, water, strips.rows('E').wells('2', to='9'), new_tip='never')
p50.transfer(20, water, strips.rows('F').wells('2', to='9'), new_tip='never')
p50.drop_tip()

# add water with p10
p10.pick_up_tip()
github Opentrons / Protocols / protocols / 509b5d / Nucleic-Acid-Purification-HTP.ot2.py View on Github external
]
        ]
        pass
    else:
        # holder
        pip50 = instruments.P50_Single(mount=p50_mount)
        [samples50] = [
            plate.wells()[:number_of_samples_to_process] for plate in [
                deep_plate
            ]
        ]
        pass

    if p300_type == 'multi':
        # holder
        pip300 = instruments.P300_Multi(mount=p300_mount)
        [samples300, eluates] = [
            plate.rows('A')[:num_cols] for plate in [
                deep_plate, elution_plate
            ]
        ]
        pass
    else:
        # holder
        pip300 = instruments.P300_Single(mount=p300_mount)
        [samples300, eluates] = [
            plate.wells()[:number_of_samples_to_process] for plate in [
                deep_plate, elution_plate
            ]
        ]
        pass
github Opentrons / Protocols / protocols / 221441 / cell_digestion_and_labeing.ot2.py View on Github external
and 12.')
    if (
        temperature_module_set_temperature_in_degrees_c > 95
        or temperature_module_set_temperature_in_degrees_c < 4
       ):
        raise Exception('Temperature module set temperature must be between \
4 and 95C.')

    # temperature module
    tempdeck.set_temperature(temperature_module_set_temperature_in_degrees_c)
    robot.comment('Temperature module reaching set temperature...')
    tempdeck.wait_for_temp()

    # pipettes
    m300 = instruments.P300_Multi(mount=P300_multi_mount, tip_racks=tips300)
    m10 = instruments.P10_Multi(mount=P10_multi_mount, tip_racks=[tips10])

    # sample setup
    trans_samples = transwell_plate.rows(
        'A')[:number_of_sample_columns_to_process]
    sus_samples = sus_plate.rows('A')[:number_of_sample_columns_to_process]

    # mix transwell plate contents
    m300.set_flow_rate(aspirate=15, dispense=15)
    for i, t in enumerate(trans_samples):
        m300.pick_up_tip()
        m300.mix(10, 100, t.bottom(3))
        m300.blow_out(t.top())
        m300.drop_tip()
        if i == len(trans_samples) - 1:
            robot.pause('Suspend HTS transwell plate in Corning 3894 96-well \
plate in slot 2. Resume when ready...')
github Opentrons / Protocols / protocols / qPCR_prep / qPCR_prep.ot1.py View on Github external
# tube rack holding reagents
reagents = containers.load('tube-rack-2ml', 'A2')
dna = containers.load('tube-rack-2ml', 'C2')

# 96 well plate
qpcr_plate = containers.load('96-PCR-tall', 'A1')

# tip rack for p50 pipette and p20 pipette
tip200_rack = containers.load('tiprack-200ul', 'C1')
tip200_rack2 = containers.load('tiprack-200ul', 'E1')

# trash to dispose of tips
trash = containers.load('trash-box', 'A3')

# p20 (2 - 20 uL) (single)
p20single = instruments.Pipette(
    axis='b',
    name='p20single',
    max_volume=20,
    min_volume=2,
    channels=1,
    trash_container=trash,
    tip_racks=[tip200_rack])

# p50 (5 - 50 uL) (multi)
p50multi = instruments.Pipette(
    axis='a',
    name='p50multi',
    max_volume=50,
    min_volume=5,
    channels=8,
    trash_container=trash,
github Opentrons / Protocols / protocols / consolidate / consolidate.ot1.py View on Github external
pipette_max_vol = int(pipette_model[1:])
    new_tip = 'always' if tip_reuse_strategy == 'new tip each time' else 'once'
    tip_rack = containers.load(tiprack_from_pipette(pipette_max_vol), 'A1')

    source = containers.load(source_container, 'D1')
    dest = containers.load(destination_container, 'B1')

    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")')

    pipette = instruments.Pipette(
        axis=pipette_axis[0].lower(),
        max_volume=pipette_max_vol,
        min_volume=pipette_max_vol / 10,
        tip_racks=[tip_rack],
        trash_container=trash
    )

    pipette.consolidate(
        consolidate_volume,
        source[:number_of_source_wells],
        dest_well,
        new_tip=new_tip)