Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
spacing=(9, 9),
diameter=6,
depth=34
)
tips10 = [
labware.load('tipone_96_tiprack_10ul', slot)
for slot in ['10', '11']
]
tips300 = [
labware.load('tipone_96_tiprack_300ul', slot)
for slot in ['7', '8', '9']
]
tips10_max = 96*2
tips300_max = 96*3
all_tips_10 = [well for rack in tips10 for well in rack.wells()]
p10 = instruments.P10_Single(mount='right')
p10.set_flow_rate(
aspirate=p10_aspirate_speed_in_ul_per_s_if_applicable,
dispense=p10_dispense_speed_in_ul_per_s_if_applicable
)
if pipette_selection.split(' ')[2] == 'P50':
p50 = instruments.P50_Single(mount='left')
else:
p300 = instruments.P300_Single(mount='left')
tip10_count = 0
else:
if pipette_tip_type == 'TipOne':
tiprack300_name = 'tipone_96_tiprack_300ul'
if tiprack300_name not in labware.list():
labware.create(
tiprack300_name,
grid=(12, 8),
diameter=6.35,
depth=10.59,
volume=320
)
# load labware and modules
tempdeck = modules.load('tempdeck', '1')
plate2 = labware.load(plate_name, '1', share=True)
plate1 = labware.load(plate_name, '2', 'plate 1')
plate3 = labware.load(plate_name, '3', 'plate 3')
trough = labware.load('trough-12row', '4')
tuberack = labware.load('opentrons-tuberack-2ml-eppendorf', '5')
tips = [labware.load('tiprack-10ul', slot) for slot in ['6', '7']]
# pipettes
p10 = instruments.P10_Single(mount='right', tip_racks=tips)
# setup wells
plate1_wells = [well for row in plate1.rows() for well in row]
plate2_wells = [well for row in plate2.rows() for well in row]
plate3_wells = [well for row in plate3.rows() for well in row]
tube = tuberack.wells('A1')
solution = trough.wells('A1')
def run_custom_protocol(start_temperature_in_Celsius: int = 25,
stop_temperature_in_Celsius: int = 95):
# check input temperatures for too great of a range
if abs(start_temperature_in_Celsius-stop_temperature_in_Celsius) > 95:
raise Exception("Please enter a range of temperatures 96ËšC apart "
"or fewer.")
'author': 'Alise ',
'source': 'Custom Protocol Request'
}
# labware setup
mastermix_rack = labware.load('opentrons-tuberack-2ml-eppendorf', '1')
sample_rack = labware.load('opentrons-tuberack-2ml-eppendorf', '5')
plate_1 = labware.load('opentrons-aluminum-block-96-PCR-plate', '2')
plate_2 = labware.load('opentrons-aluminum-block-96-PCR-plate', '3')
tiprack_10_1 = labware.load('tiprack-10ul', '4')
tiprack_10_2 = labware.load('tiprack-10ul', '7')
tiprack_300 = labware.load('opentrons-tiprack-300ul', '6')
# instruments setup
p10 = instruments.P10_Single(
mount='left',
tip_racks=[tiprack_10_1, tiprack_10_2])
p300 = instruments.P300_Single(
mount='right',
tip_racks=[tiprack_300])
# reagent setup
bacteria_mm = mastermix_rack.wells('A1')
fungi_mm = mastermix_rack.wells('B1')
bacteria_mm2 = mastermix_rack.wells('C1')
fungi_mm2 = mastermix_rack.wells('D1')
# selects PCR plate 1 wells taking into consideration edge effects
target_b = [well for col in plate_1.cols('2', to='5')
for well in col.wells('B', to='G')]
target_f = [well for col in plate_1.cols('8', to='11')
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,
from opentrons import labware, instruments
from otcustomizers import StringSelection
# labware setup
plate = labware.load('96-flat', '2')
trough = labware.load('trough-12row', '1')
tiprack_10 = labware.load('tiprack-10ul', '4')
tiprack_300 = labware.load('opentrons-tiprack-300ul', '5')
# reagent setup
cells = trough.wells('A1')
# instruments setup
p10 = instruments.P10_Single(
mount='left',
tip_racks=[tiprack_10])
m300 = instruments.P300_Multi(
mount='right',
tip_racks=[tiprack_300])
layout = """
,,1,1,1,2,2,2,3,3,3,1
4,4,4,5,5,5,6,6,6,7,7,7
8,8,8,9,9,9,10,10,10,1,1,1
1,1,1,11,11,11,12,12,12,13,13,13
2,2,2,3,3,3,4,4,4,5,5,5
6,6,6,7,7,7,1,1,1,8,8,8
9,9,9,10,10,10,11,11,11,12,12,12
13,13,13,14,14,14,15,15,15,1,1,1
grid=(1, 1),
spacing=(63.88, 0),
depth=25.5,
diameter=2)
initial_plate = labware.load('96-flat', '1')
transfer_plate = labware.load('384-plate', '2')
reagent = labware.load('custom-resevoir', '4')
tiprack10 = labware.load('tiprack-10ul', '5')
tiprack = labware.load('opentrons-tiprack-300ul', '3')
if transfer_volume >= 50:
multichannel = instruments.P300_Multi(
mount='left', tip_racks=[tiprack])
else:
multichannel = instruments.P50_Multi(mount='left', tip_racks=[tiprack])
p10 = instruments.P10_Single(mount='right', tip_racks=[tiprack10])
alternating_wells_samples = []
for col1, col2 in zip(
transfer_plate.columns('2', length=7),
transfer_plate.columns('10', length=7)):
alternating_wells_samples.append(col1.wells('A'))
alternating_wells_samples.append(col1.wells('B'))
alternating_wells_samples.append(col2.wells('A'))
alternating_wells_samples.append(col2.wells('B'))
multichannel.transfer(
transfer_volume,
initial_plate.columns('2', length=7),
alternating_wells_samples)
for slot in ['1', '2', '3', '5']]
temp_deck = modules.load('tempdeck', '4')
plate = labware.load('96-flat', '4', share=True)
trough = labware.load('trough-12row', '7')
tuberack = labware.load('opentrons-tuberack-2ml-screwcap', '8')
tiprack_10 = labware.load('tiprack-10ul', '6')
tiprack_300 = [labware.load('opentrons-tiprack-300ul', slot)
for slot in ['9', '10', '11']]
# instrument setup
p300 = instruments.P300_Single(
mount='left',
tip_racks=tiprack_300)
p10 = instruments.P10_Single(
mount='right',
tip_racks=[tiprack_10])
# reagent setup
cell = trough.wells('A1')
DAPI_PBS = trough.wells('A2')
PBS = trough.wells('A3')
p10_tip_count = 0
p300_tip_count = 0
wells = [well for well in plate.wells()]
flowtubes = [well for tuberack in flow_tuberacks
for col in tuberack.cols()
for well in col]
def run_custom_protocol(
volume_csv: FileInput=csv_example):
# labware setup
plate = labware.load('96-PCR-flat', '2')
dna_stock = labware.load(deep_block_name, '5')
water = labware.load(reservoir_name, '1').wells('A1')
tiprack_10 = labware.load('tiprack-10ul', '3')
tiprack_300 = labware.load('tiprack-200ul', '6')
# instrument setup
p10 = instruments.P10_Single(
mount='left',
tip_racks=[tiprack_10])
p300 = instruments.P300_Single(
mount='right',
tip_racks=[tiprack_300])
dna_vols, water_vols, dests_name = csv_to_lists(volume_csv)
dests = [plate.wells(dest) for dest in dests_name]
samples = [dna_stock.wells(dest) for dest in dests_name]
# distribute water to destination wells
p300.distribute(water_vols, water, dests, disposal_vol=0)
# transfer DNA sample to destination wells
unique_target_slots.update({slot: target_plate_inds})
target_plate_inds += 1
# load proper labware
source_plates = [labware.load(plate_name, key, 'source ' + key)
for key in unique_source_slots]
target_plates = [labware.load(plate_name, key, 'target ' + key)
for key in unique_target_slots]
num_tip_slots = 11 - (len(source_plates) + len(target_plates))
tips10 = [labware.load('tiprack-10ul', str(slot))
for slot in range(12-num_tip_slots, 12)]
tip_max = 96*num_tip_slots
tip_count = 0
# pipette with defined tipracks
p10 = instruments.P10_Single(mount=mount_side, tip_racks=tips10)
# perform transfers
for s_slot, s_well, t_slot, t_well, vol in zip(source_plate_slots,
source_wells,
target_plate_slots,
target_wells,
volumes):
if tip_count == tip_max:
robot.pause('Replace tipracks before resuming.')
if vol > 0:
s_plate_ind = unique_source_slots[s_slot]
s_plate = source_plates[s_plate_ind]
t_plate_ind = unique_target_slots[t_slot]
t_plate = target_plates[t_plate_ind]
def run_custom_protocol(
p300_multi_mount: StringSelection('right', 'left') = 'right',
p10_multi_mount: StringSelection('left', 'right') = 'left',
number_of_sample_to_process: int = 96
):
# check
if p300_multi_mount == p10_multi_mount:
raise Exception('Input different mounts for P10 and P300 pipettes.')
if number_of_sample_to_process > 96 or number_of_sample_to_process < 1:
raise Exception('Invalid number of samples to process (should be \
between 1 and 96)')
# pipettes
m300 = instruments.P300_Multi(mount=p300_multi_mount, tip_racks=tips300)
m10 = instruments.P10_Single(mount=p10_multi_mount, tip_racks=tips10)
# setup
num_cols = math.ceil(number_of_sample_to_process/8)
mag_samples_multi = mag_plate.rows('A')[:num_cols]
tip10_count = 0
tip300_count = 0
tip10_max = len(tips10)*12
tip300_max = len(tips300)*12
def pick_up(pip):
nonlocal tip10_count
nonlocal tip300_count
if pip == m300:
if tip300_count == tip300_max: