Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def run_custom_protocol(
pipette_type: StringSelection(
'p300-Single', 'p300-Multi', 'p50-Single', 'p50-Multi')='p300-Multi',
dilution_factor: float=1.5,
num_of_dilutions: int=10,
final_volume: float=200.0,
tip_reuse_strategy: StringSelection(
'reuse one tip', 'new tip each time')='reuse one tip'):
pip_name = pipette_type.split('-')
print(pip_name[1])
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 == '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])
new_tip = 'never' if tip_reuse_strategy == 'reuse one tip' else 'always'
def run_custom_protocol(
volume_csv: FileInput=csv_example,
dna_volume: float=2):
# labware setup
tuberack = labware.load('trough-12row', '2')
plate = labware.load('optical-96-well', '3', 'Output Plate')
dna = labware.load('optical-96-well', '6', 'DNA Plate')
tiprack_10 = labware.load('tiprack-10ul', '5')
tiprack_300 = labware.load('opentrons-tiprack-300ul', '1')
# instruments setup
p300 = instruments.P300_Single(
mount='left',
tip_racks=[tiprack_300])
m10 = instruments.P10_Multi(
mount='right',
tip_racks=[tiprack_10])
# reagent setup
buff = tuberack.wells('A1')
dest_wells, volumes, col_num = csv_to_list(volume_csv)
# transfer buffer
buff_volume_tracker = buff.max_volume()
p300.pick_up_tip()
for dest, vol in zip(dest_wells, volumes):
trough = labware.load('tube-rack-15_50ml', '9')
P1 = labware.load('96-flat', '1') # Chemicals
P2 = labware.load('96-flat', '2') # Plate taking in chemical CP1
P3 = labware.load('96-deep-well', '3') # Samples
P4 = labware.load('96-flat', '4') # Plate taking in chemical CP2
P5 = labware.load('96-flat', '5') # Plate taking in checmial CP3
P6 = labware.load('96-flat', '6') # Plate taking in chemical CP4
# pipette setup
m50 = instruments.P50_Multi(
mount='left',
tip_racks=tipracks)
p300 = instruments.P300_Single(
mount='right',
tip_racks=tipracks)
targets = [P2, P4, P5, P6]
# Transfer media to all of the target plates
p300.pick_up_tip()
for target_plate in targets:
for col_num in range(1, 11):
p300.transfer(182, trough['A1'], target_plate.cols(col_num)[1:7],
new_tip='never')
p300.drop_tip()
# Add destinations of chemical 1(x), 2(x+1), 3(x+2), 4(x)...12(x+2)
target_list = []
def run_custom_protocol(
p300_single_mount: StringSelection('left', 'right') = 'left',
p300_multi_mount: StringSelection('right', 'left') = 'right'
):
# check
if p300_multi_mount == p300_single_mount:
raise Exception('Input different mount sides for pipettes.')
# pipettes
p300 = instruments.P300_Single(
mount=p300_single_mount, tip_racks=[tips300])
m300 = instruments.P300_Multi(
mount=p300_multi_mount, tip_racks=[tips300])
# perform dilution on deepwell plate
m300.pick_up_tip()
for source, dest in zip(
dilution_plate.rows('A')[0:11], dilution_plate.rows('A')[1:12]):
m300.transfer(450, source, dest.top(), new_tip='never')
m300.blow_out(dest.top())
m300.mix(5, 200, dest)
m300.blow_out(dest.top())
# transfer last dilution to accessory tubes in first column of rack in
# slot 10
m300.transfer(
]
]
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
if magdeck._engaged:
magdeck.disengage()
pip50.pick_up_tip(tips_1x.wells('A1'))
# transfer 20ul of proteinase k to each well
pip50vol = 0
for well in samples50:
if pip50vol == 0:
elif capacity == 'p50' or capacity == 'p300':
tiprack_name = 'opentrons_96_tiprack_300ul'
else:
tiprack_name = 'opentrons_96_tiprack_1000ul'
if pipette_type == 'p1000_Single':
tipracks = [labware.load('opentrons_96_tiprack_1000ul', slot)
for slot in slots]
pipette = instruments.P1000_Single(
mount=pipette_axis,
tip_racks=tipracks)
elif pipette_type == 'p300_Single':
tipracks = [labware.load('opentrons_96_tiprack_300ul', slot)
for slot in slots]
pipette = instruments.P300_Single(
mount=pipette_axis,
tip_racks=tipracks)
elif pipette_type == 'p50_Single':
tipracks = [labware.load('opentrons_96_tiprack_300ul', slot)
for slot in slots]
pipette = instruments.P50_Single(
mount=pipette_axis,
tip_racks=tipracks)
elif pipette_type == 'p10_Single':
tipracks = [labware.load('opentrons_96_tiprack_10ul ', slot)
for slot in slots]
pipette = instruments.P10_Single(
mount=pipette_axis,
tip_racks=tipracks)
# labware setup
trough = labware.load(trough_name, '1')
plate_1 = labware.load('96-flat', '2')
output_1 = labware.load('96-flat', '3')
plate_2 = labware.load('96-flat', '5')
output_2 = labware.load('96-flat', '6')
tipracks_s = [labware.load('opentrons-tiprack-300ul', slot)
for slot in ['4', '8']]
tipracks_m = [labware.load('opentrons-tiprack-300ul', slot)
for slot in ['7', '9']]
# reagent setup
buffer = trough.wells('A1')
# instruments setup
p300 = instruments.P300_Single(
mount='left',
tip_racks=tipracks_s)
m300 = instruments.P300_Multi(
mount='right',
tip_racks=tipracks_m)
example = """
Plate,Well,Volume
1,A1,
1,A2,245
1,A3,248
1,A4,262
1,A5,300
1,A6,287
1,A7,283
1,A8,259
else:
stock_plate = labware.load(
'corning_96_wellplate_360ul_flat', '1', 'stock plate')
test_plates = [
labware.load(
'corning_96_wellplate_360ul_flat',
str(slot),
'test plate ' + str(i)
)
for i, slot in enumerate(
['3', '6', '7', '8', '9', '10', '11'][:number_of_test_plates])
]
# pipettes
p50 = instruments.P50_Single(mount=p50_single_mount, tip_racks=[tips50])
p300 = instruments.P300_Single(
mount=p300_single_mount, tip_racks=[tips300])
tubes = {
'growth medium': [gm, 100, 14000],
'water': [water, 100, 14000]
}
r15 = 14.90/2
min_h = 10
def h_track(vol, tube):
nonlocal tubes
# calculate aspiration height
tubes[tube][2] -= vol
if tubes[tube][2] < 1000:
robot.pause(
'Fill liquid in ' + tube + ' tube (rack well '
tiprack_200 = labware.load('tiprack-200ul', '3')
tuberack_1 = labware.load('opentrons-tuberack-2ml-screwcap', '4')
tuberack_2 = labware.load('opentrons-tuberack-2ml-screwcap', '5')
plates = [labware.load('96-deep-well', slot)
for slot in ['6', '7', '8', '9', '10', '11']]
plates_name = ['plate '+i for i in ['1', '2', '3', '7', '10', '11']]
source = {'tube rack 1': tuberack_1, 'tube rack 2': tuberack_2}
source.update({name: plate for name, plate in zip(plates_name, plates)})
# instrument setup
p10 = instruments.P10_Single(
mount='right',
tip_racks=tipracks_10)
p300 = instruments.P300_Single(
mount='left',
tip_racks=[tiprack_200])
# reagent setup
sample_1 = tuberack_1.wells('A6')
sample_2 = tuberack_1.wells('B6')
sample_3 = tuberack_1.wells('C6')
sample_4 = tuberack_1.wells('D6')
p10_tip_count = 0
p300_tip_count = 0
example_1 = """
Tube Rack Name,Tube Position ,Sample Name,Volume (uL)
Tube Rack 2,A01,Water,282