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)
def mount_pipette(pipette_type, mount, tiprack_slot): if pipette_type == 'p10-multi': tip_rack = [ labware.load('tiprack-10ul', slot) for slot in tiprack_slot ] pipette = instruments.P10_Multi(mount=mount, tip_racks=tip_rack) elif pipette_type == 'p50-multi': tip_rack = [ labware.load('opentrons-tiprack-300ul', slot) for slot in tiprack_slot ] pipette = instruments.P50_Multi(mount=mount, tip_racks=tip_rack) else: tip_rack = [ labware.load('opentrons-tiprack-300ul', slot) for slot in tiprack_slot ] pipette = instruments.P300_Multi(mount=mount, tip_racks=tip_rack) return pipette
def run_custom_protocol(pipette_type: StringSelection( 'p300_Multi', 'p50_Single', 'p300_Single', 'p1000_Single', 'p10_Multi', 'p50_Multi', 'p10_Single') = 'p300_Multi', pipette_mount: StringSelection('left', 'right') = 'left', sample_number: int = 24, sample_volume: float = 20, bead_ratio: float = 1.8, elution_buffer_volume: float = 200, incubation_time: float = 1, settling_time: float = 1, drying_time: float = 5): total_tips = sample_number * 8 tiprack_num = total_tips // 96 + (1 if total_tips % 96 > 0 else 0) slots = ['3', '5', '6', '7', '8', '9', '10', '11'][:tiprack_num] if pipette_type == 'p1000_Single': tipracks = [labware.load('tiprack-1000ul', slot) for slot in slots] pipette = instruments.P1000_Single(mount=pipette_mount, tip_racks=tipracks) elif pipette_type == 'p300_Single': tipracks = [labware.load('tiprack-200ul', slot) for slot in slots] pipette = instruments.P300_Single(mount=pipette_mount, tip_racks=tipracks) elif pipette_type == 'p50_Single': tipracks = [labware.load('tiprack-200ul', slot) for slot in slots] pipette = instruments.P50_Single(mount=pipette_mount, tip_racks=tipracks) elif pipette_type == 'p10_Single': tipracks = [labware.load('tiprack-10ul', slot) for slot in slots] pipette = instruments.P10_Single(mount=pipette_mount, tip_racks=tipracks) elif pipette_type == 'p10_Multi': tipracks = [labware.load('tiprack-10ul', slot) for slot in slots] pipette = instruments.P10_Multi(mount=pipette_mount, tip_racks=tipracks) elif pipette_type == 'p50_Multi': tipracks = [labware.load('tiprack-200ul', slot) for slot in slots] pipette = instruments.P50_Multi(mount=pipette_mount, tip_racks=tipracks) elif pipette_type == 'p300_Multi': tipracks = [labware.load('tiprack-200ul', slot) for slot in slots] pipette = instruments.P300_Multi(mount=pipette_mount, tip_racks=tipracks) mode = pipette_type.split('_')[1] if mode == 'Single': if sample_number <= 5: reagent_container = labware.load('tube-rack-2ml', '4') liquid_waste = labware.load('trough-12row', '5').wells('A12') else: reagent_container = labware.load('trough-12row', '4') liquid_waste = reagent_container.wells('A12') samples = [well for well in mag_plate.wells()[:sample_number]] output = [well for well in output_plate.wells()[:sample_number]] else: reagent_container = labware.load('trough-12row', '4') liquid_waste = reagent_container.wells('A12') col_num = sample_number // 8 + (1 if sample_number % 8 > 0 else 0) samples = [col for col in mag_plate.cols()[:col_num]] output = [col for col in output_plate.cols()[:col_num]] # Define reagents and liquid waste beads = reagent_container.wells(0) ethanol = reagent_container.wells(1) elution_buffer = reagent_container.wells(2) # Define bead and mix volume bead_volume = sample_volume * bead_ratio if bead_volume / 2 > pipette.max_volume: mix_vol = pipette.max_volume else: mix_vol = bead_volume / 2 total_vol = bead_volume + sample_volume + 5 # Mix beads and PCR samples for target in samples: pipette.pick_up_tip() pipette.mix(5, mix_vol, beads) pipette.transfer(bead_volume, beads, target, new_tip='never') pipette.mix(10, mix_vol, target) pipette.blow_out() pipette.drop_tip() # Incubate beads and PCR product at RT for 5 minutes pipette.delay(minutes=incubation_time) # Engagae MagDeck and incubate mag_deck.engage() pipette.delay(minutes=settling_time) # Remove supernatant from magnetic beads pipette.set_flow_rate(aspirate=25, dispense=150) for target in samples: pipette.transfer(total_vol, target, liquid_waste, blow_out=True) # Wash beads twice with 70% ethanol air_vol = pipette.max_volume * 0.1 for cycle in range(2): for target in samples: pipette.transfer(200, ethanol, target, air_gap=air_vol, new_tip='once') pipette.delay(minutes=1) for target in samples: pipette.transfer(200, target, liquid_waste, air_gap=air_vol) # Dry at RT pipette.delay(minutes=drying_time) # Disengage MagDeck mag_deck.disengage() # Mix beads with elution buffer if elution_buffer_volume / 2 > pipette.max_volume: mix_vol = pipette.max_volume else: mix_vol = elution_buffer_volume / 2 for target in samples: pipette.pick_up_tip() pipette.transfer(elution_buffer_volume, elution_buffer, target, new_tip='never') pipette.mix(20, mix_vol, target) pipette.drop_tip() # Incubate at RT for 3 minutes pipette.delay(minutes=5) # Engagae MagDeck for 1 minute and remain engaged for DNA elution mag_deck.engage() pipette.delay(minutes=settling_time) # Transfer clean PCR product to a new well for target, dest in zip(samples, output): pipette.transfer(elution_buffer_volume, target, dest, blow_out=True)
# Trash = labware.load('One-Column-reservoir','3') temp_deck2 = modules.load('tempdeck', '10') temp_plate = labware.load('1ml_Covaris', '10', share=True) #mag_deck = modules.load('magdeck', '7') #mag_plate = labware.load('biorad-hardshell-96-PCR', '7', share=True) tipracks_10 = [ labware.load('tiprack-10ul', slot, share=True) for slot in ['8', '5'] ] tipracks_200 = [ labware.load('tiprack-200ul', slot, share=True) for slot in ['9', '11'] ] #### PIPETTE SETUP #### m10 = instruments.P10_Multi(mount='left', tip_racks=tipracks_10) m300 = instruments.P300_Multi(mount='right', min_volume=30, max_volume=200, aspirate_flow_rate=100, dispense_flow_rate=200, tip_racks=tipracks_200) ## Enzyme SETUP Enzyme_ER = Cold_plate.wells('A1') # Enzyme_Lig = Cold_plate.wells('A2') # Enzyme_Fill = Cold_plate.wells('A3') ## Reagent SETUP ER_mastermix = Cold_plate.wells('A4')
spacing=(17.5, 0), # distances (mm) between each (column, row) diameter=5, # diameter (mm) of each well on the plate depth=30, # depth (mm) of each well on the plate volume=10000) PG = labware.load('epMotion_10mL', '11', 'PG') plate_384 = labware.load('corning_384_wellplate_112ul_flat', '2', 'plate') sample_1 = labware.load('biorad_96_wellplate_200ul_pcr', '3') sample_2 = labware.load('biorad_96_wellplate_200ul_pcr', '6') tiprack_200 = labware.load('tiprack-200ul', '1', 'p200rack') tiprack_10_1 = labware.load('opentrons_96_tiprack_10ul', '4') tiprack_10_2 = labware.load('opentrons_96_tiprack_10ul', '7') P10_8 = instruments.P10_Multi(mount='left', tip_racks=[tiprack_10_1, tiprack_10_2]) P50_8 = instruments.P50_Multi(mount='right', tip_racks=[tiprack_200]) alternating_wells = [] for column in plate_384.cols(): alternating_wells.append(column.wells('A')) alternating_wells.append(column.wells('B')) ##Transfer the Picogreen while assay_start < (assay_end - 6): P50_8.pick_up_tip() P50_8.transfer(19, PG.wells('A1'), alternating_wells[assay_start:assay_start + 6], new_tip='never')
def run_custom_protocol( well_volume: float = 50.0, reagent_well: StringSelection('A1', 'A2', 'A3', 'A4', 'A5', 'A6', 'A7', 'A8', 'A9', 'A10', 'A11', 'A12') = 'A1', plate_starting_column: str = '1', number_of_columns_to_fill: int = 24, pipette_type: StringSelection('p300-Single', 'p50-Single', 'p10-Single', 'p300-Multi', 'p50-Multi', 'p10-Multi') = 'p50-Multi', mix_reagent_before_transfer: StringSelection('True', 'False') = 'True'): if int(plate_starting_column) <= 0 or int(plate_starting_column) > 24: raise Exception("Plate starting column number must be 1-24.") if (int(plate_starting_column) + number_of_columns_to_fill) > 25: raise Exception("Number of columns to fill exceeds plate's limit.") if mix_reagent_before_transfer == 'False': mix_times = 0 else: mix_times = 5 pip_name = pipette_type.split('-') # Check which pipette type if pip_name[0] == 'p10': tiprack = labware.load('tiprack-10ul', '1', 'p10rack') else: tiprack = labware.load('opentrons-tiprack-300ul', '1', 'p300rack') if pip_name[0] != 'p10' and well_volume < 5: raise Exception("Cannot transfer volume this small without p10.") if pip_name[0] == 'p30' and well_volume < 30: raise Exception("Cannot transfer volume this small with p300.") 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]) if pip_name[1] == 'Multi': alternating_wells = [] for column in plate.cols(plate_starting_column, to='24'): alternating_wells.append(column.wells('A')) alternating_wells.append(column.wells('B')) dests = alternating_wells[:number_of_columns_to_fill * 2] else: dests = plate.cols(plate_starting_column, length=number_of_columns_to_fill) pipette.distribute(well_volume, trough.wells(reagent_well), dests, mix_before=(mix_times, pipette.max_volume))
# PCR strips with cDNA pcr_strips = labware.load('PCR-strip-tall', '3') # tip rack for p10 pipettes tip10_rack = labware.load('tiprack-10ul', '10') tip10_rack2 = labware.load('tiprack-10ul', '11') # p10 (1 - 10 uL) (single) p10single = instruments.P10_Single( mount='right', tip_racks=[tip10_rack] ) # p10 (1 - 10 uL) (multi) p10multi = instruments.P10_Multi( mount='left', tip_racks=[tip10_rack2] ) def run_custom_protocol(vol1: float=8, vol2: float=8, cdna_vol: float=8, num_strips: int=6): # set cols of 96 well plate that get each mix # 1 to 6 as written, will change based on num_strips mix1_cols = [col for col in destination_plate.cols('1', length=num_strips)] # 7 to 12 as written, will change based on num_strips mix2_cols = [ col for col in destination_plate.cols(12 - num_strips, length=num_strips)] # pcr strips location
p10 = instruments.P10_Single(mount='right', tip_racks=tiprack_10) p10.pick_up_tip() p10.transfer(Vol, water, dest_plate.wells(dest_well), blow_out=True, new_tip='never') p10.drop_tip() i = 1 tiprack_10_2 = labware.load('tiprack-10ul', '8') p10_8 = instruments.P10_Multi(mount='left', max_volume=10, tip_racks=tiprack_10_2) ##Change the number 2 to the volume of DNA we would like to add. for i in range(12): p10_8.pick_up_tip(tiprack_10_2.cols(i)) p10_8.aspirate(2, gDNA_plate.cols(i)) p10_8.dispense(2, dest_plate.cols(i)) p10_8.drop_tip() #p10_8.transfer(8,gDNA_plate.wells('A1'),dest_plate.wells('A1')) robot.home() for c in robot.commands(): print(c)
from opentrons import labware, instruments source = labware.load('96-deep-well', '11', 'source') p10rack = labware.load('tiprack-10ul', '10', 'p10rack') p10 = instruments.P10_Multi( tip_racks=[p10rack], mount="left", ) # target_slots = ['D1', 'E1', 'A2', 'A3', 'B2', 'C2', 'D2', 'D3', 'E2', 'E3'] # plate_type = 'PCR-strip-tall' # HACK: need to explicitly load each container like this # instead of using a for loop, so that deck map can be parsed out # for protocol library # targets = [ # c o n t a i n e r s.load(plate_type, slot) for slot in target_slots] targets = [ labware.load('PCR-strip-tall', '1'), labware.load('PCR-strip-tall', '2'), labware.load('PCR-strip-tall', '3'), labware.load('PCR-strip-tall', '4'), labware.load('PCR-strip-tall', '5'), labware.load('PCR-strip-tall', '6'), labware.load('PCR-strip-tall', '7'), labware.load('PCR-strip-tall', '8'), labware.load('PCR-strip-tall', '9') ] # print(targets)
def run_custom_protocol( number_of_destination_plates: int = 5, volume_of_mineral_oil_in_ul: float = 15, distance_from_oil_surface_to_opening_of_trough_in_mm: float = 10): # check for labware space if number_of_destination_plates > 5: raise Exception('Please specify 5 or fewer destination plates.') # remaining labware dest_plates = [ labware.load(plate_name, str(slot)) for slot in range(4, 4 + number_of_destination_plates) ] tips50 = labware.load(tips50_name, str(4 + number_of_destination_plates)) tips10 = [ labware.load(tips10_name, str(slot)) for slot in range(5 + number_of_destination_plates, 12) ] # pipettes m10 = instruments.P10_Multi(mount='right', tip_racks=tips10) m50 = instruments.P50_Multi(mount='left', tip_racks=[tips50]) all_dests = [well for plate in dest_plates for well in plate.rows('A')] # variables for mineral oil height track h_oil = -(distance_from_oil_surface_to_opening_of_trough_in_mm + 5) ### length of the trough to work out total volume length = 71.4 width = dest_plates[0].wells(0).properties['diameter'] def oil_height_track(): nonlocal h_oil dh = volume_of_mineral_oil_in_ul / ( length * width ) # should this be 8*volume_of_mineral_oil_in_ul for a trough? h_oil -= dh # transfer mineral oil m50.set_flow_rate(aspirate=5, dispense=10) t_count = 0 m50.pick_up_tip() for d in all_dests: # prevent oil buildup in the same tip (replace after each plate fill) if t_count == 12: m50.drop_tip() m50.pick_up_tip() t_count = 1 oil_height_track() m50.aspirate(volume_of_mineral_oil_in_ul, mineral_oil.top(h_oil)) m50.delay(seconds=5) m50.dispense(d.bottom(5)) t_count += 1 m50.blow_out() m50.drop_tip() # distribute PCR master mix m50.set_flow_rate(aspirate=25, dispense=50) m50.pick_up_tip() for d in all_dests: m50.transfer(18, master_mix, d.top(), blow_out=True, new_tip='never') m50.drop_tip() # forward primer distribution for ind, primer in enumerate(forward_primer.rows('A')): dests = [plate.rows('A')[ind] for plate in dest_plates] m10.distribute(1, primer, dests) # reverse primer distribution for ind, primer in enumerate(reverse_primer.rows('A')): dests = [plate.rows('A')[ind] for plate in dest_plates] m10.distribute(1, primer, dests)
temp_deck2 = modules.load('tempdeck', '10') temp_plate = labware.load('1ml_Covaris', '10', share=True) #mag_deck = modules.load('magdeck', '7') #mag_plate = labware.load('biorad-hardshell-96-PCR', '7', share=True) tipracks_10 = [ labware.load('tiprack-10ul', slot, share=True) for slot in ['8'] ] tipracks_200 = [ labware.load('tiprack-200ul', slot, share=True) for slot in ['9'] ] #### PIPETTE SETUP #### m10 = instruments.P10_Multi(mount='left', min_volume=1, max_volume=10, tip_racks=tipracks_10) m300 = instruments.P300_Multi(mount='right', min_volume=30, max_volume=200, aspirate_flow_rate=100, dispense_flow_rate=200, tip_racks=tipracks_200) ## Enzyme SETUP # Enzyme_ER = MM_plate.wells('A1') # Enzyme_Lig = MM_plate.wells('A2') Enzyme_Fill = MM_plate.wells('A3') ## Reagent SETUP
##Labware #Tips #p300rack = labware.load('opentrons_96_tiprack_300ul', '9') p10rack1 = labware.load('tiprack-10ul', '4') p10rack2 = labware.load('tiprack-10ul', '1') #Plates p384plate = labware.load('384-plate', '3') #Samples sample96plate = labware.load('96-PCR-tall', '2') ##Pippetes and tips definition #p50 = instruments.P50_Single(mount='right', tip_racks=[p300rack]) p10m = instruments.P10_Multi(mount='right', tip_racks=[p10rack1, p10rack2]) ##Commands def run_custom_protocol(): for r in range(12): # p10m.transfer(10, sample96plate.cols('1'), p384plate.cols(r).wells('A','C','E','G','I','K','M','O').bottom(5), new_tip='always', dispense_flow_rate=0.5, blow_out=True) p10m.transfer(10, sample96plate.cols('1'), p384plate.cols(r).wells('A', 'C', 'E', 'G', 'I', 'K', 'M', 'O').bottom(5), new_tip='always', dispense_flow_rate=0.5) for r in range(12): p10m.transfer(10,
primer_plate = labware.load('PCR-strip-tall', '3', share=True) #Col1 Primer stip 1 (e.g. 1-8) #Col2 empty - for opening lids #Col3 Primer stip 2 (e.g. 9-16) #Col4 empty #Col5 Primer stip 3 (e.g. 17-24) #Col6 empty #### TIP RACKS #### tiprack_200 = labware.load('labsolute-tiprack-200µl', '5') tiprack_10 = labware.load('labsolute-tiprack-10µl', '2') #### PIPETTES #### s50 = instruments.P50_Single(mount='left', tip_racks=[tiprack_200]) m10 = instruments.P10_Multi(mount='right', tip_racks=[tiprack_10]) #### INPUT FILES #### #Load reagents data file water = [] buffer = [] mgcl2 = [] bsa = [] dntp = [] taq = [] primers = [] samples = [] with open("/root/csv/pcr_mix_96plate_v1_reagents.csv", "r") as csvfile: settings = csv.reader(csvfile, delimiter=',') for i in settings:
for well in custom_plate.wells(): print(well) ############################ define labware # pipette and tiprack if pipette_type == 'p10-Single': tipracks = [labware.load(tiprack_type, tiprack_slot) for tiprack_slot in tiprack_slots] pipette = instruments.P10_Single( mount=pipette_mount, tip_racks=tipracks) pipette.start_at_tip(tipracks[0].well(tip_start_from)) elif pipette_type == 'p10-Multi': tipracks = [labware.load(tiprack_type, tiprack_slot) for tiprack_slot in tiprack_slots] pipette = instruments.P10_Multi( mount=pipette_mount, tip_racks=tipracks) pipette.start_at_tip(tipracks[0].cols(tip_start_from)) pipette.plunger_positions['drop_tip'] = -6 # container for the drugs src_container = labware.load(source_type, source_slot) # where water, op50, and dmso are in the source container src_water = src_container.wells(source_H2O_well) src_water = src_water.bottom(0.5) # container for the agar-filled 96MWP dst_container = labware.load(destination_type, destination_slot) ################### actions
plate_1 = labware.load('96-flat', '1') plate_2 = labware.load('96-flat', '2') plate_3 = labware.load('96-flat', '4') plate_4 = labware.load('96-flat', '5') plate_5 = labware.load('96-flat', '7') plate_6 = labware.load('96-flat', '8') """ All four pipettes are loaded into the program, however the app will only see pipettes that are currently being used. """ if pipette_type == 'p300_multi': pip = instruments.P300_Multi(mount=mount, tip_racks=[tiprack1, tiprack2]) elif pipette_type == 'p10_multi': pip = instruments.P10_Multi(mount=mount, tip_racks=[tiprack1, tiprack2]) elif pipette_type == 'p50_multi': pip = instruments.P50_Multi(mount=mount, tip_racks=[tiprack1, tiprack2]) else: raise ValueError("Incorrect pipette type.") plates = [plate_1, plate_2, plate_3, plate_4, plate_5, plate_6] volumes = [ VOLUME_ONE, VOLUME_TWO, VOLUME_THREE, VOLUME_FOUR, VOLUME_FIVE, VOLUME_SIX ] """ Helper functions """
'description': 'A simple test protocol that checks I can pipette into the same target well on multiple plates' } # Set labware to use trough = labware.load('starlab-E2310-1200', '1') #tubes = labware.load('opentrons-tuberack-2ml-eppendorf') tips300 = labware.load('opentrons-tiprack-300ul', '2') tips10 = labware.load('tiprack-starlab-S1181-3810', '3') PCR1 = labware.load('starlab-E1403-5200', '4') PCR2 = labware.load('starlab-E1403-5200', '5') forward_primer = labware.load('starlab-E1403-0100', '10') # set pipettes pipette300 = instruments.P300_Multi(mount='left', tip_racks=[tips300]) pipette10 = instruments.P10_Multi(mount='right', tip_racks=[tips10]) # Define where the mastermix to be distributed is - this version is for bulk setup master_mix = trough.wells('A3') # Define where the mastermix to be distributed is - this version is for a single plate with a single channel #master_mix = tubes.wells('A1') # List the target plates dest_plates = [PCR1, PCR2] # Get a list of all the pipetting locations on every plate in dest_plates all_dests = [well for plate in dest_plates for well in plate.rows('A')] # dispence the PCR mastermix across both plates pipette300.set_flow_rate(aspirate=25, dispense=50)
""" from opentrons import labware, instruments, robot ####################### user intuitive parameters tiprack_slot = '3' tip_start_from = '1' # first nonempty tip in the tip rack cols_left = 12 # full tiprack ############################ define labware # pipette and tiprack tiprack = labware.load('opentrons-tiprack-10ul', tiprack_slot) # tiprack = labware.load('opentrons_96_tiprack_10ul', tiprack_slot) pipette = instruments.P10_Multi(mount='left', tip_racks=[tiprack]) pipette.start_at_tip(tiprack.cols(tip_start_from)) pipette.plunger_positions['drop_tip'] = -6 #################### actions # safety command # pipette.drop_tip() # actually maybe it hurts the robot to try to drop a tip when there's none for _ in range(cols_left): pipette.pick_up_tip() pipette.delay(seconds=5) pipette.return_tip() # print for c in robot.commands():
volume=200) # as per manufacturer's website print('Wells in 96WP PCR Thermo Fisher:') for well in custom_plate.wells(): print(well) ############################ define labware # i.e. translate user-friendly parameters into opentrons language # pipette and tiprack # multi channel if multi_pipette_type == 'p10-Multi': # this is mostly a check as we don't own other multichannel pipettes (and to not have swapped single/multi) tiprackdrugs = [labware.load(tiprackdrugs_type, slot) \ for slot in tiprackdrugs_slots] pipette_multi = instruments.P10_Multi(mount=multi_pipette_mount, tip_racks=tiprackdrugs) pipette_multi.start_at_tip(tiprackdrugs[0].well(tiprackdrugs_startfrom)) pipette_multi.plunger_positions['drop_tip'] = -6 # faster dispense pipette_multi.set_speed(dispense=pipette_multi.speeds['dispense'] * 4) # I only associated the "drugs" tiprack to the pipette as this is the one I want to handle authomatically # I'll manually handle pipetting water # container for water water_src_container = labware.load(H2O_source_type, H2O_source_slot) water_src_well = water_src_container.wells(H2O_source_well) # tiprack for water tiprackwater = labware.load(tiprackH2O_type, tiprackH2O_slot) # translate the drugs mapping dict in robot language wells_mapping = {}
def run_custom_protocol(pipette_type: StringSelection( 'p300_Multi', 'p50_Multi', 'p10_Multi', 'p1000_Single', 'p300_Single', 'p50_Single', 'p10_Single') = 'p300_Multi', pipette_mount: StringSelection('left', 'right') = 'left', sample_number: int = 16, PCR_volume: float = 20, bead_ratio: float = 1.8, elution_buffer_volume: float = 20): incubation_time = 300 settling_time = 50 drying_time = 5 total_tips = sample_number * 8 tiprack_num = total_tips // 96 + (1 if total_tips % 96 > 0 else 0) slots = ['3', '5', '6', '8', '9', '10', '11'][:tiprack_num] if pipette_type == 'p1000_Single': tipracks = [labware.load('tiprack-1000ul', slot) for slot in slots] pipette = instruments.P1000_Single(mount=pipette_mount, tip_racks=tipracks) elif pipette_type == 'p300_Single': tipracks = [labware.load('tiprack-200ul', slot) for slot in slots] pipette = instruments.P300_Single(mount=pipette_mount, tip_racks=tipracks) elif pipette_type == 'p50_Single': tipracks = [labware.load('tiprack-200ul', slot) for slot in slots] pipette = instruments.P50_Single(mount=pipette_mount, tip_racks=tipracks) elif pipette_type == 'p10_Single': tipracks = [labware.load('tiprack-10ul', slot) for slot in slots] pipette = instruments.P10_Single(mount=pipette_mount, tip_racks=tipracks) elif pipette_type == 'p10_Multi': tipracks = [labware.load('tiprack-10ul', slot) for slot in slots] pipette = instruments.P10_Multi(mount=pipette_mount, tip_racks=tipracks) elif pipette_type == 'p50_Multi': tipracks = [labware.load('tiprack-200ul', slot) for slot in slots] pipette = instruments.P50_Multi(mount=pipette_mount, tip_racks=tipracks) elif pipette_type == 'p300_Multi': tipracks = [labware.load('tiprack-200ul', slot) for slot in slots] pipette = instruments.P300_Multi(mount=pipette_mount, tip_racks=tipracks) mode = pipette_type.split('_')[1] if mode == 'Single': if sample_number <= 5: reagent_container = labware.load('opentrons-tuberack-2ml-screwcap', '7') liquid_waste = labware.load('trough-12row', '5').wells('A12') else: reagent_container = labware.load('trough-12row', '7') liquid_waste = reagent_container.wells('A12') samples = [well for well in mag_plate.wells()[:sample_number]] samples_top = [well.top() for well in samples] output = [well for well in output_plate.wells()[:sample_number]] else: reagent_container = labware.load('trough-12row', '7') liquid_waste = reagent_container.wells('A12') col_num = sample_number // 8 + (1 if sample_number % 8 > 0 else 0) samples = [col for col in mag_plate.cols()[:col_num]] samples_top = [well.top() for well in mag_plate.rows(0)[:col_num]] output = [col for col in output_plate.cols()[:col_num]] # Define reagents and liquid waste beads = reagent_container.wells(0) ethanol = reagent_container.wells(1) elution_buffer = reagent_container.wells(2) # Define bead and mix volume to resuspend beads bead_volume = PCR_volume * bead_ratio if mode == 'Single': if bead_volume * sample_number > pipette.max_volume: mix_vol = pipette.max_volume else: mix_vol = bead_volume * sample_number else: if bead_volume * col_num > pipette.max_volume: mix_vol = pipette.max_volume else: mix_vol = bead_volume * col_num total_vol = bead_volume + PCR_volume + 15 mix_voltarget = PCR_volume + 10 # Disengage MagDeck mag_deck.disengage() # Mix Speed pipette.set_flow_rate(aspirate=180, dispense=180) # Mix beads and PCR samples for target in samples: pipette.set_flow_rate(aspirate=180, dispense=180) pipette.pick_up_tip() # Slow down head speed 0.5X for bead handling pipette.mix(25, mix_vol, beads) max_speed_per_axis = { 'x': (50), 'y': (50), 'z': (50), 'a': (10), 'b': (10), 'c': (10) } robot.head_speed(combined_speed=max(max_speed_per_axis.values()), **max_speed_per_axis) pipette.set_flow_rate(aspirate=10, dispense=10) pipette.transfer(bead_volume, beads, target, air_gap=0, new_tip='never') pipette.set_flow_rate(aspirate=50, dispense=50) pipette.mix(40, mix_voltarget, target) pipette.blow_out() max_speed_per_axis = { 'x': (600), 'y': (400), 'z': (100), 'a': (100), 'b': (40), 'c': (40) } robot.head_speed(combined_speed=max(max_speed_per_axis.values()), **max_speed_per_axis) pipette.drop_tip() # Return robot head speed to the defaults for all axes max_speed_per_axis = { 'x': (600), 'y': (400), 'z': (100), 'a': (100), 'b': (40), 'c': (40) } robot.head_speed(combined_speed=max(max_speed_per_axis.values()), **max_speed_per_axis) # Incubate beads and PCR product at RT for 5 minutes robot.comment("Incubating the beads and PCR products at room temperature \ for 5 minutes. Protocol will resume automatically.") pipette.delay(seconds=incubation_time) # Engage MagDeck and Magnetize robot._driver.run_flag.wait() mag_deck.engage() robot.comment("Delaying for " + str(settling_time) + " seconds for beads to \ settle.") pipette.delay(seconds=settling_time) # Remove supernatant from magnetic beads pipette.set_flow_rate(aspirate=25, dispense=120) for target in samples: pipette.transfer(total_vol, target.bottom(0.7), liquid_waste.top(), blow_out=True) # Wash beads twice with 70% ethanol air_vol = pipette.max_volume * 0.1 for cycle in range(2): pipette.pick_up_tip() for target in samples_top: pipette.transfer(185, ethanol, target, air_gap=air_vol, new_tip='never') robot.comment("Delaying for 17 seconds.") pipette.delay(seconds=17) for target in samples: if not pipette.tip_attached: pipette.pick_up_tip() pipette.transfer(195, target.bottom(0.7), liquid_waste.top(), air_gap=air_vol, new_tip='never') pipette.drop_tip() # Dry at RT robot.comment("Drying the beads for " + str(drying_time) + " minutes. Protocol \ will resume automatically.") pipette.delay(minutes=drying_time) # Disengage MagDeck robot._driver.run_flag.wait() mag_deck.disengage() # Mix beads with elution buffer if elution_buffer_volume / 2 > pipette.max_volume: mix_vol = pipette.max_volume else: mix_vol = elution_buffer_volume / 2 for target in samples: pipette.pick_up_tip() pipette.transfer(elution_buffer_volume, elution_buffer, target, new_tip='never') pipette.mix(45, mix_vol, target) pipette.drop_tip() # Incubate at RT for 3 minutes robot.comment( "Incubating at room temperature for 3 minutes. Protocol will \ resume automatically.") pipette.delay(minutes=3) # Engage MagDeck for 1 minute and remain engaged for DNA elution robot._driver.run_flag.wait() mag_deck.engage() robot.comment("Delaying for " + str(settling_time) + " seconds for beads to \ settle.") pipette.delay(seconds=settling_time) # Transfer clean PCR product to a new well for target, dest in zip(samples, output): pipette.transfer(elution_buffer_volume, target.bottom(1), dest.top(), blow_out=True) # Disengage MagDeck mag_deck.disengage()