def run(protocol: protocol_api.ProtocolContext):
    """
    Run the qPCR Assay.

    Args:
        protocol: The Opentrons Protocol Context controlling the execution of
            the protocol.


    """
    temp_deck_1 = protocol.load_module(
        TEMP_DECK_1["NAME"],
        location=TEMP_DECK_1["SLOT"],
    )
    temp_deck_2 = protocol.load_module(
        TEMP_DECK_2["NAME"],
        location=TEMP_DECK_2["SLOT"],
    )
    qPCR_plate = temp_deck_1.load_labware(
        QPCR_PLATE["NAME"],
        label=QPCR_PLATE["LABEL"],
    )
    rna_plate = protocol.load_labware(
        RNA_PLATE["NAME"],
        location=RNA_PLATE["SLOT"],
        label=RNA_PLATE["LABEL"],
    )
    reagent_plate = temp_deck_2.load_labware(
        REAGENT_PLATE["NAME"],
        label=REAGENT_PLATE["LABEL"],
    )
    mastermix = reagent_plate.columns()[0]
    tip_20 = [
        protocol.load_labware(i["NAME"], location=i["SLOT"], label=i["LABEL"])
        for i in FILTER_TIP_20
    ]
    p20 = protocol.load_instrument(P10_MULTI["NAME"],
                                   P10_MULTI["POSITION"],
                                   tip_racks=tip_20)
    p20.well_bottom_clearance.aspirate = ASPIRATE_DEPTH_BOTTOM
    p20.well_bottom_clearance.dispense = ASPIRATE_DEPTH_BOTTOM

    num_cols = len(qPCR_plate.columns())

    temp_deck_1.set_temperature(celsius=TEMP)
    temp_deck_2.set_temperature(celsius=TEMP)

    aliquot_eluent(
        num_cols=num_cols,
        pipette=p20,
        source_plate=rna_plate.columns(),
        destination_plate=qPCR_plate.columns(),
    )
    add_master_mix(
        num_cols=num_cols,
        pipette=p20,
        source_plate=mastermix,
        destination_plate=qPCR_plate.columns(),
    )
Example #2
0
def run(protocol: protocol_api.ProtocolContext
        ):  #for actually running the script in the robot

    #labware:
    tiprack1 = protocol.load_labware('opentrons_96_tiprack_300ul', '9')
    #tiprack2 = protocol.load_labware('opentrons_96_tiprack_300ul','6')
    #tiprack3 = protocol.load_labware("opentrons_96_tiprack_10ul", '5')
    #tuberack1 = protocol.load_labware('opentrons_24_tuberack_generic_2ml_screwcap','1') #holds stock primers and templates
    #watertuberack = protocol.load_labware('opentrons_10_tuberack_falcon_4x50ml_6x15ml_conical','3') #holds molec bio grad H2O
    tuberack2 = protocol.load_labware(
        'opentrons_24_tuberack_nest_1.5ml_snapcap',
        '2')  # holds dilute primers and templates

    tc_mod = protocol.load_module('Thermocycler Module')
    pcrplate = tc_mod.load_labware('nest_96_wellplate_100ul_pcr_full_skirt')
    temp_module = protocol.load_module('temperature module', 1)
    cold_tuberack = temp_module.load_labware(
        'opentrons_24_aluminumblock_generic_2ml_screwcap',
        label='Temperature-Controlled Tubes')
    temp_module.set_temperature(20)
    print(temp_module.temperature)
    tc_mod.open_lid()

    #pipettes
    right_pipette = protocol.load_instrument('p300_single',
                                             'right',
                                             tip_racks=[tiprack1])
    #left_pipette = protocol.load_instrument('p10_single','left',tip_racks = [tiprack3])

    ##################################COMMANDS####################################

    #add water to template dilution tubes. ***df is the template description dataframe
    #Since we are just moving water I will use the same pipette tip to save plastic
    right_pipette.pick_up_tip()
    right_pipette.aspirate(
        volume=2, location=cold_tuberack['A1'],
        rate=2.0)  #total vol dilute template - vol stock template to add
    right_pipette.dispense(2, tuberack2['A1'], rate=2.0)
    right_pipette.drop_tip()

    protocol.pause('explain dilution')

    #add water to primer dilution tubes
    right_pipette.pick_up_tip()
    right_pipette.aspirate(
        2, tuberack2['D6'], rate=2.0
    )  #need to put 39uL of water into each dilution tube for primers,) #we need to find better way to loop through these commands
    right_pipette.dispense(2, pcrplate['H12'], rate=2.0)
    right_pipette.drop_tip()

    tc_mod.close_lid()
def run(protocol: protocol_api.ProtocolContext):

    # LABWARE
    fuge_rack = protocol.load_labware(
        'opentrons_24_tuberack_eppendorf_2ml_safelock_snapcap', '11')
    tiprack20 = protocol.load_labware('opentrons_96_filtertiprack_20ul', '9')
    tempdeck = protocol.load_module('tempdeck', '10')
    pcr_plate = tempdeck.load_labware('abi_96_wellplate_250ul')
    ww_plate1 = protocol.load_labware('bioer_96_wellplate_2200ul', '1')
    ww_plate2 = protocol.load_labware('bioer_96_wellplate_2200ul', '5')

    # PIPETTES
    p20 = protocol.load_instrument('p20_single_gen2',
                                   'right',
                                   tip_racks=[tiprack20])

    # REAGENTS
    LU_Mix = fuge_rack['A1']  # LU MasterMix

    # LISTS
    rows = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H']
    tot_ww_plates = [ww_plate1, ww_plate2]

    # #### COMMANDS ######
    # aspirate mmix to all wells in 96w plate; 15*96 = 1440ul*1.1=1584
    h_list = tip_heightsEpp(1584, 96, 15)
    well_num = 1
    p20.pick_up_tip()
    for row in rows:  #8 rows
        for col in range(1, 13):  #12 cols
            dest = row + str(col)
            p20.aspirate(15, LU_Mix.bottom(h_list[well_num - 1]), rate=0.75)
            protocol.delay(seconds=1)  #head vol for more accurate pipetting
            p20.move_to(LU_Mix.bottom(38))
            protocol.delay(seconds=1)  #equilibrate
            p20.touch_tip(v_offset=-4)
            p20.dispense(15, pcr_plate[dest].bottom(1))
            p20.blow_out(pcr_plate[dest].bottom(8))
            p20.touch_tip()
            well_num += 1
    p20.drop_tip()

    for x, ww_plate in enumerate(tot_ww_plates):
        for col in range(0, 2):
            for row in rows:
                p20.pick_up_tip()
                source = row + str(6 * col + 5)  #A5, B5, C5
                dest1 = row + str(6 * x + 3 * col + 1)  #A1, #A2, #A3
                dest2 = row + str(6 * x + 3 * col + 2)
                dest3 = row + str(6 * x + 3 * col + 3)
                p20.aspirate(18, ww_plate[source].bottom(1), rate=0.75)
                protocol.delay(seconds=2)  #equilibrate
                p20.touch_tip()
                p20.dispense(5, pcr_plate[dest1].bottom(1))
                p20.touch_tip()
                p20.dispense(5, pcr_plate[dest2].bottom(1))
                p20.touch_tip()
                p20.dispense(5, pcr_plate[dest3].bottom(1))
                p20.touch_tip()
                p20.drop_tip()
Example #4
0
def run(protocol: protocol_api.ProtocolContext):
    #Load Labware
    temp_mod = protocol.load_module('Temperature Module', '9')
    master_plate = temp_mod.load_labware(
        'opentrons_24_aluminumblock_nest_1.5ml_snapcap',
        label='Master solutions')
    reaction_plate = protocol.load_labware("biorad_384_wellplate_50ul",
                                           "10",
                                           label="reaction plate")
    mix_plate = protocol.load_labware("gbo_96_wellplate_323ul", "11")

    tiprack1 = protocol.load_labware("opentrons_96_tiprack_20ul", '1')
    tiprack2 = protocol.load_labware("opentrons_96_tiprack_20ul", '2')
    tiprack3 = protocol.load_labware("opentrons_96_tiprack_20ul", '3')
    #### A1 = liver lysate,  A2 = Water,  A3 = Cell lysate,  A4 = Master Mix
    ##Load pipettes
    p20 = protocol.load_instrument('p20_single_gen2',
                                   "right",
                                   tip_racks=[tiprack1])
    p10 = protocol.load_instrument("p10_multi",
                                   "left",
                                   tip_racks=[tiprack2, tiprack3])
    p20.flow_rate.aspirate = 8
    p20.flow_rate.dispense = 8
    #Transfer 20 uL liver lysate to A1 of mix plate and make serial dilution
    p20.transfer(20,
                 master_plate.wells_by_name()["A1"],
                 reaction_plate.wells_by_name()["B1"])
Example #5
0
def run(protocol: protocol_api.ProtocolContext):

    # LABWARE
    tiprack300 = protocol.load_labware('opentrons_96_filtertiprack_200ul', '8')
    tempdeck = protocol.load_module('tempdeck', '10')
    reagent_rack = protocol.load_labware(
        'opentrons_6_tuberack_nest_50ml_conical', '2')

    # PIPETTES
    p300 = protocol.load_instrument('p300_single_gen2',
                                    'left',
                                    tip_racks=[tiprack300])
    # REAGENTS
    rows_on_plate = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H']

    # ##### COMMANDS #####
    fifty_h = fifty_ml_heights(32400, 100, 200)
    print(fifty_h)
    p300.pick_up_tip()
    for i in range(100):
        # print ("aspirating height:", fifty_h[i])
        p300.aspirate(200, reagent_rack['A1'].bottom(fifty_h[i]))
        p300.dispense(200, reagent_rack['B3'].bottom(fifty_h[-i]))
        # print ("dispense height:", fifty_h[-i])
    p300.drop_tip()
Example #6
0
def run(protocol: protocol_api.ProtocolContext):

    # LABWARE
    tiprack300 = protocol.load_labware('opentrons_96_filtertiprack_200ul', '8')
    tiprack20 = protocol.load_labware('opentrons_96_filtertiprack_20ul', '9')
    tempdeck = protocol.load_module(
        'tempdeck', '4')  #keep this on so I don't have to move it off and on
    holder_1 = protocol.load_labware(
        '8wstriptubesonfilterracks_96_aluminumblock_250ul', '3')
    holder_2 = protocol.load_labware(
        '8wstriptubesonfilterracks_96_aluminumblock_250ul', '6')
    sample_plate = protocol.load_labware('bioer_96_wellplate_2200ul', '2')
    # PIPETTES
    p300 = protocol.load_instrument('p300_single_gen2',
                                    'left',
                                    tip_racks=[tiprack300])
    p20 = protocol.load_instrument('p20_single_gen2',
                                   'right',
                                   tip_racks=[tiprack20])

    # user inputs
    holderList = [holder_1, holder_2]
    rows = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H']

    # #### COMMANDS ######
    # Transfer 20ul from 96w plate to 96 lyophilized tubes
    for row in rows:
        # p20.pick_up_tip()
        for i in range(12):
            j = 0 if i < 6 else 1  # need to move to next holder when columns >6
            # source = sample_plate[row+str(i+1)]
            print(row, i + 1, holderList[j])
Example #7
0
def run(protocol: protocol_api.ProtocolContext):

    # LABWARE
    fuge_rack = protocol.load_labware('vwr_24_tuberack_1500ul', '1')
    # mix_rack = protocol.load_labware('vwr_24_tuberack_1500ul', '2')
    tiprack300 = protocol.load_labware('opentrons_96_filtertiprack_200ul', '8')
    # tiprack20 = protocol.load_labware('opentrons_96_filtertiprack_20ul', '9')
    tempdeck = protocol.load_module('tempdeck', '10')
    stds_plate = tempdeck.load_labware('abi_96_wellplate_250ul')

    # PIPETTES
    p300 = protocol.load_instrument('p300_single_gen2',
                                    'left',
                                    tip_racks=[tiprack300])
    # p20 = protocol.load_instrument(
    #     'p20_single_gen2', 'right', tip_racks=[tiprack20]
    # )

    # REAGENTS
    mix = fuge_rack['D5']
    testTube = fuge_rack['D1']
    # testTube = fuge_rack['D1']

    # COMMANDS
    p300.pick_up_tip()
    p300.aspirate(200, mix.bottom(10))
    for volD, heightD in d_dispense(200, 10, 12):
        p300.dispense(volD, testTube.bottom(heightD))
    p300.drop_tip()
def run(protocol: protocol_api.ProtocolContext):
    ## SETUP
    # Load Labware
    temp_mod = protocol.load_module('Temperature Module', '9')
    tube_rack = protocol.load_labware("opentrons_96_aluminumblock_generic_pcr_strip_200ul", "6", label = "aluminum block")
    reservoir_plate = protocol.load_labware("usascientific_12_reservoir_22ml", "8", label = 'reservoir plate')
    reaction_plate = temp_mod.load_labware("corning_384_wellplate_112ul_flat", label = "reaction plate")
    
    # Specify tip racks
    tiprack1 = protocol.load_labware("opentrons_96_tiprack_10ul", '2')
    tiprack2 = protocol.load_labware("opentrons_96_tiprack_300ul", '3')
    
    # Load pipettes
    p10 = protocol.load_instrument("p10_multi", "right", tip_racks = [tiprack1])
    p50 = protocol.load_instrument('p50_multi', "left", tip_racks = [tiprack2])
    p10.flow_rate.aspirate = 8
    p10.flow_rate.dispense = 8
    
    ## PROCEDURE
    # Transfer 20uL detection reagent from reservoir to reaction plate
    p50.distribute(20, reservoir_plate.columns_by_name()["1"], reaction_plate.rows_by_name()["B"])
    # Distribute 2uL protein from single 1.5mL tube onto odd wells starting with A1
    p10.distribute(2, tube_rack.columns_by_name()["1"], [reaction_plate.rows_by_name()[row] for row in rows_reaction], new_tip = 'once')
    # in the next protocol ater optimizing this one:
    # transfer compounds from library plate to reaction plate
    # Transfer 18 uL reaction mix to A1 of reaction plate
    p50.distribute(18, reservoir_plate.columns_by_name()["2"], reaction_plate.rows_by_name()["A"])
Example #9
0
def run(protocol: protocol_api.ProtocolContext):
    mag_mod = protocol.load_module('Magnetic Module Gen2', '1')
    plate = mag_mod.load_labware('kingfisher_96_wellplate_2000ul',
                                 'KingFisher 96 Well Plate 2mL')

    for i in range(50):
        protocol.pause()
        mag_mod.engage(height=6)
        protocol.pause()
        mag_mod.disengage()
Example #10
0
def run(protocol: protocol_api.ProtocolContext):

    temp_module = protocol.load_module('Temperature Module', 5)

    p10rack = protocol.load_labware('opentrons_96_tiprack_10ul', 9)

    reagents = protocol.load_labware(
        'opentrons_24_tuberack_eppendorf_2ml_safelock_snapcap', 8)
    prep_plate = temp_module.load_labware('nest_96_wellplate_200ul_flat')

    # Using 10ul pipette for precision
    p10 = protocol.load_instrument('p10_single', 'left', tip_racks=[p10rack])

    base_recipe = {  # reagent name: [postion on tuberack, uls to each sample]
        '10X_NEBuffer_21': ['A1', 2],
        'LbCas12a': ['B1', 1],
        'reporter': ['C1', 1],  #TODO Need correct volume
        'water': ['D1', 15.75]
    }
    gRNA_uls_to_pipette = 1.25
    gRNA_recipe = {  # reagent name: [postion on tuberack, uls to each sample]
        'N-gene_gRNA': ['A2', gRNA_uls_to_pipette],
        'E-gene_gRNA': ['B2', gRNA_uls_to_pipette],
        'RNase_P_gRNA': ['C2', gRNA_uls_to_pipette]
    }

    prep_plate_wells = ['A1', 'A2',
                        'A3']  #1st: N-gene wells, 2nd: E-gene, 3rd: RNase P
    prep_plate_locations = [
        prep_plate.wells(well) for well in prep_plate_wells
    ]

    reporter_recipe = base_recipe['reporter']  #move reporter to be used later

    #    print(prep_plate_locations)
    #Begin Procedure ---------------------------------------------------------
    for reagent in base_recipe:  #TODO Don't need for-loop, can do with .distribute only
        p10.distribute(
            base_recipe[reagent][1],  #volume
            reagents.wells(base_recipe[reagent][0]),  #source location
            prep_plate_locations)  #dest location

    for group, gRNA in enumerate(gRNA_recipe):
        p10.transfer(
            gRNA_recipe[gRNA][1],  #volume
            reagents.wells(gRNA_recipe[gRNA][0]),  #source location
            prep_plate_locations[group],  #dest location
            mix_after=(2, 10))  #ensure good mixing

    temp_module.set_temperature(37)  #robot pauses until temperature is reached
    protocol.delay(minutes=30)

    temp_module.set_temperature(4)
Example #11
0
def run(protocol: protocol_api.ProtocolContext):
    #######################################################################################################################################
    ## SETUP
    
    # Load Labware
    temp_mod = protocol.load_module('Temperature Module', '9')
    reaction_plate = temp_mod.load_labware("corning_384_wellplate_112ul_flat", label = "reaction plate") # where the magic happens
    library_1 = protocol.load_labware("greiner_96_wellplate_323ul", "8", label = "library 1") # library 'morning'
    reagent_plate = protocol.load_labware("greiner_96_wellplate_323ul", "6", label = "reagents")
    
    # Specify tip racks
    tiprack1 = protocol.load_labware("opentrons_96_tiprack_10ul", '3')
    tiprack2 = protocol.load_labware("opentrons_96_tiprack_300ul", '2')

    # Load pipettes and set parameters
    p10 = protocol.load_instrument("p10_multi", "right", tip_racks = [tiprack1])
    p50 = protocol.load_instrument('p50_multi', "left", tip_racks = [tiprack2])

    p10.flow_rate.aspirate = 8
    p10.flow_rate.dispense = 8

    # 384-well depth is 11.56 mm and max volume is 50 uL
    # 20 uL is 2 mm high, tandem (middle) wall is 5.1 mm high
    p10.well_bottom_clearance.dispense = 1
    p50.well_bottom_clearance.dispense = 3.5

    # Specify target wells
    reagents = ["3", "4"] # columns on reagent plate for substrate and enzyme
    # reaction
    cols_reaction = list(range(1, 10)) # destination wells in reaction plate (Bio-Rad hardshell 384-well)
    wells_reaction = ['A' + str(i) for i in cols_reaction]
    wells_detection = ['B' + str(i) for i in cols_reaction]

    # libraries
    lib1_cols = [1, 2, 3, 4, 5, 6, 7, 11, 12] # library columns to aspirate compounds from

    #######################################################################################################################################
    ## PROCEDURE

    # Distribute 20uL detection reagent from reagent plate to reaction plate onto even rows
    p50.distribute(20, reagent_plate.columns_by_name()["5"], [reaction_plate.wells_by_name()[i] for i in wells_detection])

    # mix substrate and enzyme
    p50.transfer(100, reagent_plate.columns_by_name()[reagents[0]], reagent_plate.columns_by_name()[reagents[1]], mix_after = (3, 40))

    # Distribute substrate mixed with fluorescent dye and enzyme
    p10.distribute(18, reagent_plate.columns_by_name()[reagents[1]], [reaction_plate.wells_by_name()[i] for i in wells_reaction],
    disposal_volume = 1, blow_out = True, new_tip = 'once')

    # Distribute compounds from 96-well library
    # library 1 in wells A1-A12
    for i in range(0, len(cols_reaction)):
        p10.transfer(2, library_1.columns_by_name()[str(lib1_cols[i])], reaction_plate.wells_by_name()[wells_reaction[i]])
Example #12
0
def run(protocol: protocol_api.ProtocolContext):
    #######################################################################################################################################
    ## SETUP
    
    # Load Labware
    temp_mod = protocol.load_module('Temperature Module', '9')
    reaction_plate = temp_mod.load_labware("corning_384_wellplate_112ul_flat", label = "reaction plate") # where the magic happens
    reagent_plate = protocol.load_labware("greiner_96_wellplate_323ul", "6", label = "reagents")
    
    # Specify tip racks
    tiprack1 = protocol.load_labware("opentrons_96_tiprack_10ul", '5')
    tiprack2 = protocol.load_labware("opentrons_96_tiprack_300ul", '8')

    # Load pipettes and set parameters
    p10 = protocol.load_instrument("p10_multi", "right", tip_racks = [tiprack1])
    p50 = protocol.load_instrument('p50_multi', "left", tip_racks = [tiprack2])

    # Aspirate has the default flowrate of 150 ul/s
    # p10.flow_rate.aspirate = 8 # in uL/s
    # Dispense has the default flowrate of 300 ul/s
    # p10.flow_rate.dispense = 8

    # 384-well depth is 11.56 mm and max volume is 50 uL
    # 20 uL is 2 mm high in Biorad #HSP3841,
    # tandem (middle) wall is 5.1 mm high
    p10.well_bottom_clearance.dispense = 1
    p50.well_bottom_clearance.dispense = 3.5

    # Specify source wells
    reagents = ["5"] # columns on reagent plate for substrate and enzyme

    #######################################################################################################################################
    ## PROCEDURE

    # 9uL
    cols_reaction = list(range(1, 5)) # destination wells in reaction plate (Bio-Rad hardshell 384-well)
    wells_reaction = ['A' + str(i) for i in cols_reaction] # use the cols_reaction variable to make a new var with wells, e.g. A1, A2...
    # Transfer fluorescent dye
    p10.transfer(9, reagent_plate.columns_by_name()[reagents[0]], [reaction_plate.wells_by_name()[i] for i in wells_reaction],ibute
    disposal_volume = 1, blow_out = True, new_tip = 'once')

    # 18uL
    cols_reaction = list(range(1, 5)) # destination wells in reaction plate (Bio-Rad hardshell 384-well)
    wells_reaction = ['B' + str(i) for i in cols_reaction] # use the cols_reaction variable to make a new var with wells, e.g. A1, A2...
    # Transfer fluorescent dye
    p10.transfer(9, reagent_plate.columns_by_name()[reagents[0]], [reaction_plate.wells_by_name()[i] for i in wells_reaction],
    disposal_volume = 1, blow_out = True, new_tip = 'once')
    # Transfer fluorescent dye
    p10.transfer(9, reagent_plate.columns_by_name()[reagents[0]], [reaction_plate.wells_by_name()[i] for i in wells_reaction],
    disposal_volume = 1, blow_out = True, new_tip = 'once')
Example #13
0
def run(protocol: protocol_api.ProtocolContext):
    #labware
    temp_mod = protocol.load_module('Temperature Module', '9')
    plate = temp_mod.load_labware(
        "opentrons_96_aluminumblock_generic_pcr_strip_200ul",
        label='Temp-controlled pcr tubes')
    #tiprack
    tiprack1 = protocol.load_labware("opentrons_96_tiprack_20ul", "1")
    #pipettes
    p20 = protocol.load_instrument("p20_single_gen2",
                                   "right",
                                   tip_racks=[tiprack1])

    # Move compound stock to start of series
    p20.transfer(final_vol,
                 plate.wells_by_name()[compound_stock_location],
                 plate.wells_by_name()[starting_location])
    # Put buffer in each tube
    p20.transfer(
        buffer_vol,
        plate.wells_by_name()[buffer_location],
        [plate.wells_by_name()[well_name] for well_name in buffer_wells[1:]])
    # Perform serial dilution
    p20.pick_up_tip()
    p20.transfer(trans_vol,
                 plate.wells_by_name()[starting_location],
                 plate.wells_by_name()[buffer_wells[0]],
                 mix_after=(3, final_vol / 2),
                 new_tip='never')
    for num, well in enumerate(buffer_wells[:-1]):
        source = well
        destination = buffer_wells[num + 1]
        p20.transfer(trans_vol,
                     plate.wells_by_name()[source],
                     plate.wells_by_name()[destination],
                     mix_after=(3, final_vol / 2),
                     new_tip='never')
    # Discard excess from last tube
    p20.transfer(buffer_vol,
                 plate.wells_by_name()[buffer_wells[-1]],
                 plate.wells_by_name()[liquid_trash_tube],
                 new_tip='never')
    p20.drop_tip()
    #add protein to all tubes
    p20.transfer(
        buffer_vol,
        plate.wells_by_name()[protein_location],
        [plate.wells_by_name()[well_name] for well_name in protein_wells],
        mix_after=(3, final_vol / 2),
        new_tip='always')
Example #14
0
def run(protocol: protocol_api.ProtocolContext):

    # LABWARE
    fuge_rack = protocol.load_labware(
        'opentrons_24_tuberack_eppendorf_1.5ml_safelock_snapcap', '4')
    tiprack300 = protocol.load_labware('opentrons_96_tiprack_300ul', '8')
    tiprack20 = protocol.load_labware('opentrons_96_tiprack_20ul', '9')
    tempdeck = protocol.load_module('tempdeck', '10')
    sample_plate = tempdeck.load_labware('abi_96_wellplate_250ul')

    # PIPETTES
    p300 = protocol.load_instrument('p300_single_gen2',
                                    'left',
                                    tip_racks=[tiprack300])
    p20 = protocol.load_instrument('p20_single_gen2',
                                   'right',
                                   tip_racks=[tiprack20])

    # REAGENTS
    water = fuge_rack['C1']

    ###### COMMANDS ######
    # dispense 20ul into A1, checking bottom clearance
    p20.pick_up_tip()
    p20.well_bottom_clearance.aspirate = 2
    p20.aspirate(20, water)
    p20.well_bottom_clearance.dispense = 3
    p20.dispense(20, sample_plate['A1'])
    p20.drop_tip()

    # dispense 20ul into B1 using 300ul tip, checking bottom clearance
    p300.pick_up_tip()
    p300.well_bottom_clearance.aspirate = 2
    p300.aspirate(20, water)
    p300.well_bottom_clearance.dispense = 0
    p300.dispense(20, sample_plate['B1'])
    p300.drop_tip()

    # dispense 20ul into each well in row A
    col = ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12']
    p300.pick_up_tip()
    p300.well_bottom_clearance.aspirate = 2
    p300.aspirate(260, water)
    for well in col:
        pos = 'A' + well
        p300.well_bottom_clearance.dispense = 0
        p300.dispense(20, sample_plate[pos])
        p300.touch_tip()
    p300.drop_tip()
def run(robot: protocol_api.ProtocolContext):

    # -----------------------------------------------------
    # Magnetic module + labware
    # -----------------------------------------------------
    magdeck = robot.load_module('Magnetic Module Gen2', '1')
    maglab = magdeck.load_labware('nest_96_wellplate_2ml_deep',
                                  'nest_96_wellplate_2ml_deep')
    #magdeck.engage(height = 7)

    for i in np.arange(0.0, 25.0, 0.1):
        magdeck.engage(height=i)
        robot.comment('Actual height =' + str(i))
        robot.pause('Test')
    magdeck.disengage()
Example #16
0
def run(ctx: protocol_api.ProtocolContext):
    # ------------------------
    # Load LabWare
    # ------------------------
    # Tip racks
    tips = [ctx.load_labware('opentrons_96_filtertiprack_20ul', slot, '20µl filter tiprack') for slot in ['11']]

    # Pipette
    p20 = ctx.load_instrument('p20_single_gen2', 'right', tip_racks=tips)

    # Source
    rack_num = math.ceil(num_samples / NUM_OF_SOURCES_PER_RACK) if num_samples < MAX_NUM_OF_SOURCES else MIN_NUM_OF_SOURCES
    source_racks = [ctx.load_labware(
        'opentrons_24_tuberack_generic_2ml_screwcap', slot,
        'Tuberack 24 tubos normales' + str(i + 1)) for i, slot in enumerate(['8', '9', '5', '6'][:rack_num])
    ]
    reagents = common.generate_source_table(source_racks)
    sample_sources = reagents[:num_samples]

    # Destination (in this case 96 well plate)
    dest_plate = ctx.load_labware('abi_fast_qpcr_96_alum_opentrons_100ul', '3', 'Tubos individuales en placa pcr aluminio')
    destinations = dest_plate.wells()[:num_destinations]


    # ------------------
    # Protocol
    # ------------------
    if not p20.hw_pipette['has_tip']:
        common.pick_up(p20)

    for s, d in zip(sample_sources, destinations):
        if not p20.hw_pipette['has_tip']:
            common.pick_up(p20)

        # Calculate pickup_height based on remaining volume and shape of container
        common.move_vol_multichannel(ctx, p20, reagent=sample, source=s, dest=d,
                                     vol=volume_to_be_transfered, air_gap_vol=air_gap_vol_sample,
                                     pickup_height=pickup_height, disp_height=dispense_height,
                                     x_offset=x_offset, blow_out=True, touch_tip=True)
        # Drop pipette tip
        p20.drop_tip()

    # Modules
    temp_hot = ctx.load_module('temperature module gen2', '1')
    temp_hot.set_temperature(98)
    ctx.pause()
def run(protocol: protocol_api.ProtocolContext):

    # LABWARE
    tiprack300 = protocol.load_labware('opentrons_96_filtertiprack_200ul', '8')
    tiprack20 = protocol.load_labware('opentrons_96_filtertiprack_20ul', '9')
    tempdeck = protocol.load_module(
        'tempdeck', '4')  #keep this on so I don't have to move it off and on
    holder_1 = protocol.load_labware(
        '8wstriptubesonfilterracks_96_aluminumblock_250ul', '3')
    holder_2 = protocol.load_labware(
        '8wstriptubesonfilterracks_96_aluminumblock_250ul', '6')
    sample_plate = protocol.load_labware('bioer_96_wellplate_2200ul', '2')
    # PIPETTES
    p300 = protocol.load_instrument('p300_single_gen2',
                                    'left',
                                    tip_racks=[tiprack300])
    p20 = protocol.load_instrument('p20_single_gen2',
                                   'right',
                                   tip_racks=[tiprack20])

    # user inputs
    holderList = [holder_1, holder_2]
    rows = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H']

    # #### COMMANDS ######
    # Transfer 20ul from 96w plate to 96 lyophilized tubes
    for row in rows:
        p20.pick_up_tip()
        for i in range(12):
            j = 0 if i < 6 else 1  # need to move to next holder when columns >6
            source = sample_plate[row + str(i + 1)]
            dest = holderList[j][row + str(2 * i + 1)]
            p20.aspirate(20, source.bottom(1), rate=0.75)
            p20.move_to(source.bottom(
                40))  #move p20 pipette +4cm so no crash into lyo tubes
            p20.move_to(dest.bottom(
                40))  #move p20 pipette +4cm so no crash into lyo tubes
            p20.dispense(20, dest.bottom(6))
            p20.blow_out()
            p20.touch_tip()
            p20.move_to(dest.top()
                        )  # centers tip so tip doesn't lift tubes after touch
            p20.move_to(dest.bottom(40))
        p20.drop_tip()
def run(protocol: protocol_api.ProtocolContext):
    ## SETUP
    # Load Labware
    temp_mod = protocol.load_module('Temperature Module', '9')
    tube_rack = protocol.load_labware("opentrons_24_aluminumblock_nest_1.5ml_snapcap", "4", label = "aluminum block")
    reservoir_plate = protocol.load_labware("usascientific_12_reservoir_22ml", "6", label = 'reseroir plate')
    reaction_plate = temp_mod.load_labware("corning_384_wellplate_112ul_flat", label = "reaction plate")
    
    # Specify tip racks
    tiprack1 = protocol.load_labware("opentrons_96_tiprack_10ul", '1')
    tiprack2 = protocol.load_labware("opentrons_96_tiprack_300ul", '2')
    
    # Load pipettes
    p20 = protocol.load_instrument("p20_single_gen2", "right", tip_racks = [tiprack1])
    p50 = protocol.load_instrument('p50_multi', "left", tip_racks = [tiprack2])
    p20.flow_rate.aspirate = 8
    p20.flow_rate.dispense = 8
    
    ## PROCEDURE
    # Transfer 20uL detection reagent from reservoir to reaction plate
    p50.transfer(20, reservoir_plate.columns_by_name()["1"], reaction_plate.wells_by_name()["B1", new_tip = 'once'])
def run(protocol: protocol_api.ProtocolContext):

    # LABWARE
    stds_rack = protocol.load_labware('vwr_24_tuberack_1500ul', '2')
    tiprack300 = protocol.load_labware('opentrons_96_filtertiprack_200ul', '8')
    tiprack20 = protocol.load_labware('opentrons_96_filtertiprack_20ul', '9')
    tempdeck = protocol.load_module('tempdeck', '1')
    plate = tempdeck.load_labware(
        'opentrons_96_aluminumblock_generic_pcr_strip_200ul')
    # holder_1 = protocol.load_labware('8wstriptubesonfilterracks_96_aluminumblock_250ul', '3')
    # holder_2 = protocol.load_labware('8wstriptubesonfilterracks_96_aluminumblock_250ul', '6')
    # holder_3 = protocol.load_labware('8wstriptubesonfilterracks_96_aluminumblock_250ul', '7')
    # PIPETTES
    p300 = protocol.load_instrument('p300_single_gen2',
                                    'left',
                                    tip_racks=[tiprack300])
    p20 = protocol.load_instrument('p20_single_gen2',
                                   'right',
                                   tip_racks=[tiprack20])

    # REAGENTS
    std_1 = stds_rack['A1']  # 990ul Water
    std_2 = stds_rack['A2']  # 900ul water
    std_3 = stds_rack['A3']  # 900ul water
    std_4 = stds_rack['A4']  # 900ul water

    # # user inputs
    # # this is 4 reps on each tube e.g. 16*4 = 64 samples
    # num_of_sample_reps = 6 # doesn't yet accommodate other ints
    # holderList = [holder_1, holder_2]
    # tot_sample_vol = 20
    # # lists
    # all_stds = [std_1, std_2, std_3, std_4, std_5, std_6, std_7, std_8, std_9, std_10, std_11, std_12, std_13, std_14, std_15, water]
    # dest_rows = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H'] # easier to add rows for stds rather than repeat

    # #### COMMANDS ######
    # Distribute stds DNA to strip tubes * # reps
    p300.transfer(20, std_1, plate.rows_by_name()['A'])
Example #20
0
def run(protocol: protocol_api.ProtocolContext):
    temp_mod = protocol.load_module('Temperature Module', '6')
    tubes = temp_mod.load_labware(
        'opentrons_96_aluminumblock_generic_pcr_strip_200ul',
        label='aliquot tubes')
    protein_tubes = protocol.load_labware(
        "opentrons_24_aluminumblock_nest_2ml_snapcap", '5')
    tiprack1 = protocol.load_labware("opentrons_96_tiprack_300ul", '4')
    #tiprack2 = protocol.load_labware("opentrons_96_tiprack_10ul",'2')
    #tiprack3 = protocol.load_labware("opentrons_96_tiprack_300ul",'4')

    p50 = protocol.load_instrument('p50_multi', "left", tip_racks=[tiprack1])

    # p50.transfer(50, [condition_block.wells_by_name()[well_name].bottom(30) for well_name in source],[cryst_plate.wells_by_name()[well_name] for well_name in res_destination], new_tip ='always')
    # p20.transfer(1, [cryst_plate.wells_by_name()[well_name].bottom(5) for well_name in res_destination],[cryst_plate.wells_by_name()[well_name].bottom(0.5) for well_name in well_one_destination], new_tip ='always')
    p50.pick_up_tip()
    for x in range(0, 12):

        p50.transfer(40,
                     protein_tubes.wells_by_name()["A1"],
                     tubes.columns()[x],
                     new_tip='never',
                     mix_before=(5, 50))
    p50.drop_tip()
def run(protocol: protocol_api.ProtocolContext):

    # LABWARE
    fuge_rack = protocol.load_labware('vwr_24_tuberack_1500ul', '2')
    tiprack300 = protocol.load_labware('opentrons_96_filtertiprack_200ul', '8')
    tiprack20 = protocol.load_labware('opentrons_96_filtertiprack_20ul', '9')
    tempdeck = protocol.load_module('tempdeck', '10')
    sectempdeck = protocol.load_module('tempdeck', '4')
    plate = tempdeck.load_labware(
        'opentrons_96_aluminumblock_generic_pcr_strip_200ul')
    stds_rack = sectempdeck.load_labware(
        'opentrons_24_aluminumblock_generic_2ml_screwcap')

    # PIPETTES
    p300 = protocol.load_instrument('p300_single_gen2',
                                    'left',
                                    tip_racks=[tiprack300])
    p20 = protocol.load_instrument('p20_single_gen2',
                                   'right',
                                   tip_racks=[tiprack20])

    # REAGENTS
    b_std_1 = stds_rack['A1']
    b_std_2 = stds_rack['A2']
    b_std_3 = stds_rack['A3']
    b_std_4 = stds_rack['A4']
    b_std_5 = stds_rack['A5']
    b_std_6 = stds_rack['A6']
    b_std_7 = stds_rack['D1']

    g_std_1 = stds_rack['B1']
    g_std_2 = stds_rack['B2']
    g_std_3 = stds_rack['B3']
    g_std_4 = stds_rack['B4']
    g_std_5 = stds_rack['B5']
    g_std_6 = stds_rack['B6']
    g_std_7 = stds_rack['D2']

    d_std_1 = stds_rack['C1']
    d_std_2 = stds_rack['C2']
    d_std_3 = stds_rack['C3']
    d_std_4 = stds_rack['C4']
    d_std_5 = stds_rack['C5']
    d_std_6 = stds_rack['C6']
    d_std_7 = stds_rack['D3']

    BioMix = stds_rack['D5']  # BioSellal MasterMix
    LU_Mix = stds_rack['D6']  # LU MasterMix

    water = fuge_rack['D6']  # water
    BioPositive = fuge_rack['A1']  # BioSellal Positive Control plasmid
    LUPositive = fuge_rack['A6']  # LU Positive Control plasmid

    # Lists
    BioMix_cols = ['1', '3', '5', '7', '9', '11']

    beta = [b_std_1, b_std_6, b_std_7]  #really gamma
    beta_wells = [['A1', 'A3', 'A5', 'A7', 'A9', 'A11'],
                  ['B1', 'B3', 'B5', 'B7', 'B9', 'B11'], ['G1', 'G5',
                                                          'G9']]  # triplicate

    gamma = [g_std_1, g_std_6, g_std_7]  #really kappa
    gamma_wells = [['C1', 'C3', 'C5', 'C7', 'C9', 'C11'],
                   ['D1', 'D3', 'D5', 'D7', 'D9', 'D11'], ['G3', 'G7', 'G11']]

    delta = [d_std_1, d_std_6, d_std_7]  #really delta
    delta_wells = [['E1', 'E3', 'E5', 'E7', 'E9', 'E11'],
                   ['F1', 'F3', 'F5', 'F7', 'F9', 'F11'], ['H1', 'H5', 'H9']]

    # NEG_wells = ['H1', 'H2', 'H3', 'H7', 'H8', 'H9'] # no room
    BioPositive_wells = ['H3', 'H7', 'H11']
    # LUPositive_wells = ['H10', 'H11', 'H12']

    # #### COMMANDS ######
    # Transfer BioSellal mmix to cols 1-6
    for col in BioMix_cols:
        p20.transfer(15,
                     BioMix.bottom(2),
                     plate.columns_by_name()[col],
                     blow_out=True,
                     blowout_location='destination well',
                     touch_tip=True,
                     new_tip='once')

    # Add Beta samples to Mix
    for sample, pos in zip(beta, beta_wells):
        p20.distribute(5,
                       sample.bottom(2),
                       [plate.wells_by_name()[well_name] for well_name in pos],
                       new_tip='always')
    # Add Gamma samples to Mix
    for sample, pos in zip(gamma, gamma_wells):
        p20.distribute(5,
                       sample.bottom(2),
                       [plate.wells_by_name()[well_name] for well_name in pos],
                       new_tip='always')
    # Add Delta samples to Mix
    for sample, pos in zip(delta, delta_wells):
        p20.distribute(5,
                       sample.bottom(2),
                       [plate.wells_by_name()[well_name] for well_name in pos],
                       new_tip='always')

    # Add POSITIVE samples to Mix
    p20.distribute(
        5,
        BioPositive.bottom(2),
        [plate.wells_by_name()[well_name] for well_name in BioPositive_wells],
        new_tip='always')
def run(ctx: protocol_api.ProtocolContext):
    global robot
    robot = ctx

    # confirm door is close
    if not ctx.is_simulating():
        confirm_door_is_closed()

    # load labware and modules
    ## ELUTION LABWARE
    if ELUTION_LABWARE not in ELUTION_LW_DICT:
        raise Exception('Invalid ELUTION_LABWARE. Must be one of the \
    following:\nopentrons aluminum biorad plate\nopentrons aluminum nest plate')

    elution_plate = ctx.load_labware(
        ELUTION_LW_DICT[ELUTION_LABWARE], '1',
        'elution plate')

    ## MAGNETIC PLATE LABWARE
    magdeck = ctx.load_module('magdeck', '10')
    magdeck.disengage()

    if MAGPLATE_LABWARE not in MAGPLATE_LW_DICT:
        raise Exception('Invalid MAGPLATE_LABWARE. Must be one of the \
following:\nopentrons deep generic well plate\nnest deep generic well plate\nvwr deep generic well plate')

    magplate = magdeck.load_labware(MAGPLATE_LW_DICT[MAGPLATE_LABWARE])

    ## WASTE LABWARE
    if WASTE_LABWARE not in WASTE_LW_DICT:
        raise Exception('Invalid WASTE_LABWARE. Must be one of the \
    following:\nnest 1 reservoir plate')

    waste = ctx.load_labware(
        WASTE_LW_DICT[WASTE_LABWARE], '11', 'waste reservoir').wells()[0].top(-10)

    ## REAGENT RESERVOIR
    if REAGENT_LABWARE not in REAGENT_LW_DICT:
        raise Exception('Invalid REAGENT_LABWARE. Must be one of the \
    following:\nnest 12 reservoir plate')

    reagent_res = ctx.load_labware(
        REAGENT_LW_DICT[REAGENT_LABWARE], '7', 'reagent reservoir')

    ## TIPS
    # using standard tip definition despite actually using filter tips
    # so that the tips can accommodate ~220µl per transfer for efficiency
    tips300 = [
        ctx.load_labware(
            'opentrons_96_tiprack_300ul', slot, '200µl filter tiprack')
        for slot in ['2', '3', '5', '6', '9','4']
    ]
    tips1000 = [
        ctx.load_labware('opentrons_96_filtertiprack_1000ul', slot,
                         '1000µl filter tiprack')
        for slot in ['8']
    ]

    # reagents and samples
    num_cols = math.ceil(NUM_SAMPLES/8)
    mag_samples_m = magplate.rows()[0][:num_cols]
    mag_samples_s = magplate.wells()[:NUM_SAMPLES]
    elution_samples_m = elution_plate.rows()[0][:num_cols]
    elution_buffer = reagent_res.wells()[0]
    bead_buffer = reagent_res.wells()[1:5]
    wash_sets = [reagent_res.wells()[i:i+2] for i in [5, 7, 9]]

    # pipettes
    m300 = ctx.load_instrument('p300_multi_gen2', 'left', tip_racks=tips300)
    p1000 = ctx.load_instrument('p1000_single_gen2', 'right',
                                tip_racks=tips1000)

    m300.flow_rate.aspirate = 150
    m300.flow_rate.dispense = 300
    m300.flow_rate.blow_out = 300
    p1000.flow_rate.aspirate = 100
    p1000.flow_rate.dispense = 1000
    p1000.flow_rate.blow_out = 1000

    if(DISPENSE_BEADS):
        # premix, transfer, and mix magnetic beads with sample
        ## bead dests depending on number of samples
        bead_dests = bead_buffer[:math.ceil(num_cols/4)]
        dispense_beads(bead_dests,mag_samples_m,m300,tips300)
    else:
        # Mix bead
        mix_beads(7, mag_samples_m,m300,tips300)

    # incubate off and on magnet
    ctx.delay(minutes=5, msg='Incubating off magnet for 5 minutes.')

    ## First incubate on magnet.
    magdeck.engage(height_from_base=22)
    ctx.delay(minutes=5, msg='Incubating on magnet for 5 minutes.')

    # remove supernatant with P1000
    remove_supernatant(mag_samples_s,waste,p1000,tips1000)

    # 3x washes
    wash(wash_sets,mag_samples_m,waste,magdeck,m300,tips300)

    # elute samples
    magdeck.disengage()
    elute_samples(mag_samples_m,elution_samples_m,elution_buffer,magdeck,m300,tips300)

    # track final used tip
    save_tip_info()
    magdeck.disengage()
    finish_run()
def run(ctx: protocol_api.ProtocolContext):
    from opentrons.drivers.rpi_drivers import gpio
    gpio.set_rail_lights(False) #Turn off lights (termosensible reagents)
    ctx.comment('Actual used columns: ' + str(num_cols))

    # Define the STEPS of the protocol
    STEP = 0
    STEPS = {  # Dictionary with STEP activation, description, and times
        1: {'Execute': True, 'description': 'Transfer MMIX'},
        2: {'Execute': True, 'description': 'Transfer elution'}
    }

    for s in STEPS:  # Create an empty wait_time
        if 'wait_time' not in STEPS[s]:
            STEPS[s]['wait_time'] = 0

    #Folder and file_path for log time
    folder_path = '/var/lib/jupyter/notebooks/'+run_id'
    if not ctx.is_simulating():
        if not os.path.isdir(folder_path):
            os.mkdir(folder_path)
        file_path = folder_path + '/KC_qPCR_time_log.txt'

    # Define Reagents as objects with their properties
    class Reagent:
        def __init__(self, name, flow_rate_aspirate, flow_rate_dispense, rinse,
                     reagent_reservoir_volume, delay, num_wells, h_cono, v_fondo,
                      tip_recycling = 'none'):
            self.name = name
            self.flow_rate_aspirate = flow_rate_aspirate
            self.flow_rate_dispense = flow_rate_dispense
            self.rinse = bool(rinse)
            self.reagent_reservoir_volume = reagent_reservoir_volume
            self.delay = delay
            self.num_wells = num_wells
            self.col = 0
            self.vol_well = 0
            self.h_cono = h_cono
            self.v_cono = v_fondo
            self.unused=[]
            self.tip_recycling = tip_recycling
            self.vol_well_original = reagent_reservoir_volume / num_wells

    # Reagents and their characteristics
    MMIX = Reagent(name = 'Master Mix',
                      rinse = False,
                      flow_rate_aspirate = 1,
                      flow_rate_dispense = 1,
                      reagent_reservoir_volume = volume_mmix_available,
                      num_wells = 2, #change with num samples
                      delay = 0,
                      h_cono = h_cone,
                      v_fondo = volume_cone  # V cono
                      )

    Samples = Reagent(name='Samples',
                      rinse=False,
                      flow_rate_aspirate = 1,
                      flow_rate_dispense = 1,
                      reagent_reservoir_volume=50,
                      delay=0,
                      num_wells=num_cols,  # num_cols comes from available columns
                      h_cono=0,
                      v_fondo=0
                      )

    MMIX.vol_well = MMIX.vol_well_original
    Samples.vol_well = Samples.vol_well_original

    ##################
    # Custom functions


    def divide_destinations(l, n):
        # Divide the list of destinations in size n lists.
        for i in range(0, len(l), n):
            yield l[i:i + n]

    def distribute_custom(pipette, volume, src, dest, waste_pool, pickup_height, extra_dispensal, disp_height=0):
        # Custom distribute function that allows for blow_out in different location and adjustement of touch_tip
        pipette.aspirate((len(dest) * volume) +
                         extra_dispensal, src.bottom(pickup_height))
        pipette.touch_tip(speed=20, v_offset=-5)
        pipette.move_to(src.top(z=5))
        pipette.aspirate(20)  # air gap
        for d in dest:
            pipette.dispense(20, d.top())
            drop = d.top(z = disp_height)
            pipette.dispense(volume, drop)
            pipette.move_to(d.top(z=5))
            pipette.aspirate(20)  # air gap
        try:
            pipette.blow_out(waste_pool.wells()[0].bottom(pickup_height + 3))
        except:
            pipette.blow_out(waste_pool.bottom(pickup_height + 3))
        return (len(dest) * volume)

    def move_vol_multichannel(pipet, reagent, source, dest, vol, air_gap_vol, x_offset,
                       pickup_height, rinse, disp_height, blow_out, touch_tip):
        '''
        x_offset: list with two values. x_offset in source and x_offset in destination i.e. [-1,1]
        pickup_height: height from bottom where volume
        rinse: if True it will do 2 rounds of aspirate and dispense before the tranfer
        disp_height: dispense height; by default it's close to the top (z=-2), but in case it is needed it can be lowered
        blow_out, touch_tip: if True they will be done after dispensing
        '''
        # Rinse before aspirating
        if rinse == True:
            custom_mix(pipet, reagent, location = source, vol = vol,
                       rounds = 2, blow_out = True, mix_height = 0,
                       x_offset = x_offset)
        # SOURCE
        s = source.bottom(pickup_height).move(Point(x = x_offset[0]))
        pipet.aspirate(vol, s, rate = reagent.flow_rate_aspirate)  # aspirate liquid
        if air_gap_vol != 0:  # If there is air_gap_vol, switch pipette to slow speed
            pipet.aspirate(air_gap_vol, source.top(z = -2),
                           rate = reagent.flow_rate_aspirate)  # air gap
        # GO TO DESTINATION
        drop = dest.top(z = disp_height).move(Point(x = x_offset[1]))
        pipet.dispense(vol + air_gap_vol, drop,
                       rate = reagent.flow_rate_dispense)  # dispense all
        ctx.delay(seconds = reagent.delay) # pause for x seconds depending on reagent
        if blow_out == True:
            pipet.blow_out(dest.top(z = -2))
        if touch_tip == True:
            pipet.touch_tip(speed = 20, v_offset = -5, radius = 0.9)


    def custom_mix(pipet, reagent, location, vol, rounds, blow_out, mix_height,
    x_offset, source_height = 3):
        '''
        Function for mixing a given [vol] in the same [location] a x number of [rounds].
        blow_out: Blow out optional [True,False]
        x_offset = [source, destination]
        source_height: height from bottom to aspirate
        mix_height: height from bottom to dispense
        '''
        if mix_height == 0:
            mix_height = 3
        pipet.aspirate(1, location=location.bottom(
            z=source_height).move(Point(x=x_offset[0])), rate=reagent.flow_rate_aspirate)
        for _ in range(rounds):
            pipet.aspirate(vol, location=location.bottom(
                z=source_height).move(Point(x=x_offset[0])), rate=reagent.flow_rate_aspirate)
            pipet.dispense(vol, location=location.bottom(
                z=mix_height).move(Point(x=x_offset[1])), rate=reagent.flow_rate_dispense)
        pipet.dispense(1, location=location.bottom(
            z=mix_height).move(Point(x=x_offset[1])), rate=reagent.flow_rate_dispense)
        if blow_out == True:
            pipet.blow_out(location.top(z=-2))  # Blow out

    def calc_height(reagent, cross_section_area, aspirate_volume, min_height = 0.5, extra_volume = 50):
        nonlocal ctx
        ctx.comment('Remaining volume ' + str(reagent.vol_well) +
                    '< needed volume ' + str(aspirate_volume) + '?')
        if reagent.vol_well < aspirate_volume + extra_volume:
            reagent.unused.append(reagent.vol_well)
            ctx.comment('Next column should be picked')
            ctx.comment('Previous to change: ' + str(reagent.col))
            # column selector position; intialize to required number
            reagent.col = reagent.col + 1
            ctx.comment(str('After change: ' + str(reagent.col)))
            reagent.vol_well = reagent.vol_well_original
            ctx.comment('New volume:' + str(reagent.vol_well))
            height = (reagent.vol_well - aspirate_volume - reagent.v_cono) / cross_section_area
                    #- reagent.h_cono
            reagent.vol_well = reagent.vol_well - aspirate_volume
            ctx.comment('Remaining volume:' + str(reagent.vol_well))
            if height < min_height:
                height = min_height
            col_change = True
        else:
            height = (reagent.vol_well - aspirate_volume - reagent.v_cono) / cross_section_area #- reagent.h_cono
            reagent.vol_well = reagent.vol_well - aspirate_volume
            ctx.comment('Calculated height is ' + str(height))
            if height < min_height:
                height = min_height
            ctx.comment('Used height is ' + str(height))
            col_change = False
        return height, col_change

    ####################################
    # load labware and modules
    # 24 well rack
    tuberack = ctx.load_labware(
        'opentrons_24_aluminumblock_generic_2ml_screwcap', '2',
        'Bloque Aluminio opentrons 24 screwcaps 2000 µL ')

    ############################################
    # tempdeck
    tempdeck = ctx.load_module('tempdeck', '4')
    tempdeck.set_temperature(temperature)

    ##################################
    # qPCR plate - final plate, goes to PCR
    qpcr_plate = tempdeck.load_labware(
        'abi_fast_qpcr_96_alum_opentrons_100ul',
        'chilled qPCR final plate')

    ##################################
    # Sample plate - comes from B
    source_plate = ctx.load_labware(
        "kingfisher_std_96_wellplate_550ul", '1',
        'chilled KF plate with elutions (alum opentrons)')
    samples = source_plate.wells()[:NUM_SAMPLES]

    ##################################
    # Load Tipracks
    tips20 = [
        ctx.load_labware('opentrons_96_filtertiprack_20ul', slot)
        for slot in ['5']
    ]

    tips200 = [
        ctx.load_labware('opentrons_96_filtertiprack_200ul', slot)
        for slot in ['6']
    ]

    ################################################################################
    # Declare which reagents are in each reservoir as well as deepwell and elution plate
    MMIX.reagent_reservoir = tuberack.rows()[0][:MMIX.num_wells] # 1 row, 2 columns (first ones)
    ctx.comment('Wells in: '+ str(tuberack.rows()[0][:MMIX.num_wells]) + ' element: '+str(MMIX.reagent_reservoir[MMIX.col]))
    # setup up sample sources and destinations
    samples = source_plate.wells()[:NUM_SAMPLES]
    samples_multi = source_plate.rows()[0][:num_cols]
    pcr_wells = qpcr_plate.wells()[:NUM_SAMPLES]
    pcr_wells_multi = qpcr_plate.rows()[0][:num_cols]
    # Divide destination wells in small groups for P300 pipette
    dests = list(divide_destinations(pcr_wells, size_transfer))


    # pipettes
    m20 = ctx.load_instrument(
        'p20_multi_gen2', mount='right', tip_racks=tips20)
    p300 = ctx.load_instrument(
        'p300_single_gen2', mount='left', tip_racks=tips200)

    # used tip counter and set maximum tips available
    tip_track = {
        'counts': {p300: 0,
                   m20: 0}
    }

    ############################################################################
    # STEP 1: Transfer Master MIX
    ############################################################################
    STEP += 1
    if STEPS[STEP]['Execute'] == True:
        start = datetime.now()
        p300.pick_up_tip()

        used_vol=[]
        for dest in dests:
            aspirate_volume=volume_mmix * len(dest) + extra_dispensal
            [pickup_height,col_change]=calc_height(MMIX, area_section_screwcap, aspirate_volume)
            used_vol_temp = distribute_custom(
            p300, volume = volume_mmix, src = MMIX.reagent_reservoir[MMIX.col], dest = dest,
            waste_pool = MMIX.reagent_reservoir[MMIX.col], pickup_height = pickup_height,
            extra_dispensal = extra_dispensal)
            used_vol.append(used_vol_temp)
        p300.drop_tip()
        tip_track['counts'][p300]+=1
        #MMIX.unused_two = MMIX.vol_well

        end = datetime.now()
        time_taken = (end - start)
        ctx.comment('Step ' + str(STEP) + ': ' +
                    STEPS[STEP]['description'] + ' took ' + str(time_taken))
        STEPS[STEP]['Time:'] = str(time_taken)

    ############################################################################
    # STEP 2: TRANSFER Samples
    ############################################################################

    STEP += 1
    if STEPS[STEP]['Execute'] == True:
        start = datetime.now()
        ctx.comment('pcr_wells')
        #Loop over defined wells
        for s, d in zip(samples_multi, pcr_wells_multi):
            m20.pick_up_tip()
            #Source samples
            move_vol_multichannel(m20, reagent = Samples, source = s, dest = d,
            vol = volume_sample, air_gap_vol = air_gap_sample, x_offset = x_offset,
                   pickup_height = 0.2, disp_height = -10, rinse = False,
                   blow_out=True, touch_tip=False)
            m20.drop_tip()
            tip_track['counts'][m20]+=8

        end = datetime.now()
        time_taken = (end - start)
        ctx.comment('Step ' + str(STEP) + ': ' +
                    STEPS[STEP]['description'] + ' took ' + str(time_taken))
        STEPS[STEP]['Time:'] = str(time_taken)

    # Export the time log to a tsv file
    if not ctx.is_simulating():
        with open(file_path, 'w') as f:
            f.write('STEP\texecution\tdescription\twait_time\texecution_time\n')
            for key in STEPS.keys():
                row = str(key)
                for key2 in STEPS[key].keys():
                    row += '\t' + format(STEPS[key][key2])
                f.write(row + '\n')
        f.close()

    ############################################################################
    # Light flash end of program
    gpio.set_rail_lights(False)
    time.sleep(2)
    #os.system('mpg123 -f -8000 /var/lib/jupyter/notebooks/toreador.mp3 &')
    for i in range(3):
        gpio.set_rail_lights(False)
        gpio.set_button_light(1, 0, 0)
        time.sleep(0.3)
        gpio.set_rail_lights(True)
        gpio.set_button_light(0, 0, 1)
        time.sleep(0.3)
        gpio.set_rail_lights(False)
    gpio.set_button_light(0, 1, 0)
    ctx.comment('Finished! \nMove plate to PCR')

    if STEPS[1]['Execute'] == True:
        total_used_vol = np.sum(used_vol)
        total_needed_volume = total_used_vol
        ctx.comment('Total Master Mix used volume is: ' + str(total_used_vol) + '\u03BCl.')
        ctx.comment('Needed Master Mix volume is ' +
                    str(total_needed_volume + extra_dispensal*len(dests)) +'\u03BCl')
        ctx.comment('Used Master Mix volumes per run are: ' + str(used_vol) + '\u03BCl.')
        ctx.comment('Master Mix Volume remaining in tubes is: ' +
                    format(np.sum(MMIX.unused)+extra_dispensal*len(dests)+MMIX.vol_well) + '\u03BCl.')
        ctx.comment('200 ul Used tips in total: ' + str(tip_track['counts'][p300]))
        ctx.comment('200 ul Used racks in total: ' + str(tip_track['counts'][p300] / 96))

    if STEPS[2]['Execute'] == True:
        ctx.comment('20 ul Used tips in total: ' + str(tip_track['counts'][m20]))
        ctx.comment('20 ul Used racks in total: ' + str(tip_track['counts'][m20] / 96))
Example #24
0
def run(ctx: protocol_api.ProtocolContext):
    global MM_TYPE

    # check source (elution) labware type
    source_plate = ctx.load_labware(
        'opentrons_96_aluminumblock_nest_wellplate_100ul', '1',
        'chilled elution plate on block from Station B')
    tips20 = [
        ctx.load_labware('opentrons_96_filtertiprack_20ul', slot)
        for slot in ['3', '6', '8', '9', '10', '11']
    ]
    tips300 = [ctx.load_labware('opentrons_96_filtertiprack_200ul', '2')]
    tempdeck = ctx.load_module('Temperature Module Gen2', '4')
    pcr_plate = tempdeck.load_labware(
        'opentrons_96_aluminumblock_nest_wellplate_100ul', 'PCR plate')
    mm_strips = ctx.load_labware(
        'opentrons_96_aluminumblock_nest_wellplate_100ul', '7',
        'mastermix strips')
    tempdeck.set_temperature(4)
    tube_block = ctx.load_labware(
        'opentrons_24_aluminumblock_nest_2ml_screwcap', '5',
        '2ml screw tube aluminum block for mastermix + controls')

    # pipette
    m20 = ctx.load_instrument('p20_multi_gen2', 'right', tip_racks=tips20)
    p300 = ctx.load_instrument('p300_single_gen2', 'left', tip_racks=tips300)

    # setup up sample sources and destinations
    num_cols = math.ceil(NUM_SAMPLES/8)
    sources = source_plate.rows()[0][:num_cols]
    sample_dests = pcr_plate.rows()[0][:num_cols]

    tip_log = {'count': {}}
    folder_path = '/data/C'
    tip_file_path = folder_path + '/tip_log.json'
    if TIP_TRACK and not ctx.is_simulating():
        if os.path.isfile(tip_file_path):
            with open(tip_file_path) as json_file:
                data = json.load(json_file)
                if 'tips20' in data:
                    tip_log['count'][m20] = data['tips20']
                else:
                    tip_log['count'][m20] = 0
                if 'tips300' in data:
                    tip_log['count'][p300] = data['tips300']
                else:
                    tip_log['count'][p300] = 0
        else:
            tip_log['count'] = {m20: 0, p300: 0}
    else:
        tip_log['count'] = {m20: 0, p300: 0}

    tip_log['tips'] = {
        m20: [tip for rack in tips20 for tip in rack.rows()[0]],
        p300: [tip for rack in tips300 for tip in rack.wells()]
    }
    tip_log['max'] = {
        pip: len(tip_log['tips'][pip])
        for pip in [m20, p300]
    }

    def pick_up(pip):
        nonlocal tip_log
        if tip_log['count'][pip] == tip_log['max'][pip]:
            ctx.pause('Replace ' + str(pip.max_volume) + 'µl tipracks before \
resuming.')
            pip.reset_tipracks()
            tip_log['count'][pip] = 0
        pip.pick_up_tip(tip_log['tips'][pip][tip_log['count'][pip]])
        tip_log['count'][pip] += 1

    """ mastermix component maps """
    mm_tube = tube_block.wells()[0]
    mm_dict = {
        'volume': 15,
        'components': {
            tube: vol for tube, vol in zip(tube_block.columns()[1][:3],
                                           [6.25, 1.25, 7.5])
        }
    }

    vol_overage = 1.2 if NUM_SAMPLES > 48 else 1.1  # decrease overage for small sample number
    total_mm_vol = mm_dict['volume']*(NUM_SAMPLES+2)*vol_overage
    # translate total mastermix volume to starting height
    r = mm_tube.diameter/2
    mm_height = total_mm_vol/(math.pi*(r**2)) - 5

    def h_track(vol):
        nonlocal mm_height
        dh = 1.1*vol/(math.pi*(r**2))  # compensate for 10% theoretical volume loss
        mm_height = mm_height - dh if mm_height - dh > 2 else 2  # stop at 2mm above mm tube bottom
        return mm_tube.bottom(mm_height)

    if PREPARE_MASTERMIX:
        vol_overage = 1.2 if NUM_SAMPLES > 48 else 1.1

        for i, (tube, vol) in enumerate(mm_dict['components'].items()):
            comp_vol = vol*(NUM_SAMPLES)*vol_overage
            pick_up(p300)
            num_trans = math.ceil(comp_vol/160)
            vol_per_trans = comp_vol/num_trans
            for _ in range(num_trans):
                p300.air_gap(20)
                p300.aspirate(vol_per_trans, tube)
                ctx.delay(seconds=3)
                p300.touch_tip(tube)
                p300.air_gap(20)
                p300.dispense(20, mm_tube.top())  # void air gap
                p300.dispense(vol_per_trans, mm_tube.bottom(2))
                p300.dispense(20, mm_tube.top())  # void pre-loaded air gap
                p300.blow_out(mm_tube.top())
                p300.touch_tip(mm_tube)
            if i < len(mm_dict['components'].items()) - 1:  # only keep tip if last component and p300 in use
                p300.drop_tip()
        mm_total_vol = mm_dict['volume']*(NUM_SAMPLES)*vol_overage
        if not p300.hw_pipette['has_tip']:  # pickup tip with P300 if necessary for mixing
            pick_up(p300)
        mix_vol = mm_total_vol / 2 if mm_total_vol / 2 <= 200 else 200  # mix volume is 1/2 MM total, maxing at 200µl
        mix_loc = mm_tube.bottom(20) if NUM_SAMPLES > 48 else mm_tube.bottom(5)
        p300.mix(7, mix_vol, mix_loc)
        p300.blow_out(mm_tube.top())
        p300.touch_tip()

    # transfer mastermix to strips
    mm_strip = mm_strips.columns()[0]
    if not p300.hw_pipette['has_tip']:
        pick_up(p300)
    for i, well in enumerate(mm_strip):
        if NUM_SAMPLES % 8 == 0 or i < NUM_SAMPLES % 8:
            vol = num_cols*mm_dict['volume']*((vol_overage-1)/2+1)
        else:
            vol = (num_cols-1)*mm_dict['volume']*((vol_overage-1)/2+1)
        p300.transfer(vol, mm_tube, well, new_tip='never')
    p300.drop_tip()

    # transfer mastermix to plate
    mm_vol = mm_dict['volume']
    pick_up(m20)
    m20.transfer(mm_vol, mm_strip[0].bottom(0.5), sample_dests,
                 new_tip='never')
    m20.drop_tip()

    # transfer samples to corresponding locations
    for s, d in zip(sources, sample_dests):
        pick_up(m20)
        m20.transfer(SAMPLE_VOL, s.bottom(2), d.bottom(2), new_tip='never')
        m20.mix(1, 10, d.bottom(2))
        m20.blow_out(d.top(-2))
        m20.aspirate(5, d.top(2))  # suck in any remaining droplets on way to trash
        m20.drop_tip()

    # track final used tip
    if TIP_TRACK and not ctx.is_simulating():
        if not os.path.isdir(folder_path):
            os.mkdir(folder_path)
        data = {
            'tips20': tip_log['count'][m20],
            'tips300': tip_log['count'][p300]
        }
        with open(tip_file_path, 'w') as outfile:
            json.dump(data, outfile)
Example #25
0
def run(protocol: protocol_api.ProtocolContext):
    #######################################################################################################################################
    ## SETUP

    # Load Labware
    temp_mod = protocol.load_module('Temperature Module', '9')
    reaction_plate = temp_mod.load_labware(
        "corning_384_wellplate_112ul_flat",
        label="reaction plate")  # where the magic happens
    # tube_rack = protocol.load_labware("opentrons_96_aluminumblock_generic_pcr_strip_200ul", "6", label = "aluminum block") # CBS and substrate stocks
    sample_plate = protocol.load_labware(
        "greiner_96_wellplate_323ul", "6",
        label="sample plate")  # CBS and substrate stocks
    reservoir_plate = protocol.load_labware(
        "usascientific_12_reservoir_22ml", "8",
        label='reservoir plate')  # DTNB detection reagent
    library_plate = protocol.load_labware(
        "greiner_96_wellplate_323ul", "5",
        label="library plate")  # compound library

    # Specify tip racks
    tiprack1 = protocol.load_labware("opentrons_96_tiprack_10ul", '2')
    tiprack2 = protocol.load_labware("opentrons_96_tiprack_300ul", '3')

    # Load pipettes and set parameters
    p10 = protocol.load_instrument("p10_multi", "right", tip_racks=[tiprack1])
    p50 = protocol.load_instrument('p50_multi', "left", tip_racks=[tiprack2])

    p10.flow_rate.aspirate = 8
    p10.flow_rate.dispense = 8
    # 384-well depth is 11.56 mm and max volume is 112 uL
    # 20 uL is 2 mm high, tandem (middle) wall is 5.1 mm high
    p50.well_bottom_clearance.dispense = 3.5

    # Specify target wells
    cols_compounds = [6, 7, 8, 9, 10]
    cols_noSAM = [9, 10, 11, 12, 13]
    cols_SAM = [14, 15, 16, 17, 18]
    wells_reaction_noSAM = ['A' + str(i) for i in cols_noSAM]
    wells_reaction_SAM = ['A' + str(i) for i in cols_SAM]
    wells_reaction = ['A' + str(i) for i in (cols_noSAM + cols_SAM)]
    wells_detection = ['B' + str(i) for i in (cols_noSAM + cols_SAM)]

    #######################################################################################################################################
    ## PROCEDURE

    # Transfer 20uL detection reagent from reservoir to reaction plate
    p50.distribute(
        20,
        reservoir_plate.columns_by_name()["1"],
        [reaction_plate.wells_by_name()[i] for i in wells_detection])

    # Distribute 2uL compound from 96-well library plate onto odd rows
    p10.distribute(
        2,
        library_plate.columns_by_name()["6"],
        [reaction_plate.wells_by_name()[i] for i in ["A9", "A14"]],
        new_tip='once',
        touch_tip=True)  # each compound is tested w/ and w/o SAM (30 uM)
    p10.distribute(2,
                   library_plate.columns_by_name()["7"],
                   [reaction_plate.wells_by_name()[i] for i in ["A10", "A15"]],
                   new_tip='once',
                   touch_tip=True)
    p10.distribute(2,
                   library_plate.columns_by_name()["8"],
                   [reaction_plate.wells_by_name()[i] for i in ["A11", "A16"]],
                   new_tip='once',
                   touch_tip=True)
    p10.distribute(2,
                   library_plate.columns_by_name()["9"],
                   [reaction_plate.wells_by_name()[i] for i in ["A12", "A17"]],
                   new_tip='once',
                   touch_tip=True)
    p10.distribute(2,
                   library_plate.columns_by_name()["10"],
                   [reaction_plate.wells_by_name()[i] for i in ["A13", "A18"]],
                   new_tip='once',
                   touch_tip=True)

    # Distribute 10uL protein onto odd rows
    p50.distribute(10,
                   sample_plate.columns_by_name()["4"],
                   [reaction_plate.wells_by_name()[i] for i in wells_reaction],
                   new_tip='once')

    # Transfer 8 uL reaction mix to reaction plate
    p50.distribute(
        8,
        sample_plate.columns_by_name()["5"],
        [reaction_plate.wells_by_name()[i] for i in wells_reaction_noSAM],
        touch_tip=True)  # no SAM
    p50.distribute(
        8,
        sample_plate.columns_by_name()["6"],
        [reaction_plate.wells_by_name()[i] for i in wells_reaction_SAM],
        touch_tip=True)  # SAM (30uM)


# SAMPLE CODE
# p20.transfer(20,reservoir_plate.wells_by_name()["A1"],mix_plate.wells_by_name()["A1"])
# p20.distribute(10,reservoir_plate.wells_by_name()["A2"],[mix_plate.wells_by_name()[well_name] for well_name in ["B1","C1","E1","G1","H1"]])
# p20.pick_up_tip()
# p20.transfer(10,mix_plate.wells_by_name()["A1"],mix_plate.wells_by_name()["B1"],mix_after=(3,10),new_tip="never")
# p20.transfer(10,mix_plate.wells_by_name()["B1"],mix_plate.wells_by_name()["C1"],mix_after=(3,10),new_tip="never")
# p20.transfer(10,mix_plate.wells_by_name()["C1"],mix_plate.wells_by_name()["D1"],mix_after=(3,10),new_tip="never")
# p20.transfer(10,mix_plate.wells_by_name()["D1"],mix_plate.wells_by_name()["E1"],mix_after=(3,10),new_tip="never")
# p20.drop_tip()
# p20.transfer(20,reservoir_plate.wells_by_name()["A3"],mix_plate.wells_by_name()["F1"])
# p20.pick_up_tip()
# p20.transfer(10,mix_plate.wells_by_name()["F1"],mix_plate.wells_by_name()["G1"],mix_after=(3,10),new_tip="never")
# p20.transfer(10,mix_plate.wells_by_name()["G1"],mix_plate.wells_by_name()["H1"],mix_after=(3,10),new_tip="never")
# p20.drop_tip()

# p10.transfer(4,mix_plate.wells_by_name()["A1"],mix_plate.wells_by_name()["A2"])
# p20.transfer(36,reservoir_plate.wells_by_name()["A4"],mix_plate.columns_by_name()["2"],new_tip='always')
# p10.well_bottom_clearance.dispense = 1
# rows=["A","B","C","D","E","F","G","H"]
# reaction_row_dest = "B"
# p10.transfer(10,mix_plate.columns_by_name()["2"],[reaction_plate.wells_by_name()[well_name] for well_name in ["B2","B3","B4"]])
# # for row in rows:
# # 	p20.distribute(10,mix_plate.wells_by_name()[(row+"2")],[reaction_plate.wells_by_name()[well_name] for well_name in [chr(ord(row)+1)+"2",chr(ord(row)+1)+"3",chr(ord(row)+1)+"4"]])
# p20.transfer(10,reservoir_plate.wells_by_name()["A4"],[reaction_plate.wells_by_name()[well_name] for well_name in ["J2","J3","J4"]])
Example #26
0
def run(protocol: protocol_api.ProtocolContext):
    if debug: print(protocol)

    tiprack_300 = protocol.load_labware('opentrons_96_tiprack_300ul',
                                        labwarePositions.tiprack_300,
                                        "tiprack 300ul")

    if debug: print(tiprack_300)
    pipette_300 = protocol.load_instrument(
        'p300_single_gen2' if pipette_300_GEN == 'GEN2' else 'p300_single',
        pipette_300_location,
        tip_racks=[tiprack_300])
    #    pipette_300 = protocol.load_instrument('p300_single', 'right', tip_racks=[tiprack_300])
    pipette_300.flow_rate.dispense = default_flow_rate
    pipette_300.flow_rate.aspirate = default_flow_rate
    pipette_300.starting_tip = tiprack_300.wells()[tiprack_300_starting_pos -
                                                   1]
    # pipette_300.starting_tip = tiprack_300.well(tiprack_starting_pos['tiprack_300'])

    if debug: print(pipette_300)

    black_96 = protocol.load_labware(type_of_96well_plate,
                                     labwarePositions.antibodies_plate,
                                     type_of_96well_plate)

    trough12 = protocol.load_labware('parhelia_12trough',
                                     labwarePositions.buffers_reservoir,
                                     '12-trough buffers reservoir')
    if (not retrieval):
        par2 = protocol.load_labware(omniStainer_type, labwarePositions.par2,
                                     omniStainer_type)
    if retrieval:
        temp_mod = protocol.load_module('temperature module',
                                        labwarePositions.heatmodule)

        par2 = temp_mod.load_labware(omniStainer_type)
    wellslist = list(par2.wells_by_name().keys())
    wellslist = wellslist[1:num_samples + 1]
    if debug: print(par2)

    buffer_wells = trough12.wells_by_name()

    buffers = Object()
    buffers.retrieval = buffer_wells['A1']
    buffers.TBS_wash = buffer_wells['A2']
    buffers.water = buffer_wells['A3']
    buffers.storage = buffer_wells['A4']
    buffers.eth_70perc_ = buffer_wells['A5']
    buffers.eth_80perc = buffer_wells['A6']
    buffers.eth_95perc = buffer_wells['A7']
    buffers.eth_100perc = buffer_wells['A8']
    buffers.hematoxylin = buffer_wells['A12']

    preblock_wells = black_96.rows()[0]
    antibody_wells = black_96.rows()[5]
    enzymeblock_wells = black_96.rows()[1]
    hrpsecondaryab_wells = black_96.rows()[2]
    substrate_wells = black_96.rows()[3]
    DAB_wells = black_96.rows()[4]

    sample_chambers = []

    for well in wellslist:
        sample_chambers.append(par2.wells_by_name()[well])

    if debug: print(sample_chambers)

    #################PROTOCOL####################
    protocol.home()

    if lid == 'yes':
        openPar2(protocol, pipette_300, par2)

    if retrieval:
        washSamples(pipette_300, buffers.retrieval, buffers.retrieval, 2, 1,
                    extra_bottom_gap + 18)
        washSamples(pipette_300, buffers.retrieval, sample_chambers,
                    wash_volume, 2, extra_bottom_gap)

        if lid == 'yes':
            closePar2(protocol, pipette_300, par2)

        temp_mod.set_temperature(95)
        print("retrieval")
        protocol.delay(minutes=15)
        #        washSamples(pipette_300, buffers.retrieval, sample_chambers, wash_volume, 1, extra_bottom_gap)
        protocol.delay(minutes=15)
        #        washSamples(pipette_300, buffers.retrieval, sample_chambers, wash_volume, 1, extra_bottom_gap)
        protocol.delay(minutes=15)
        print("cooling down to RT")
        temp_mod.set_temperature(25)
        protocol.delay(minutes=20)
        if lid == 'yes':
            openPar2(protocol, pipette_300, par2)

    # WASHING SAMPLES WITH TBS
    print("washing in TBS")
    washSamples(pipette_300, buffers.TBS_wash, buffers.TBS_wash, 2, 1,
                extra_bottom_gap + 18)
    washSamples(pipette_300, buffers.TBS_wash, sample_chambers, wash_volume, 2,
                extra_bottom_gap)

    # Preblocking
    print("preblocking")
    print(len(wellslist))

    print("puncturing preblock wells")
    for i in range(len(wellslist)):
        print(i)
        washSamples(pipette_300,
                    preblock_wells[i],
                    preblock_wells[i],
                    2,
                    1,
                    extra_bottom_gap + 18,
                    keep_tip=True)
    pipette_300.drop_tip()

    print("applying the preblock")
    for i in range(len(wellslist)):
        print(i)
        washSamples(pipette_300, preblock_wells[i], sample_chambers[i],
                    ab_volume, 1, extra_bottom_gap)
    print("preblocking incubation: 15 min")
    protocol.delay(minutes=15)

    # APPLYING ANTIBODY COCKTAILS TO SAMPLES

    print("puncturing and applying abs")
    for i in range(len(wellslist)):
        print(i)
        washSamples(pipette_300,
                    antibody_wells[i],
                    antibody_wells[i],
                    2,
                    1,
                    extra_bottom_gap + 18,
                    keep_tip=True)
        washSamples(pipette_300, antibody_wells[i], sample_chambers[i],
                    ab_volume, 1, extra_bottom_gap)

    if lid == 'yes':
        closePar2(protocol, pipette_300, par2)

    # INCUBATE FOR DESIRED TIME
    print("staining incubation: " + str(primary_ab_incubation_time_minutes) +
          "min")
    protocol.delay(minutes=primary_ab_incubation_time_minutes)

    if lid == 'yes':
        openPar2(protocol, pipette_300, par2)

    # WASHING SAMPLES WITH TBS
    # three individual repeats below is because they need particular incubation time between them
    print("washing with TBS")
    for i in range(5):
        washSamples(pipette_300, buffers.TBS_wash, sample_chambers,
                    wash_volume, 1, extra_bottom_gap)
        protocol.delay(minutes=3)

    # APPLYING enzyme blocking
    print("puncturing enzyme blocking wells")
    for i in range(len(wellslist)):
        washSamples(pipette_300,
                    enzymeblock_wells[i],
                    enzymeblock_wells[i],
                    2,
                    1,
                    extra_bottom_gap + 18,
                    keep_tip=True)
    pipette_300.drop_tip()

    print("applying enzyme blocking")
    for i in range(len(wellslist)):
        washSamples(pipette_300, enzymeblock_wells[i], sample_chambers[i],
                    ab_volume, 1, extra_bottom_gap)
    # INCUBATE 10 MIN
    print("hrp blocking incubation: 10min")
    protocol.delay(minutes=10)

    washSamples(pipette_300, buffers.TBS_wash, sample_chambers, wash_volume, 3,
                extra_bottom_gap)

    # APPLYING HRP SECONDARY ANTIBODY COCKTAILS TO SAMPLES
    print("puncturing hrpsecondaryab wells")
    for i in range(len(wellslist)):
        washSamples(pipette_300,
                    hrpsecondaryab_wells[i],
                    hrpsecondaryab_wells[i],
                    2,
                    1,
                    extra_bottom_gap + 18,
                    keep_tip=True)
    pipette_300.drop_tip()

    print("applying hrpsecondaryab")
    for i in range(len(wellslist)):
        washSamples(pipette_300, hrpsecondaryab_wells[i], sample_chambers[i],
                    ab_volume, 1, extra_bottom_gap)
    if lid == 'yes':
        closePar2(protocol, pipette_300, par2)

    # INCUBATE FOR DESIRED TIME
    print("staining incubation: " + str(secondary_ab_incubation_time_minutes) +
          "min")
    protocol.delay(minutes=secondary_ab_incubation_time_minutes)

    if lid == 'yes':
        openPar2(protocol, pipette_300, par2)

    # three individual repeats below is because they need particular incubation time between them
    print("washing with TBS")
    for i in range(3):
        washSamples(pipette_300, buffers.TBS_wash, sample_chambers,
                    wash_volume, 1, extra_bottom_gap)
        protocol.delay(minutes=3)

    # DILUTING AND APPLYING THE DAB
    print("puncturing the DAB wells")
    for i in range(len(wellslist)):
        washSamples(pipette_300, DAB_wells[i], DAB_wells[i], 2, 1,
                    extra_bottom_gap + 18)
    print("puncturing the substrate wells")
    for i in range(len(wellslist)):
        washSamples(pipette_300,
                    substrate_wells[i],
                    substrate_wells[i],
                    2,
                    1,
                    extra_bottom_gap + 18,
                    keep_tip=True)
    pipette_300.drop_tip()

    print("applying DAB")
    for i in range(len(wellslist)):
        dilute_and_apply_fixative(pipette_300, DAB_wells[i],
                                  substrate_wells[i], sample_chambers[i],
                                  wash_volume)

    print("developing substrate")

    protocol.delay(minutes=10)

    washSamples(pipette_300, buffers.water, buffers.water, 2, 1,
                extra_bottom_gap + 18)
    washSamples(pipette_300, buffers.water, sample_chambers, wash_volume, 5,
                extra_bottom_gap)
    if lid == 'yes':
        closePar2(protocol, pipette_300, par2)
Example #27
0
def run(protocol: protocol_api.ProtocolContext):

	# which steps should be run?
	AddBeads = True
	AddBindingBuffer = True
	CaptureBinding = True
	Wash1 = True
	Wash2 = True
	Wash2repeat = True
	Dry = True
	Elute = True

	# set tweakable variables
	elution_volume = 100 # ul of water to add to final beads
	elution_to_plate = 70 # ul to transfer to final elution plate
	capture_depth = -3 # depth below ideal bottom of plate to remove supernatants, this may be required as a function of a poor calibration or labware def
	capture_min = 2 # number of minutes to capture beads on magnets
	cols_to_extract = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12] # which columns should be extracted?
	nmix = 5 # number of times to pipette to mix
	drying_min = 20 # number of minutes to evaporate residual ethanol !!!! SET TO 20
	trash_speed = 1 # the relative speed to discard of liquids into trash, this is an integer multiplier of normal speed, set higher to clear bubbles on outside of tip


	
	# define deck layout
	MagModule = protocol.load_module('magnetic module gen2', 10)
	BindingPlate = MagModule.load_labware('nest_96_wellplate_2ml_deep') # use the
	ElutionPlate = protocol.load_labware('biorad_96_wellplate_200ul_pcr', '3') # an empty biorad 96 well plate

	BeadsAndWater = protocol.load_labware('usascientific_12_reservoir_22ml', '2') # magbeads in A1 (4 mL), water in A2 (10mL), the end columns will be used for waste
	BindingBuffer = protocol.load_labware('agilent_1_reservoir_290ml', '7') # reservoir with 70 mL binding buffer
	MagWash1 = protocol.load_labware('agilent_1_reservoir_290ml', '4') # reservoir with 100 mL magwash1
	MagWash2 = protocol.load_labware('agilent_1_reservoir_290ml', '1') # reservoir with 200 mL magwash2

	tips_binding = protocol.load_labware('opentrons_96_filtertiprack_200ul', '11')
	tips_wash1 =  protocol.load_labware('opentrons_96_filtertiprack_200ul', '8')
	tips_wash2 =  protocol.load_labware('opentrons_96_filtertiprack_200ul', '5')
	tips_wash2_repeat =  protocol.load_labware('opentrons_96_filtertiprack_200ul', '9')
	tips_elution = protocol.load_labware('opentrons_96_filtertiprack_200ul', '6')

	fixed_trash = protocol.fixed_trash['A1']


	set_rail_lights = True

	# define pipettes
	multichannel = protocol.load_instrument('p300_multi_gen2', 'left', tip_racks=[tips_binding, tips_wash1, tips_wash2, tips_wash2_repeat, tips_elution])
	#P1000 = protocol.load_instrument('p1000_single_gen2', 'right', tip_racks=[tips_binding, tips_wash1, tips_wash2, tips_wash2rep])

	### Prerun setup ########################################
	MagModule.disengage()

	### MAG BINDING ######################################

	if AddBindingBuffer:
		protocol.comment('--------->Adding 600 ul binding buffer')
		multichannel.pick_up_tip(tips_binding['A1'])
		for i in cols_to_extract:
			multichannel.aspirate(200, BindingBuffer['A1'])
			multichannel.dispense(200, BindingPlate['A'+str(i)].top(4))
			#multichannel.blow_out()
			multichannel.aspirate(200, BindingBuffer['A1'])
			multichannel.dispense(200, BindingPlate['A'+str(i)].top(4))
			#multichannel.blow_out()
			multichannel.aspirate(200, BindingBuffer['A1'])
			multichannel.dispense(200, BindingPlate['A'+str(i)].top(4))
			#multichannel.blow_out()
		multichannel.return_tip()
		
	if AddBeads:
		protocol.comment('--------->Adding 25ul mag beads')
		multichannel.pick_up_tip(tips_binding['A2'])
		multichannel.mix(10, 100, BeadsAndWater['A1'].bottom(3)) # mix beads 20 x by pulling up 100ul
		for i in cols_to_extract:
			multichannel.aspirate(25, BeadsAndWater['A1'])
			multichannel.dispense(25, BindingPlate['A'+str(i)].top(4)
		multichannel.return_tip()
		for i in cols_to_extract:
			multichannel.pick_up_tip(tips_binding['A'+str(i)])
			multichannel.mix(10, 200, BeadsAndWater['A1'].bottom(3))
			multichannel.return_tip()
		
	if CaptureBinding:
		protocol.comment('--------->Removing Binding Buffer')
		MagModule.engage()
		protocol.delay(minutes=capture_min)
		for i in cols_to_extract:
			multichannel.pick_up_tip(tips_binding['A'+str(i)])
			multichannel.aspirate(200, BindingPlate['A'+str(i)])
			multichannel.dispense(200, fixed_trash, rate = trash_speed)
			#multichannel.blow_out()
			multichannel.touch_tip()
			multichannel.aspirate(200, BindingPlate['A'+str(i)])
			multichannel.dispense(200, fixed_trash, rate = trash_speed)
			#multichannel.blow_out()
			multichannel.touch_tip()
			multichannel.aspirate(200, BindingPlate['A'+str(i)])
			multichannel.dispense(200, fixed_trash, rate = trash_speed)
			#multichannel.blow_out()
			multichannel.aspirate(200, BindingPlate['A'+str(i)].bottom(capture_depth), rate=0.2)
			multichannel.dispense(200, fixed_trash, rate = trash_speed)
			#multichannel.blow_out()
			multichannel.return_tip()
		
	if Wash1:
		protocol.comment('--------->Doing Wash 1')
		MagModule.disengage()
		multichannel.pick_up_tip(tips_wash1['A1'])
		for i in cols_to_extract:
			multichannel.aspirate(200, MagWash1['A1'])
			multichannel.dispense(200, BindingPlate['A'+str(i)].top(4))
			#multichannel.blow_out()
			multichannel.aspirate(200, MagWash1['A1'])
			multichannel.dispense(200, BindingPlate['A'+str(i)].top(4))
			#multichannel.blow_out()
			multichannel.aspirate(200, MagWash1['A1'])
			multichannel.dispense(200, BindingPlate['A'+str(i)].top(4))
			#multichannel.blow_out()
			multichannel.aspirate(200, MagWash1['A1'])
			multichannel.dispense(200, BindingPlate['A'+str(i)].top(4))
			#multichannel.blow_out()
		multichannel.return_tip()	
		for i in cols_to_extract:
			multichannel.pick_up_tip(tips_wash1['A'+str(i)])
			multichannel.aspirate(100, MagWash1['A1'])
			multichannel.dispense(100, BindingPlate['A'+str(i)])
			multichannel.mix(nmix, 180, BindingPlate['A'+str(i)].bottom(2))
			multichannel.blow_out()
			multichannel.return_tip()
		MagModule.engage()
		protocol.delay(minutes=capture_min)
		for i in cols_to_extract:
			multichannel.pick_up_tip(tips_wash1['A'+str(i)])
			multichannel.aspirate(200, BindingPlate['A'+str(i)])
			multichannel.dispense(200, fixed_trash, rate = trash_speed)
			#multichannel.blow_out()
			multichannel.aspirate(200, BindingPlate['A'+str(i)])
			multichannel.dispense(200, fixed_trash, rate = trash_speed)
			#multichannel.blow_out()
			multichannel.aspirate(200, BindingPlate['A'+str(i)])
			multichannel.dispense(200, fixed_trash, rate = trash_speed)
			#multichannel.blow_out()
			multichannel.aspirate(200, BindingPlate['A'+str(i)])
			multichannel.dispense(200, fixed_trash, rate = trash_speed)
			#multichannel.blow_out()
			multichannel.aspirate(200, BindingPlate['A'+str(i)].bottom(capture_depth), rate=0.2)
			multichannel.dispense(200, fixed_trash, rate = trash_speed)
			multichannel.blow_out()
			multichannel.return_tip()
			
	if Wash2:
		protocol.comment('--------->Doing Wash 2')
		MagModule.disengage()
		multichannel.pick_up_tip(tips_wash2['A1'])
		for i in cols_to_extract:
			multichannel.aspirate(200, MagWash2['A1'])
			multichannel.dispense(200, BindingPlate['A'+str(i)].top(4))
			#multichannel.blow_out()
			multichannel.aspirate(200, MagWash2['A1'])
			multichannel.dispense(200, BindingPlate['A'+str(i)].top(4))
			#multichannel.blow_out()
			multichannel.aspirate(200, MagWash2['A1'])
			multichannel.dispense(200, BindingPlate['A'+str(i)].top(4))
			#multichannel.blow_out()
			multichannel.aspirate(200, MagWash2['A1'])
			multichannel.dispense(200, BindingPlate['A'+str(i)].top(4))
			#multichannel.blow_out()
		multichannel.return_tip()	
		for i in cols_to_extract:
			multichannel.pick_up_tip(tips_wash2['A'+str(i)])
			multichannel.aspirate(100, MagWash2['A1'])
			multichannel.dispense(100, BindingPlate['A'+str(i)])
			multichannel.mix(nmix, 180, BindingPlate['A'+str(i)].bottom(2))
			multichannel.blow_out()
			multichannel.return_tip()
		MagModule.engage()
		protocol.delay(minutes=capture_min)
		for i in cols_to_extract:
			multichannel.pick_up_tip(tips_wash2['A'+str(i)])
			multichannel.aspirate(200, BindingPlate['A'+str(i)])
			multichannel.dispense(200, fixed_trash, rate = trash_speed)
			#multichannel.blow_out()
			multichannel.aspirate(200, BindingPlate['A'+str(i)])
			multichannel.dispense(200, fixed_trash, rate = trash_speed)
			#multichannel.blow_out()
			multichannel.aspirate(200, BindingPlate['A'+str(i)])
			multichannel.dispense(200, fixed_trash, rate = trash_speed)
			#multichannel.blow_out()
			multichannel.aspirate(200, BindingPlate['A'+str(i)]) # is this a calibration issue?
			multichannel.dispense(200, fixed_trash, rate = trash_speed)
			#multichannel.blow_out()
			multichannel.aspirate(200, BindingPlate['A'+str(i)].bottom(capture_depth), rate=0.2)
			multichannel.dispense(200, fixed_trash, rate = trash_speed)
			#multichannel.blow_out()
			multichannel.return_tip()
			
	if Wash2repeat:
		protocol.comment('--------->Repeating Wash 2')
		MagModule.disengage()
		multichannel.pick_up_tip(tips_wash2_repeat['A1'])
		for i in cols_to_extract:
			multichannel.aspirate(200, MagWash2['A1'])
			multichannel.dispense(200, BindingPlate['A'+str(i)].top(4))
			#multichannel.blow_out()
			multichannel.aspirate(200, MagWash2['A1'])
			multichannel.dispense(200, BindingPlate['A'+str(i)].top(4))
			#multichannel.blow_out()
			multichannel.aspirate(200, MagWash2['A1'])
			multichannel.dispense(200, BindingPlate['A'+str(i)].top(4))
			#multichannel.blow_out()
			multichannel.aspirate(200, MagWash2['A1'])
			multichannel.dispense(200, BindingPlate['A'+str(i)].top(4))
			#multichannel.blow_out()
		multichannel.return_tip()	
		for i in cols_to_extract:
			multichannel.pick_up_tip(tips_wash2_repeat['A'+str(i)])
			multichannel.aspirate(100, MagWash2['A1'])
			multichannel.dispense(100, BindingPlate['A'+str(i)])
			multichannel.mix(nmix, 180, BindingPlate['A'+str(i)].bottom(5))
			multichannel.blow_out()
			multichannel.return_tip()
		MagModule.engage()
		protocol.delay(minutes=capture_min)
		for i in cols_to_extract:
			multichannel.pick_up_tip(tips_wash2_repeat['A'+str(i)])
			multichannel.aspirate(200, BindingPlate['A'+str(i)])
			multichannel.dispense(200, fixed_trash, rate = trash_speed)
			#multichannel.blow_out()
			multichannel.aspirate(200, BindingPlate['A'+str(i)])
			multichannel.dispense(200, fixed_trash, rate = trash_speed)
			#multichannel.blow_out()
			multichannel.aspirate(200, BindingPlate['A'+str(i)])
			multichannel.dispense(200, fixed_trash, rate = trash_speed)
			#multichannel.blow_out()
			multichannel.aspirate(200, BindingPlate['A'+str(i)]) # is this a calibration issue?
			multichannel.dispense(200, fixed_trash, rate = trash_speed)
			#multichannel.blow_out()
			multichannel.aspirate(200, BindingPlate['A'+str(i)].bottom(capture_depth), rate=0.2)
			multichannel.dispense(200, fixed_trash, rate = trash_speed)
			#multichannel.blow_out()
			multichannel.return_tip()
	
	if Dry:
		protocol.comment('--------->Drying DNA')
		protocol.delay(minutes=drying_min)

	if Elute:
		protocol.comment('--------->Eluting DNA')
		MagModule.disengage()
		for i in cols_to_extract:
			multichannel.pick_up_tip(tips_elution['A'+str(i)])
			multichannel.aspirate(elution_volume, BeadsAndWater['A2'])
			multichannel.dispense(elution_volume, BindingPlate['A'+str(i)])
			multichannel.mix(nmix, elution_to_plate, BindingPlate['A'+str(i)].bottom(capture_depth))
			#multichannel.blow_out()
			multichannel.return_tip()
		MagModule.engage()
		protocol.delay(minutes=capture_min)
		for i in cols_to_extract:
			multichannel.pick_up_tip(tips_elution['A'+str(i)])
			multichannel.aspirate(elution_to_plate, BindingPlate['A'+str(i)].bottom(capture_depth+1), rate=0.2)
			multichannel.dispense(elution_to_plate, ElutionPlate['A'+str(i)])
			#multichannel.blow_out()
			multichannel.return_tip()

			
	
			
def run(protocol: protocol_api.ProtocolContext):

    ################### SETTING UP ###################
    ##                                              ##
    ##     ヽ༼ຈل͜ຈ༽ノ LABWARE ヽ༼ຈل͜ຈ༽ノ               ##
    ##                                              ##
    ##################################################

    # Positions are:
    # 10    11      TRASH
    # 7     8       9
    # 4     5       6
    # 1     2       3

    #Modules, plate and MAGNET HEIGHT
    magneto = protocol.load_module("magneticModuleV2", 6)
    deepPlate = magneto.load_labware("eppendorf_96_deepwell_2ml",
                                     label="Deep well")
    magnetHeight = 6.7
    #########################################################################################################
    ##  We have tested appropriate height on GEN1 magdeck for different plates, these are the chosen ones  ##
    ##                                                                                                     ##
    ##  Zymoresearch - "zymoresearch_96_deepwell_2.4ml" - 12.5mm                                           ##
    ##  Eppendorf - "eppendorf_96_deepwell_2ml" - 11.8 mm                                                  ##
    ##  Starlab - "usascientific_96_wellplate_2.4ml_deep" - E2896-1810 11.4mm                              ##
    ##  Macherey-Nagel - - 10mm                                                                            ##
    #########################################################################################################

    #Plates
    reagents = protocol.load_labware("nest_12_reservoir_15ml",
                                     5,
                                     label="Reagents reservoir")
    waste = protocol.load_labware("nest_12_reservoir_15ml",
                                  9,
                                  label="Liquid waste reservoir")
    outplate = protocol.load_labware("eppendorf96_skirted_150ul",
                                     1,
                                     label="Output plate")
    #Tips - Ordered in the way they are used
    parkingRack = protocol.load_labware("opentrons_96_filtertiprack_200ul", 3)
    tiprack1 = protocol.load_labware("opentrons_96_filtertiprack_200ul", 2)
    tiprack4 = protocol.load_labware("opentrons_96_filtertiprack_200ul", 4)
    tiprack7 = protocol.load_labware("opentrons_96_filtertiprack_200ul", 7)
    tiprack8 = protocol.load_labware("opentrons_96_filtertiprack_200ul", 8)
    tiprack10 = protocol.load_labware("opentrons_96_filtertiprack_200ul", 10)

    tipracks = [tiprack10, tiprack8, tiprack7, tiprack4, tiprack1]
    availableTips = []
    for rack in tipracks:
        for i in range(1, 13):
            availableTips.append(rack["A" + str(i)])
    #To take a tip, just use availableTips.pop() and voila!
    #There are enough tips for 6 samples, and a tiprack will end up half-full
    #Tips are taken from right to left instead of the normal way
    #I am using this dictionary method because it makes it easier to modify later the script for 96 samples/

    #Pipettes
    p300 = protocol.load_instrument("p300_multi_gen2", "left")

    ################### SETTING UP ###################
    ##                                              ##
    ## ヽ༼ຈل͜ຈ༽ノ BASIC VARIABLES ヽ༼ຈل͜ຈ༽ノ             ##
    ##                                              ##
    ##################################################

    #RUN SETTINGS
    runColumns = 3  # Range 1-6. Samples should be a multiple of 8, or you will waste reagents.
    mixRepeats = 15  # Used everytime there is mixing, except when mixing beads.
    beadsMixRepeats = 10  # Used when mixing beads in reservoir. This happens when pipetting column 1, 3 and 6.
    waterMixRepeats = 20  # Used when mixing elute.

    #Mixing settings
    washMixing = 100  # volume (ul)
    waterMixing = 25  # volume (ul)
    bottomHeight = 0.5  # Distance relative to real labware's bottom. Used when removing supernatant and moving elution.
    bottomMixHeight = 0.8  # Distance relative to real labware's bottom. Used when mixing
    SamplePlusProteinaseHeight = 3  # For a volume of 260..
    SamplePlusProteinasePlusBeadsHeight = 5.75  # For a volume of 465...
    generalHeight = 4  # Used always except when mixing beads in reservoir - Units relative to well bottom (mm). For a vol of 280...
    beadsHeight = 10  # Used when mixing beads in reservoir - Units relative to well bottom (mm). When mixing beads in the reagent well - Maybe I should modify this and make it depend on runColumns

    #Incubation times - Minutes
    incubationProteinase = 10
    incubationBeadsNoMagnet = 5  # After adding the beads, we incubate them for 5 min without magnet.
    incubationBeadsMagnet = 5 * 2
    incubationWash = 3 * 2
    incubationDry = 10  # After removing final wash, the beads are left to dry for a while.
    incubationWater = 5  # After mixing. No magnet.
    incubationWaterMagnet = 1 * 2  # After incubationWater.

    #Transference volumes - ul
    originalVol = 140  #This is not used for transfers, it is here mostly to make volumes clearer to understand
    proteinaseVol = 112
    beadsVol = 143.5
    washVol = 280  #Used for WBE and Ethanol1 and Ethanol2
    dilutionVol = 50
    initialSupernatant = originalVol + proteinaseVol + beadsVol

    #Reagent position in reservoir - Positions go from A1 to A12 (Left to right)
    proteinase = reagents["A1"]
    beads = reagents["A2"]
    WBE = reagents["A3"]
    ethanol1 = reagents["A4"]
    ethanol2 = reagents["A5"]
    water = reagents["A12"]
    #########################################################################################################
    ##           Use these formulae to identify how much volume you need based on number of columns        ##
    ##           Each reservoir well has dimensions W=8.20, L=127.76, H=31.40. To make sure there is       ##
    ##           a pool of extra content with 0.5mm of height, add 292ul (300) extra (8.20*127.76*0.05)    ##
    ##                                                                                                     ##
    ##  Proteinase = (896 * runColumns) + 292 ul                                                           ##
    ##  Beads = (1152 * Columns) + 292 ul                                                                  ##
    ##  WBE = (2240 * Columns) + 292 ul                                                                    ##
    ##  Ethanol1 = (2240 * Columns) + 292 ul                                                               ##
    ##  Ethanol2 = (2240 * Columns) + 292 ul                                                               ##
    ##  Water = (640 * Columns) + 292 ul                                                                   ##
    #########################################################################################################

    ################### SETTING UP ###################
    ##                                              ##
    ## ヽ༼ຈل͜ຈ༽ノ ADVANCED VARIABLES ヽ༼ຈل͜ຈ༽ノ          ##
    ##                                              ##
    ##################################################

    #Column accesion list - As we wont work in all physically available columns, this list makes it easier to manage
    columnID = ["A1", "A3", "A5", "A7", "A9",
                "A11"]  # These are the columns that can be used
    columnID = columnID[:
                        runColumns]  # Here we trim the list, to get only the number of columns chosen in runColumns

    #Pipette settings
    tipVolume = 180  # max volume to be transported in a single trip. These tips are 200ul, but if we use the entire volumen, it might touch the filter
    topOffset = -5  # I use this to make sure the tip stays inside the well, to avoid it spilling out while dispensing
    p300.flow_rate.aspirate = 50  # Flow rate in ul / second
    p300.flow_rate.dispense = 150
    p300.flow_rate.blow_out = 200
    #Flows are reduced compared to default values to avoid the production of air or foam during handling.

    #Volume used when mixing beads (ul)
    if runColumns == 1:
        beadsMixing = 140
    else:
        beadsMixing = tipVolume

    ################### SETTING UP ###################
    ##                                              ##
    ##(づ。◕‿‿◕。)づ    FUNCTIONS    (づ。◕‿‿◕。)づ ##
    ##                                              ##
    ##################################################
    def clock(time, stop=False):
        """
        The uncertainty of not knowing how much time is left in an incubation is horrible. This makes it more bearable.
        This function takes the duration of the incubation and outputs a message every minute to keep track of the time more easily
        """
        while time > 0:
            time -= 1
            protocol.delay(minutes=1)
            protocol.comment("Only %s minutes more! Hold in there!" % time)
            if time == 1 and stop == True:
                protocol.pause()

    def meneillo(pipette, pos, reps=10, distance=0.25):
        pipette.move_to(pos)
        for _ in range(reps):
            p300.move_to(pos.move(types.Point(x=distance, y=0, z=0)))
            p300.move_to(pos.move(types.Point(x=-distance, y=0, z=0)))

    def remove_tip(pipette, tip):
        """
        Originally, I had a special behaviour to drop the tips, but I stopped using it.
        I keep this function because it makes it easy to change drop_tip() to return_tip() for test runs
        """
        pipette.drop_tip()

    def retrieve_tip(pipette, tip):
        """
        Originally, the robot took a tip, went to the top of the well it was going to work with, and aspired 20 ul there, but now we are making it aspire 20 ul after taking the tip
        """
        pipette.pick_up_tip(tip)

    def well_mix(vol,
                 loc,
                 reps,
                 height=generalHeight,
                 moveSide=0,
                 bottomHeight=bottomMixHeight):
        """
        Aspirates <vol> from bottom of well and dispenses it from <height> <reps> times
        loc1 is a position at 0.3mm over the bottom of the well
        loc2 is a position in the same x and y posiiton than loc1, but at <height>mm over the bottom of the well
        The idea here is to take liquid to the very bottom and pour it from a higher point, to mix things
        """
        p300.flow_rate.aspirate = 1000
        p300.flow_rate.dispense = 1000
        loc1 = loc.bottom().move(
            types.Point(x=0 + moveSide, y=0, z=bottomHeight))
        loc2 = loc.bottom().move(types.Point(x=0 + moveSide, y=0, z=height))
        for _ in range(reps):
            p300.aspirate(vol, loc1)
            p300.dispense(vol, loc2)
        p300.dispense(20, loc.top(topOffset))
        p300.flow_rate.aspirate = 50
        p300.flow_rate.dispense = 150

    def remove_supernatant(vol,
                           columnID,
                           wasteID,
                           reagentName="Something",
                           pipette=p300):
        """
        While <vol> is bigger than <tipVolume>, it divides it in ceilling(<vol>/<tipVolume>) trips. (So, if it is 396ul, we have 2 180ul trips and a 36ul trip)
        Flow rate is in ul/second
        In the move() function, positive X means 'move to the right'. With the wells we use (Column 1,3,5,7,9 and 11) pellet is placed to the right, so we use a small offset to the left
        """
        p300.flow_rate.aspirate = 20  # In this case we reduce the flow even more to make sure the precipitate is okay. We don't wanna bother the lad
        protocol.comment(
            "\n\nREMOVING STEP: Removing %s ul of supernatant (%s) while magnet is still engaged"
            % (vol, reagentName))
        dump = waste[wasteID]
        for index, ID in enumerate(columnID):
            currentip = parkingRack[ID]
            dump = waste[ID]
            src = deepPlate[ID]
            retrieve_tip(pipette, currentip)
            tvol = vol
            while tvol > tipVolume:
                p300.dispense(20, src.top(topOffset))
                p300.transfer(tipVolume,
                              src.bottom().move(
                                  types.Point(x=-1, y=0, z=bottomHeight)),
                              dump.top(topOffset),
                              new_tip="never")  #Slightly to the left
                meneillo(
                    p300, dump.top(topOffset)
                )  #In case something is TheOppositeOfDense and just drips down
                p300.dispense(
                    20
                )  #Make sure we expel everything that must be expelled. We dont want to move droplets around.
                tvol -= tipVolume
            p300.dispense(20, src.top(topOffset))
            p300.transfer(tvol,
                          src.bottom().move(
                              types.Point(x=-1, y=0, z=bottomHeight)),
                          dump.top(topOffset),
                          new_tip="never")
            meneillo(p300, dump.top(topOffset))
            remove_tip(pipette, currentip)
        p300.flow_rate.aspirate = 50

    def slow_transfer(vol,
                      reagent,
                      columnID,
                      reagentName,
                      mixVol=washMixing,
                      repeats=mixRepeats,
                      mixReagent=False,
                      altura=generalHeight,
                      magnetTime=True,
                      incubationTime=incubationWash,
                      moveSide=0,
                      extraVol=0,
                      pipette=p300,
                      removalStepAfter=True):
        """
        Similar to remove_supernatant, but the other way around. It transfers from point A to point B in <tipVol> ul trips and pours liquid
        from the top, to avoid contaminating the tip while transfering all the necessary volume.
        It also includes incubation and magnet
        """
        protocol.comment(
            "\n\nADDING STEP: Transfering %s ul of %s to samples" %
            (vol, reagentName))
        for index, ID in enumerate(columnID):
            src = reagent
            to = deepPlate[ID]
            currentip = availableTips.pop()
            retrieve_tip(p300, currentip)
            if (mixReagent == True) and (
                    index == 0 or index == 2 or index == 5
            ):  #If the reagent is to be mixed, and we are in column 1, 3 or 6, mix it. We mix three times to make sure we dont have differences
                protocol.comment("Mixing %s" % reagentName)
                well_mix(
                    vol=beadsMixing,
                    loc=beads,
                    reps=beadsMixRepeats,
                    height=beadsHeight,
                    moveSide=0
                )  #We only do this with magnetic beads, that's why we use those variable names
                p300.blow_out(beads.top())
            tvol = vol
            while tvol > tipVolume:
                p300.dispense(20, src.top())
                p300.transfer(tipVolume,
                              src.bottom().move(
                                  types.Point(x=0, y=0, z=bottomHeight)),
                              to.top(topOffset),
                              new_tip="never",
                              air_gap=extraVol)
                protocol.delay(seconds=2)
                p300.blow_out()
                tvol -= tipVolume
            p300.dispense(20, src.top())
            p300.transfer(tvol,
                          src.bottom().move(
                              types.Point(x=0, y=0, z=bottomHeight)),
                          to.center(),
                          new_tip="never",
                          air_gap=extraVol)
            protocol.delay(seconds=2)
            well_mix(vol=mixVol,
                     loc=to,
                     reps=repeats,
                     moveSide=moveSide,
                     height=altura)
            if removalStepAfter == True:
                pipette.drop_tip(parkingRack[ID])
            else:
                remove_tip(pipette, currentip)

        #Incubation
        if magnetTime == True:
            protocol.comment("Engaging magnet")
            magneto.engage(height=magnetHeight)
        protocol.comment("Incubating for %s minutes" % incubationTime)
        clock(time=incubationTime)

    ################# GO, VASILY, GO #################
    ##                                              ##
    ##      ୧༼ಠ益ಠ༽୨    PROTOCOL    ୧༼ಠ益ಠ༽୨        ##
    ##                                              ##
    ##################################################

    magneto.disengage()  #In case it is engaged from previous protocols.
    protocol.comment("We are working with column IDs: %s" % columnID)
    protocol.comment("\n\nSamples should have an initial volume of %s ul" %
                     originalVol)

    #STEP 1: Add Proteinase K/LBF.
    slow_transfer(vol=proteinaseVol,
                  reagent=proteinase,
                  reagentName="Proteinase K/LBF",
                  incubationTime=incubationProteinase,
                  columnID=columnID,
                  magnetTime=False,
                  altura=SamplePlusProteinaseHeight,
                  removalStepAfter=False)
    #INCUBATION 1: 10 min [Total: 10 min]

    #STEP 2: mix magnetic beads, add them to samples and mix sample well. No slow_transfer function for the same reasons as before.
    protocol.comment("\n\nEnough incubation, time to do s t u f f")
    slow_transfer(vol=beadsVol,
                  reagent=beads,
                  reagentName="Magnetic beads",
                  incubationTime=incubationBeadsNoMagnet,
                  columnID=columnID,
                  mixReagent=True,
                  magnetTime=False,
                  extraVol=10,
                  altura=SamplePlusProteinasePlusBeadsHeight)
    #INCUBATION 2: 5 min without magnet [Total: 15 min]
    protocol.comment(
        "Engaging magnet and keeping this incubation going for other %s minutes"
        % incubationBeadsMagnet)
    magneto.engage(height=magnetHeight)
    clock(time=incubationBeadsMagnet, stop=True)
    #INCUBATION 3: 5 min incubation with magnet [Total: 20 min]

    #STEP 3: Remove magnetic beads supernatant
    remove_supernatant(vol=initialSupernatant,
                       wasteID="A1",
                       reagentName="beads and proteinase",
                       columnID=columnID)
    protocol.comment("Disengaging magnet")
    magneto.disengage()

    #STEP 4: Add 280 ul of Wash WBE
    slow_transfer(vol=washVol,
                  reagent=WBE,
                  reagentName="WBE",
                  incubationTime=incubationWash,
                  columnID=columnID)
    #INCUBATION 4: 3 min incubaton with magnet [Total: 23 min]

    #STEP 5: Removing WBE Supernatant
    remove_supernatant(vol=washVol,
                       wasteID="A2",
                       reagentName="WBE",
                       columnID=columnID)
    protocol.comment("Disengaging magnet")
    magneto.disengage()

    #STEP 6: First wash with Eth, tips_transfer)anol
    slow_transfer(vol=washVol,
                  reagent=ethanol1,
                  reagentName="Ethanol 70% (First time)",
                  incubationTime=incubationWash,
                  columnID=columnID)
    #INCUBATION 5: 3 min incubaton with magnet [Total: 26 min]

    #STEP 7: Removing the supernatant of first wash with Ethanol
    remove_supernatant(vol=washVol,
                       wasteID="A3",
                       reagentName="Ethanol 70% (First time)",
                       columnID=columnID)
    protocol.comment("Disengaging magnet")
    magneto.disengage()

    #STEP 8: Second wash with Ethanol
    slow_transfer(vol=washVol,
                  reagent=ethanol2,
                  reagentName="Ethanol 70% (Second time)",
                  incubationTime=incubationWash,
                  columnID=columnID)
    #INCUBATION 6: 3 min incubaton with magnet [Total: 26 min]

    #STEP 9: Removing the supernatant of second wash with Ethanol
    remove_supernatant(vol=washVol,
                       wasteID="A4",
                       reagentName="Ethanol 70% (Second time)",
                       columnID=columnID)
    #INCUBATION 7: 5 min incubaton with magnet [Total: 31 min]
    protocol.comment(
        "This time, I do not disengage the magnet and let the beads dry for %s min"
        % incubationDry)
    clock(time=incubationDry)

    #STEP 10: Diluting samples in 80 ul of RNAse free water
    protocol.comment("Disengaging magnet")
    magneto.disengage()
    protocol.comment("Diluting samples in %s ul of RNAse free water" %
                     dilutionVol)
    slow_transfer(vol=dilutionVol,
                  reagent=water,
                  reagentName="RNAse-free water",
                  incubationTime=incubationWater,
                  columnID=columnID,
                  mixVol=waterMixing,
                  magnetTime=False,
                  repeats=waterMixRepeats)  #Moving tip on top of pellet
    #INCUBATION 8: 5 min incubaton WITHOUT magnet [Total: 36 min]
    protocol.comment("Engaging magnet now!")
    magneto.engage(height=magnetHeight)
    clock(time=incubationWaterMagnet)
    #INCUBATION 9: 3 min incubaton WITH magnet [Total: 39 min]

    #STEP 11: Transfering samples to output plate
    protocol.comment(
        "Transfering DNA to output plate while magnet is still engaged")
    p300.flow_rate.aspirate = 20
    for index, ID in enumerate(columnID):
        currentip = availableTips.pop()
        retrieve_tip(p300, currentip)
        src = deepPlate[ID]
        to = outplate[ID]

        p300.dispense(20, src.top())
        p300.transfer(dilutionVol,
                      src.bottom().move(types.Point(x=-1, y=0,
                                                    z=bottomHeight)),
                      to.bottom(5),
                      new_tip="never")
        protocol.delay(seconds=2)
        p300.dispense(20)
        remove_tip(p300, currentip)

    magneto.disengage()
    protocol.comment("\n\nFecho!")
Example #29
0
def run(protocol: protocol_api.ProtocolContext):

    # LABWARE
    fuge_rack = protocol.load_labware('opentrons_24_tuberack_eppendorf_2ml_safelock_snapcap', '11')
    tiprack20 = protocol.load_labware('opentrons_96_filtertiprack_20ul', '9')
    tempdeck = protocol.load_module('tempdeck', '10')
    # sectempdeck = protocol.load_module('tempdeck', '4')
    pcr_plate = tempdeck.load_labware('abi_96_wellplate_250ul')
    # stds_rack = sectempdeck.load_labware('opentrons_24_aluminumblock_generic_2ml_screwcap')
    ww_plate1 = protocol.load_labware('bioer_96_wellplate_2200ul', '1')
    

    # PIPETTES
    p20 = protocol.load_instrument(
        'p20_single_gen2', 'right', tip_racks=[tiprack20]
    )
    
    # REAGENTS   
    N2 = fuge_rack['A1'] # LU MasterMix
    N1 = fuge_rack['B1'] # water
    LUPositive = fuge_rack['D6'] # LU Positive Control plasmid
    mixes = [N2, N1]
     # LISTS
    rows = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H']
    N2_cols = [1, 2, 3, 4, 5, 6]
    N1_cols = [7, 8, 9, 10, 11, 12]

    # #### COMMANDS ######    
    # aspirate mmix to all wells in 96w plate; 15*48 = 720ul*1.1=792
    h_list = tip_heightsEpp(792, 48, 15)
    for y, pcrmix in enumerate(mixes): #12 cols
        p20.pick_up_tip()
        well_num = 1
        for z in range(1,7):
            for row in rows: #8 rows
                # print (y)
                col = 6*y+z
                dest = row+str(col)
                # print ("height is: ", h_list[well_num-1])
                p20.aspirate(15, pcrmix.bottom(h_list[well_num-1]), rate=0.75) #head vol for more accurate pipetting
                protocol.delay(seconds=1) #equilibrate
                p20.move_to(pcrmix.bottom(38))
                protocol.delay(seconds=1) #equilibrate
                p20.touch_tip(v_offset=-4)
                p20.dispense(15, pcr_plate[dest].bottom(1))
                p20.blow_out(pcr_plate[dest].bottom(8))
                p20.touch_tip()
                well_num += 1
        p20.drop_tip()

    tot_ww_plates = [ww_plate1]
    for x, ww_plate in enumerate(tot_ww_plates):
        for col in range(0,1): #samples in col 5, 11
            for row in rows:
                p20.pick_up_tip()
                source = row + str(6*col+5) #A5, B5, C5
                dest1 = row + str(6*x+6*col+1) #A1, #A2, #A3
                dest2 = row + str(6*x+6*col+2)
                dest3 = row + str(6*x+6*col+3)
                dest4 = row + str(6*x+6*col+4)
                dest5 = row + str(6*x+6*col+5)
                dest6 = row + str(6*x+6*col+6)
                dest7 = row + str(6*x+6*col+7)
                dest8 = row + str(6*x+6*col+8)
                dest9 = row + str(6*x+6*col+9)
                dest10 = row + str(6*x+6*col+10)
                dest11 = row + str(6*x+6*col+11)
                dest12 = row + str(6*x+6*col+12)
                p20.aspirate(18, ww_plate[source].bottom(1))
                protocol.delay(seconds=2) #equilibrate
                p20.dispense(5, pcr_plate[dest1].bottom(1))
                p20.touch_tip()    
                p20.dispense(5, pcr_plate[dest2].bottom(1))    
                p20.touch_tip()    
                p20.dispense(5, pcr_plate[dest3].bottom(1))    
                p20.touch_tip()    
                p20.drop_tip()
                p20.pick_up_tip()
                p20.aspirate(18, ww_plate[source].bottom(1))
                protocol.delay(seconds=2) #equilibrate
                p20.dispense(5, pcr_plate[dest4].bottom(1))
                p20.touch_tip()    
                p20.dispense(5, pcr_plate[dest5].bottom(1))
                p20.touch_tip()    
                p20.dispense(5, pcr_plate[dest6].bottom(1))
                p20.touch_tip()    
                p20.drop_tip()

                p20.pick_up_tip()                
                p20.aspirate(18, ww_plate[source].bottom(1))
                protocol.delay(seconds=2) #equilibrate
                p20.dispense(5, pcr_plate[dest7].bottom(1))
                p20.touch_tip()    
                p20.dispense(5, pcr_plate[dest8].bottom(1))    
                p20.touch_tip()    
                p20.dispense(5, pcr_plate[dest9].bottom(1))    
                p20.touch_tip()    
                p20.drop_tip()
                
                p20.pick_up_tip()
                p20.aspirate(18, ww_plate[source].bottom(1))
                protocol.delay(seconds=2) #equilibrate
                p20.dispense(5, pcr_plate[dest10].bottom(1))
                p20.touch_tip()    
                p20.dispense(5, pcr_plate[dest11].bottom(1))    
                p20.touch_tip()    
                p20.dispense(5, pcr_plate[dest12].bottom(1))    
                p20.touch_tip()    
                p20.drop_tip()
Example #30
0
def run(protocol: protocol_api.ProtocolContext):
    if debug: print(protocol)

    tiprack_300 = protocol.load_labware('opentrons_96_tiprack_300ul',
                                        labwarePositions.tiprack_300,
                                        "tiprack 300ul")

    if debug: print(tiprack_300)

    pipette_300 = protocol.load_instrument('p300_single',
                                           'right',
                                           tip_racks=[tiprack_300])
    pipette_300.flow_rate.dispense = default_flow_rate
    pipette_300.flow_rate.aspirate = default_flow_rate
    pipette_300.starting_tip = tiprack_300.well(
        tiprack_starting_pos['tiprack_300'])

    if debug: print(pipette_300)

    black_96 = protocol.load_labware(type_of_96well_plate,
                                     labwarePositions.antibodies_plate,
                                     type_of_96well_plate)

    trough12 = protocol.load_labware('parhelia_12trough',
                                     labwarePositions.buffers_reservoir,
                                     '12-trough buffers reservoir')
    if (not retreaval):
        par2 = protocol.load_labware('par2s_9slides_blue_v2',
                                     labwarePositions.par2,
                                     'par2s_9slides_blue_v2')
    if retreaval:
        temp_mod = protocol.load_module('temperature module',
                                        labwarePositions.heatmodule)

        par2 = temp_mod.load_labware('par2s_9slides_blue_v2')

    if debug: print(par2)

    buffer_wells = trough12.wells_by_name()

    buffers = Object()
    buffers.retreaval = buffer_wells['A1']
    buffers.TBS_wash = buffer_wells['A2']
    buffers.water = buffer_wells['A3']
    buffers.storage = buffer_wells['A4']
    buffers.eth_70perc_ = buffer_wells['A5']
    buffers.eth_80perc = buffer_wells['A6']
    buffers.eth_95perc = buffer_wells['A7']
    buffers.eth_100perc = buffer_wells['A8']
    buffers.hematoxylin = buffer_wells['A12']

    preblock_wells = black_96.rows()[0]
    antibody_wells = black_96.rows()[1]
    enzymeblock_wells = black_96.rows()[2]
    hrpsecondaryab_wells = black_96.rows()[3]
    substrate_wells = black_96.rows()[4]
    DAB_wells = black_96.rows()[5]

    sample_chambers = []

    for well in wellslist:
        sample_chambers.append(par2.wells_by_name()[well])

    if debug: print(sample_chambers)

    #################PROTOCOL####################
    protocol.home()
    if retreaval:
        washSamples(pipette_300, buffers.retreaval, buffers.retreaval, 0, 1,
                    extra_bottom_gap)
        washSamples(pipette_300, buffers.retreaval, sample_chambers,
                    wash_volume, 2, extra_bottom_gap)
        temp_mod.set_temperature(95)
        print("retreaval")
        protocol.delay(minutes=15)
        washSamples(pipette_300, buffers.retreaval, sample_chambers,
                    wash_volume, 1, extra_bottom_gap)
        protocol.delay(minutes=15)
        washSamples(pipette_300, buffers.retreaval, sample_chambers,
                    wash_volume, 1, extra_bottom_gap)
        protocol.delay(minutes=15)
        print("cooling down to RT")
        temp_mod.set_temperature(25)
        protocol.delay(minutes=20)

    # WASHING SAMPLES WITH TBS
    print("washing in TBS")
    washSamples(pipette_300, buffers.TBS_wash, buffers.TBS_wash, 0, 1,
                extra_bottom_gap)
    washSamples(pipette_300, buffers.TBS_wash, sample_chambers, wash_volume, 2,
                extra_bottom_gap)

    # Preblocking
    print("preblocking")
    print(len(wellslist))
    for i in range(len(wellslist)):
        print(i)
        washSamples(pipette_300, preblock_wells[i], sample_chambers[i],
                    wash_volume, 1, extra_bottom_gap)
    print("preblocking incubation: 15 min")
    protocol.delay(minutes=15)

    # APPLYING ANTIBODY COCKTAILS TO SAMPLES
    print("applying antibodies")
    for i in range(len(wellslist)):
        print(i)
        washSamples(pipette_300, antibody_wells[i], sample_chambers[i],
                    wash_volume, 1, extra_bottom_gap)

    # INCUBATE FOR DESIRED TIME
    print("staining incubation: " + str(primary_ab_incubation_time_minutes) +
          "min")
    protocol.delay(minutes=primary_ab_incubation_time_minutes)

    # WASHING SAMPLES WITH TBS
    # three individual repeats below is because they need particular incubation time between them
    print("washing with TBS")
    for i in range(5):
        washSamples(pipette_300, buffers.TBS_wash, sample_chambers,
                    wash_volume, 1, extra_bottom_gap)
        protocol.delay(minutes=3)

    # APPLYING enzyme blocking
    print("applying enzyme blocking")
    for i in range(len(wellslist)):
        washSamples(pipette_300, enzymeblock_wells[i], sample_chambers[i],
                    wash_volume, 1, extra_bottom_gap)
    # INCUBATE 10 MIN
    print("hrp blocking incubation: 10min")
    protocol.delay(minutes=10)
    washSamples(pipette_300, buffers.TBS_wash, sample_chambers, wash_volume, 3,
                extra_bottom_gap)

    # APPLYING HRP SECONDARY ANTIBODY COCKTAILS TO SAMPLES
    print("applying hrpsecondaryab")
    for i in range(len(wellslist)):
        washSamples(pipette_300, hrpsecondaryab_wells[i], sample_chambers[i],
                    wash_volume, 1, extra_bottom_gap)

    # INCUBATE FOR DESIRED TIME
    print("staining incubation: " + str(secondary_ab_incubation_time_minutes) +
          "min")
    protocol.delay(minutes=secondary_ab_incubation_time_minutes)

    # three individual repeats below is because they need particular incubation time between them
    print("washing with TBS")
    for i in range(3):
        washSamples(pipette_300, buffers.TBS_wash, sample_chambers,
                    wash_volume, 1, extra_bottom_gap)
        protocol.delay(minutes=3)

    # DILUTING AND APPLYING THE DAB
    for i in range(len(wellslist)):
        dilute_and_apply_fixative(pipette_300, DAB_wells[i],
                                  substrate_wells[i], sample_chambers[i], 200)

    print("developing substrate")

    protocol.delay(minutes=10)

    washSamples(pipette_300, buffers.water, buffers.water, 0, 1,
                extra_bottom_gap)
    washSamples(pipette_300, buffers.water, sample_chambers, wash_volume, 5,
                extra_bottom_gap)

    # STORAGE, washing samples every hour
    washSamples(pipette_300, buffers.storage, buffers.storage, 0, 1,
                extra_bottom_gap)
    for i in range(48):
        washSamples(pipette_300,
                    buffers.storage,
                    sample_chambers,
                    wash_volume / 2,
                    1,
                    extra_bottom_gap,
                    keep_tip=True)
        protocol.delay(minutes=60)
        print("total dispensed volume: ", str(stats.volume))