diff --git a/abr-testing/abr_testing/data_collection/abr_google_drive.py b/abr-testing/abr_testing/data_collection/abr_google_drive.py index 8f82567a7d1..4757dd217aa 100644 --- a/abr-testing/abr_testing/data_collection/abr_google_drive.py +++ b/abr-testing/abr_testing/data_collection/abr_google_drive.py @@ -34,16 +34,13 @@ def create_data_dictionary( runs_to_save: Union[Set[str], str], storage_directory: str, issue_url: str, - plate: str, - accuracy: Any, hellma_plate_standards: List[Dict[str, Any]], -) -> Tuple[List[List[Any]], List[str], List[List[Any]], List[str], List[List[Any]]]: +) -> Tuple[List[List[Any]], List[str], List[List[Any]], List[str]]: """Pull data from run files and format into a dictionary.""" runs_and_robots: List[Any] = [] runs_and_lpc: List[Dict[str, Any]] = [] headers: List[str] = [] headers_lpc: List[str] = [] - list_of_heights: List[List[Any]] = [[], [], [], [], [], [], [], []] hellma_plate_orientation = False # default hellma plate is not rotated. for filename in os.listdir(storage_directory): file_path = os.path.join(storage_directory, filename) @@ -130,13 +127,10 @@ def create_data_dictionary( plate_reader_dict = read_robot_logs.plate_reader_commands( file_results, hellma_plate_standards, hellma_plate_orientation ) - list_of_heights = read_robot_logs.liquid_height_commands( - file_results, list_of_heights - ) notes = {"Note1": "", "Jira Link": issue_url} + liquid_height = read_robot_logs.get_liquid_waste_height(file_results) plate_measure = { - "Plate Measured": plate, - "End Volume Accuracy (%)": accuracy, + "Liquid Waste Height (mm)": liquid_height, "Average Temp (oC)": "", "Average RH(%)": "", } @@ -173,7 +167,6 @@ def create_data_dictionary( headers, transposed_runs_and_lpc, headers_lpc, - list_of_heights, ) @@ -211,26 +204,15 @@ def run( headers, transposed_runs_and_lpc, headers_lpc, - list_of_heights, ) = create_data_dictionary( missing_runs_from_gs, storage_directory, "", - "", - "", - hellma_plate_standards=file_values, + file_values, ) start_row = google_sheet.get_index_row() + 1 google_sheet.batch_update_cells(transposed_runs_and_robots, "A", start_row, "0") - # Record Liquid Heights Found - google_sheet_ldf = google_sheets_tool.google_sheet( - credentials_path, google_sheet_name, 2 - ) - google_sheet_ldf.get_row(1) - start_row_lhd = google_sheet_ldf.get_index_row() + 1 - google_sheet_ldf.batch_update_cells( - list_of_heights, "A", start_row_lhd, "2075262446" - ) + # Add LPC to google sheet google_sheet_lpc = google_sheets_tool.google_sheet(credentials_path, "ABR-LPC", 0) start_row_lpc = google_sheet_lpc.get_index_row() + 1 diff --git a/abr-testing/abr_testing/data_collection/abr_robot_error.py b/abr-testing/abr_testing/data_collection/abr_robot_error.py index 73cf12c6253..6e457ce855f 100644 --- a/abr-testing/abr_testing/data_collection/abr_robot_error.py +++ b/abr-testing/abr_testing/data_collection/abr_robot_error.py @@ -614,28 +614,16 @@ def get_run_error_info_from_robot( headers, runs_and_lpc, headers_lpc, - list_of_heights, ) = abr_google_drive.create_data_dictionary( run_id, error_folder_path, issue_url, - "", - "", - hellma_plate_standards=file_values, + file_values, ) start_row = google_sheet.get_index_row() + 1 google_sheet.batch_update_cells(runs_and_robots, "A", start_row, "0") print("Wrote run to ABR-run-data") - # Record Liquid Heights Found - google_sheet_ldf = google_sheets_tool.google_sheet( - credentials_path, google_sheet_name, 4 - ) - start_row_lhd = google_sheet_ldf.get_index_row() + 1 - google_sheet_ldf.batch_update_cells( - list_of_heights, "A", start_row_lhd, "1795535088" - ) - print("wrote liquid heights found.") # Add LPC to google sheet google_sheet_lpc = google_sheets_tool.google_sheet( credentials_path, "ABR-LPC", 0 diff --git a/abr-testing/abr_testing/data_collection/read_robot_logs.py b/abr-testing/abr_testing/data_collection/read_robot_logs.py index 7bc83e0a54b..d420fe57627 100644 --- a/abr-testing/abr_testing/data_collection/read_robot_logs.py +++ b/abr-testing/abr_testing/data_collection/read_robot_logs.py @@ -134,7 +134,8 @@ def match_pipette_to_action( left_pipette_add = 0 for command in commandTypes: command_type = command_dict["commandType"] - command_pipette = command_dict.get("pipetteId", "") + command_params = command_dict.get("params", "") + command_pipette = command_params.get("pipetteId", "") if command_type == command and command_pipette == right_pipette: right_pipette_add = 1 elif command_type == command and command_pipette == left_pipette: @@ -213,6 +214,22 @@ def instrument_commands( return pipette_dict +def get_liquid_waste_height(file_results: Dict[str, Any]) -> float: + """Find liquid waste height.""" + commandData = file_results.get("commands", "") + height_float = 0.0 + for command in commandData: + commandType = command["commandType"] + if commandType == "comment": + result = command["params"].get("message", "") + try: + height = result.split("Liquid Waste Total Height: ")[1] + height_float = float(height) + except IndexError: + continue + return height_float + + def liquid_height_commands( file_results: Dict[str, Any], all_heights_list: List[List[Any]] ) -> List[List[Any]]: @@ -220,6 +237,9 @@ def liquid_height_commands( commandData = file_results.get("commands", "") robot = file_results.get("robot_name", "") run_id = file_results.get("run_id", "") + list_of_heights = [] + print(robot) + liquid_waste_height = 0.0 for command in commandData: commandType = command["commandType"] if commandType == "comment": @@ -236,16 +256,24 @@ def liquid_height_commands( well_location = str(entry.split(", ")[1].split(" ")[0]) slot_location = str(entry.split("slot ")[1].split(")")[0]) labware_name = str(entry.split("of ")[1].split(" on")[0]) - all_heights_list[0].append(robot) - all_heights_list[1].append(run_id) - all_heights_list[2].append(comment_time) - all_heights_list[3].append(labware_type) - all_heights_list[4].append(labware_name) - all_heights_list[5].append(slot_location) - all_heights_list[6].append(well_location) - all_heights_list[7].append(height) + if labware_name == "Liquid Waste": + liquid_waste_height += height + one_entry = { + "Timestamp": comment_time, + "Labware Name": labware_name, + "Labware Type": labware_type, + "Slot Location": slot_location, + "Well Location": well_location, + "All Heights (mm)": height, + } + list_of_heights.append(one_entry) except (IndexError, ValueError): continue + if len(list_of_heights) > 0: + all_heights_list[0].append(robot) + all_heights_list[1].append(run_id) + all_heights_list[2].append(list_of_heights) + all_heights_list[3].append(liquid_waste_height) return all_heights_list @@ -281,10 +309,13 @@ def plate_reader_commands( read = "yes" elif read == "yes" and commandType == "comment": result = command["params"].get("message", "") - if "result:" in result: - plate_name = result.split("result:")[0] - formatted_result = result.split("result: ")[1] - print(formatted_result) + if "result:" in result or "Result:" in result: + try: + plate_name = result.split("result:")[0] + formatted_result = result.split("result: ")[1] + except IndexError: + plate_name = result.split("Result:")[0] + formatted_result = result.split("Result: ")[1] result_dict = eval(formatted_result) result_dict_keys = list(result_dict.keys()) if len(result_dict_keys) > 1: diff --git a/abr-testing/abr_testing/data_collection/single_run_log_reader.py b/abr-testing/abr_testing/data_collection/single_run_log_reader.py index a61670e6d12..bf10347faff 100644 --- a/abr-testing/abr_testing/data_collection/single_run_log_reader.py +++ b/abr-testing/abr_testing/data_collection/single_run_log_reader.py @@ -34,14 +34,11 @@ header, runs_and_lpc, lpc_headers, - list_of_heights, ) = abr_google_drive.create_data_dictionary( run_ids_in_storage, run_log_file_path, "", - "", - "", - hellma_plate_standards=file_values, + file_values, ) print("list_of_heights not recorded.") transposed_list = list(zip(*runs_and_robots)) diff --git a/abr-testing/abr_testing/protocols/active_protocols/10_ZymoBIOMICS_Magbead_DNA_Cells_Flex.py b/abr-testing/abr_testing/protocols/active_protocols/10_ZymoBIOMICS_Magbead_DNA_Cells_Flex.py index 9631b442694..4e5c2903834 100644 --- a/abr-testing/abr_testing/protocols/active_protocols/10_ZymoBIOMICS_Magbead_DNA_Cells_Flex.py +++ b/abr-testing/abr_testing/protocols/active_protocols/10_ZymoBIOMICS_Magbead_DNA_Cells_Flex.py @@ -41,11 +41,12 @@ Wells 1-12 - 9,000 ul """ -whichwash = 1 +whichwash = 0 +wash_volume_tracker = 0.0 sample_max = 48 tip1k = 0 -tip200 = 0 drop_count = 0 +m1000_tips = 0 def add_parameters(parameters: protocol_api.ParameterContext) -> None: @@ -65,16 +66,25 @@ def run(ctx: protocol_api.ProtocolContext) -> None: False # True = Used tips go in Trash, False = Used tips go back into rack ) res_type = "nest_12_reservoir_15ml" - - num_samples = 8 + global m1000_tips + num_samples = 96 wash1_vol = 500.0 - wash2_vol = wash3_vol = 900.0 - lysis_vol = 200.0 + wash2_vol = wash3_vol = 600.0 + lysis_vol = 90.0 sample_vol = 10.0 # Sample should be pelleted tissue/bacteria/cells bind_vol = 600.0 bind2_vol = 500.0 elution_vol = 75.0 + def tipcheck(m1000: InstrumentContext) -> None: + """Tip tracking function.""" + global m1000_tips + if m1000_tips >= 3 * 96: + m1000.reset_tipracks() + m1000_tips == 0 + m1000.pick_up_tip() + m1000_tips += 8 + # Protocol Parameters deepwell_type = "nest_96_wellplate_2ml_deep" @@ -114,17 +124,17 @@ def run(ctx: protocol_api.ProtocolContext) -> None: magblock: MagneticBlockContext = ctx.load_module( helpers.mag_str, "C1" ) # type: ignore[assignment] - waste_reservoir = ctx.load_labware("nest_1_reservoir_195ml", "B3", "Liquid Waste") + waste_reservoir = ctx.load_labware("nest_1_reservoir_290ml", "B3", "Liquid Waste") waste = waste_reservoir.wells()[0].top() res1 = ctx.load_labware(res_type, "D2", "reagent reservoir 1") res2 = ctx.load_labware(res_type, "C2", "reagent reservoir 2") + res3 = ctx.load_labware(res_type, "B2", "reagent reservoir 3") num_cols = math.ceil(num_samples / 8) # Load tips and combine all similar boxes tips1000 = ctx.load_labware("opentrons_flex_96_tiprack_1000ul", "A1", "Tips 1") tips1001 = ctx.load_labware("opentrons_flex_96_tiprack_1000ul", "A2", "Tips 2") tips1002 = ctx.load_labware("opentrons_flex_96_tiprack_1000ul", "B1", "Tips 3") - tips = [*tips1000.wells()[num_samples:96], *tips1001.wells(), *tips1002.wells()] tips_sn = tips1000.wells()[:num_samples] # load instruments m1000 = ctx.load_instrument( @@ -135,47 +145,29 @@ def run(ctx: protocol_api.ProtocolContext) -> None: Here is where you can define the locations of your reagents. """ lysis_ = res1.wells()[0] - binding_buffer = res1.wells()[1:4] - bind2_res = res1.wells()[4:8] - wash1 = res1.wells()[6:8] - elution_solution = res1.wells()[-1] - wash2 = res2.wells()[:6] - wash3 = res2.wells()[6:] - + binding_buffer = res1.wells()[1:8] + bind2_res = res1.wells()[8:12] + all_washes = res2.wells()[1:] + elution_solution = res2.wells()[0] + all_washes.extend(res3.wells()[:2]) samples_m = sample_plate.rows()[0][:num_cols] elution_samples_m = elutionplate.rows()[0][:num_cols] # Redefine per well for liquid definitions samps = sample_plate.wells()[: (8 * num_cols)] - liquid_vols_and_wells: Dict[str, List[Dict[str, Well | List[Well] | float]]] = { "Lysis and PK": [{"well": lysis_, "volume": 12320.0}], "Beads and Binding": [{"well": binding_buffer, "volume": 11875.0}], "Binding 2": [{"well": bind2_res, "volume": 13500.0}], - "Final Elution": [{"well": elution_solution, "volume": 52000}], + "Final Elution": [{"well": elution_solution, "volume": 1200.0}], "Samples": [{"well": samps, "volume": 0.0}], - "Reagents": [{"well": res2.wells(), "volume": 9000.0}], + "Reagents": [{"well": all_washes, "volume": 9800.0}], } - flattened_list_of_wells = helpers.find_liquid_height_of_loaded_liquids( - ctx, liquid_vols_and_wells, m1000 - ) + helpers.find_liquid_height_of_loaded_liquids(ctx, liquid_vols_and_wells, m1000) m1000.flow_rate.aspirate = 300 m1000.flow_rate.dispense = 300 m1000.flow_rate.blow_out = 300 - def tiptrack(tipbox: List[Well]) -> None: - """Track Tips.""" - global tip1k - global drop_count - if tipbox == tips: - m1000.pick_up_tip(tipbox[int(tip1k)]) - tip1k = tip1k + 8 - - drop_count = drop_count + 8 - if drop_count >= 150: - drop_count = 0 - ctx.pause("Please empty the waste bin of all the tips before continuing.") - def remove_supernatant(vol: float) -> None: """Remove supernatant.""" ctx.comment("-----Removing Supernatant-----") @@ -261,6 +253,7 @@ def mixing(well: Well, pip: InstrumentContext, mvol: float, reps: int = 8) -> No dispensing at the top and 2 cycles of aspirating from middle, dispensing at the bottom """ + pip.liquid_presence_detection = False center = well.top(5) asp = well.bottom(1) disp = well.top(-8) @@ -291,14 +284,17 @@ def mixing(well: Well, pip: InstrumentContext, mvol: float, reps: int = 8) -> No def lysis(vol: float, source: Well) -> None: """Lysis.""" ctx.comment("-----Beginning Lysis Steps-----") - ctx.pause(msg="\n Hello \n - step 1 \n - step 2") num_transfers = math.ceil(vol / 980) - tiptrack(tips) + tipcheck(m1000) + total_lysis_aspirated = 0.0 for i in range(num_cols): src = source tvol = vol / num_transfers # Mix Shield and PK before transferring first time if i == 0: + m1000.liquid_presence_detection = ( + False # turn off liquid detection during mixing + ) for x in range(lysis_rep_1): m1000.aspirate(vol, src.bottom(1)) m1000.dispense(vol, src.bottom(8)) @@ -308,15 +304,15 @@ def lysis(vol: float, source: Well) -> None: m1000.aspirate(tvol, src.bottom(1)) m1000.air_gap(10) m1000.dispense(m1000.current_volume, samples_m[i].top()) - + total_lysis_aspirated += tvol * 8 # Mix shield and pk with samples for i in range(num_cols): if i != 0: - tiptrack(tips) + tipcheck(m1000) mixing(samples_m[i], m1000, tvol, reps=lysis_rep_2) m1000.drop_tip() if TIP_TRASH else m1000.return_tip() - helpers.set_hs_speed(ctx, h_s, heater_shaker_speed, lysis_incubation, True) + print(f"total lysis vol{total_lysis_aspirated}") def bind(vol1: float, vol2: float) -> None: """Binding. @@ -336,7 +332,7 @@ def bind(vol1: float, vol2: float) -> None: """ ctx.comment("-----Beginning Binding Steps-----") for i, well in enumerate(samples_m): - tiptrack(tips) + tipcheck(m1000) num_trans = math.ceil(vol1 / 980) vol_per_trans = vol1 / num_trans source = binding_buffer[i // 2] @@ -377,7 +373,7 @@ def bind(vol1: float, vol2: float) -> None: remove_supernatant(vol1 + starting_vol) ctx.comment("-----Beginning Bind #2 Steps-----") - tiptrack(tips) + tipcheck(m1000) for i, well in enumerate(samples_m): num_trans = math.ceil(vol2 / 980) vol_per_trans = vol2 / num_trans @@ -402,7 +398,7 @@ def bind(vol1: float, vol2: float) -> None: for i in range(num_cols): if i != 0: - tiptrack(tips) + tipcheck(m1000) bead_mixing( samples_m[i], m1000, vol_per_trans, reps=3 if not dry_run else 1 ) @@ -426,43 +422,32 @@ def bind(vol1: float, vol2: float) -> None: def wash(vol: float, source: List[Well]) -> None: """Wash Steps.""" global whichwash # Defines which wash the protocol is on to log on the app - - if source == wash1: - whichwash = 1 - const = 6 // len(source) - if source == wash2: - whichwash = 2 - const = 6 // len(source) - height = 1 - if source == wash3: - whichwash = 3 - const = 6 // len(source) - height = 1 - - ctx.comment("-----Wash #" + str(whichwash) + " is starting now------") + ctx.comment("-----Now starting Wash #" + str(whichwash) + "-----") + global wash_volume_tracker num_trans = math.ceil(vol / 980) vol_per_trans = vol / num_trans - tiptrack(tips) + tipcheck(m1000) for i, m in enumerate(samples_m): - if source == wash1: - if i == 0 or i == 3: - height = 10 - else: - height = 1 - src = source[i // const] + src = source[whichwash] for n in range(num_trans): if m1000.current_volume > 0: m1000.dispense(m1000.current_volume, src.top()) m1000.require_liquid_presence(src) m1000.transfer( vol_per_trans, - src.bottom(height), + src.bottom(dot_bottom), m.top(), air_gap=20, new_tip="never", ) + wash_volume_tracker += vol_per_trans * 8 + if wash_volume_tracker > 9700: + whichwash += 1 + src = source[whichwash] + ctx.comment(f"new wash source {whichwash}") + wash_volume_tracker = 0.0 m1000.drop_tip() if TIP_TRASH else m1000.return_tip() helpers.set_hs_speed(ctx, h_s, heater_shaker_speed * 0.9, wash_time, True) @@ -483,12 +468,14 @@ def wash(vol: float, source: List[Well]) -> None: remove_supernatant(vol) def elute(vol: float) -> None: - tiptrack(tips) + tipcheck(m1000) + total_elution_vol = 0.0 for i, m in enumerate(samples_m): m1000.require_liquid_presence(elution_solution) m1000.aspirate(vol, elution_solution) m1000.air_gap(20) m1000.dispense(m1000.current_volume, m.top(-3)) + total_elution_vol += vol m1000.drop_tip() if TIP_TRASH else m1000.return_tip() helpers.set_hs_speed(ctx, h_s, heater_shaker_speed * 0.9, wash_time, True) @@ -503,7 +490,7 @@ def elute(vol: float) -> None: ) for i, (m, e) in enumerate(zip(samples_m, elution_samples_m)): - tiptrack(tips) + tipcheck(m1000) m1000.flow_rate.dispense = 100 m1000.flow_rate.aspirate = 25 m1000.transfer( @@ -521,9 +508,9 @@ def elute(vol: float) -> None: """ lysis(lysis_vol, lysis_) bind(binding_buffer_vol, bind2_vol) - wash(wash1_vol, wash1) - wash(wash2_vol, wash2) - wash(wash3_vol, wash3) + wash(wash1_vol, all_washes) + wash(wash2_vol, all_washes) + wash(wash3_vol, all_washes) h_s.set_and_wait_for_temperature(55) for beaddry in np.arange(drybeads, 0, -0.5): ctx.delay( @@ -532,5 +519,10 @@ def elute(vol: float) -> None: ) elute(elution_vol) h_s.deactivate_heater() - flattened_list_of_wells.extend([waste_reservoir["A1"], elutionplate["A1"]]) - helpers.find_liquid_height_of_all_wells(ctx, m1000, flattened_list_of_wells) + helpers.clean_up_plates( + m1000, + [elutionplate, sample_plate, res1, res3, res2], + waste_reservoir["A1"], + 1000, + ) + helpers.find_liquid_height_of_all_wells(ctx, m1000, [waste_reservoir["A1"]]) diff --git a/abr-testing/abr_testing/protocols/active_protocols/11_Dynabeads_IP_Flex_96well_RIT.py b/abr-testing/abr_testing/protocols/active_protocols/11_Dynabeads_IP_Flex_96well_RIT.py index e885ec45a5e..3914c3706d0 100644 --- a/abr-testing/abr_testing/protocols/active_protocols/11_Dynabeads_IP_Flex_96well_RIT.py +++ b/abr-testing/abr_testing/protocols/active_protocols/11_Dynabeads_IP_Flex_96well_RIT.py @@ -34,7 +34,7 @@ def add_parameters(parameters: ParameterContext) -> None: BEADS_VOL = 50 AB_VOL = 50 SAMPLE_VOL = 200 -WASH_TIMES = 3 +WASH_TIMES = 6 WASH_VOL = 200 ELUTION_VOL = 50 @@ -68,7 +68,7 @@ def run(ctx: ProtocolContext) -> None: reagent_res = ctx.load_labware( "opentrons_15_tuberack_nest_15ml_conical", "C3", "reagents" ) - waste_res = ctx.load_labware("nest_1_reservoir_290ml", "D2", "waste") + waste_res = ctx.load_labware("nest_1_reservoir_290ml", "D2", "Liquid Waste") tips = ctx.load_labware("opentrons_flex_96_tiprack_1000ul", "B3") tips_sample = ctx.load_labware( @@ -194,7 +194,6 @@ def discard(vol3: float, start: List[Well]) -> None: global waste_vol global waste_vol_chk if waste_vol_chk >= WASTE_VOL_MAX: - ctx.pause("Empty Liquid Waste") waste_vol_chk = 0 waste_vol = 0.0 for k in range(NUM_COL): @@ -268,6 +267,11 @@ def discard(vol3: float, start: List[Well]) -> None: ctx.delay(minutes=MAG_DELAY_MIN) transfer_plate_to_plate(ELUTION_VOL * 1.1, working_cols, final_cols, 6) temp.deactivate() - end_wells_to_probe = [reagent_res["A1"], reagent_res["B1"], reagent_res["C1"]] + end_wells_to_probe = [ + waste_res["A1"], + reagent_res["A1"], + reagent_res["B1"], + reagent_res["C1"], + ] end_wells_to_probe.extend(wash_res.wells()) helpers.find_liquid_height_of_all_wells(ctx, p1000_single, end_wells_to_probe) diff --git a/abr-testing/abr_testing/protocols/active_protocols/1_Simple Normalize Long Right.py b/abr-testing/abr_testing/protocols/active_protocols/1_Simple Normalize Long Right.py index 525a82c3095..4b1adeead72 100644 --- a/abr-testing/abr_testing/protocols/active_protocols/1_Simple Normalize Long Right.py +++ b/abr-testing/abr_testing/protocols/active_protocols/1_Simple Normalize Long Right.py @@ -4,10 +4,12 @@ ParameterContext, Labware, SINGLE, + ALL, InstrumentContext, Well, ) from abr_testing.protocols import helpers +from typing import List, Dict metadata = { "protocolName": "Simple Normalize Long with LPD and Single Tip", @@ -15,16 +17,14 @@ "source": "Protocol Library", } -requirements = { - "robotType": "Flex", - "apiLevel": "2.21", -} +requirements = {"robotType": "Flex", "apiLevel": "2.21"} def add_parameters(parameters: ParameterContext) -> None: """Parameters.""" helpers.create_single_pipette_mount_parameter(parameters) - helpers.create_tip_size_parameter(parameters) + helpers.create_csv_parameter(parameters) + helpers.create_dot_bottom_parameter(parameters) def get_next_tip_by_row(tip_rack: Labware, pipette: InstrumentContext) -> Well | None: @@ -79,149 +79,67 @@ def get_next_tip_by_row(tip_rack: Labware, pipette: InstrumentContext) -> Well | def run(protocol: ProtocolContext) -> None: """Protocol.""" - tip_type = protocol.params.tip_size # type: ignore[attr-defined] + dot_bottom = protocol.params.dot_bottom # type: ignore[attr-defined] mount_pos = protocol.params.pipette_mount # type: ignore[attr-defined] + all_data = protocol.params.parameters_csv.parse_as_csv() # type: ignore[attr-defined] + data = all_data[1:] # DECK SETUP AND LABWARE protocol.comment("THIS IS A NO MODULE RUN") - tiprack_x_1 = protocol.load_labware(tip_type, "D1") - tiprack_x_2 = protocol.load_labware(tip_type, "D2") - tiprack_x_3 = protocol.load_labware(tip_type, "B1") + tiprack_x_1 = protocol.load_labware("opentrons_flex_96_tiprack_200ul", "D1") + tiprack_x_2 = protocol.load_labware("opentrons_flex_96_tiprack_200ul", "D2") + tiprack_x_3 = protocol.load_labware("opentrons_flex_96_tiprack_200ul", "A1") sample_plate_1 = protocol.load_labware( "armadillo_96_wellplate_200ul_pcr_full_skirt", "D3" ) reservoir = protocol.load_labware("nest_12_reservoir_15ml", "B3") + waste_reservoir = protocol.load_labware( + "nest_1_reservoir_195ml", "C1", "Liquid Waste" + ) sample_plate_2 = protocol.load_labware( "armadillo_96_wellplate_200ul_pcr_full_skirt", "C2" ) sample_plate_3 = protocol.load_labware( "armadillo_96_wellplate_200ul_pcr_full_skirt", "B2" ) + sample_plate_4 = protocol.load_labware( + "armadillo_96_wellplate_200ul_pcr_full_skirt", "A2" + ) protocol.load_trash_bin("A3") - # reagent + # reagentg146 Dye_1 = reservoir["A1"] Dye_2 = reservoir["A2"] Dye_3 = reservoir["A3"] Diluent_1 = reservoir["A4"] Diluent_2 = reservoir["A5"] + Diluent_3 = reservoir["A6"] # pipette p1000 = protocol.load_instrument( "flex_8channel_1000", mount_pos, liquid_presence_detection=True ) + p1000_single = protocol.load_instrument( + "flex_1channel_1000", + "right", + liquid_presence_detection=True, + tip_racks=[tiprack_x_2, tiprack_x_3], + ) # LOAD LIQUIDS liquid_volumes = [675.0, 675.0, 675.0, 675.0, 675.0] - wells = [Dye_1, Dye_2, Dye_3, Diluent_1, Diluent_2] + wells = [Dye_1, Dye_2, Dye_3, Diluent_1, Diluent_2, Diluent_3] helpers.load_wells_with_water(protocol, wells, liquid_volumes) - + liquid_vols_and_wells: Dict[str, List[Dict[str, Well | List[Well] | float]]] = { + "Dye": [{"well": [Dye_1, Dye_2, Dye_3], "volume": 675.0}], + "Diluent": [{"well": [Diluent_1, Diluent_2, Diluent_3], "volume": 675.0}], + } current_rack = tiprack_x_1 # CONFIGURE SINGLE LAYOUT - p1000.configure_nozzle_layout( - style=SINGLE, start="H1", tip_racks=[tiprack_x_1, tiprack_x_2, tiprack_x_3] + p1000.configure_nozzle_layout(style=SINGLE, start="H1", tip_racks=[tiprack_x_1]) + helpers.find_liquid_height_of_loaded_liquids( + protocol, liquid_vols_and_wells, p1000_single ) - helpers.find_liquid_height_of_all_wells(protocol, p1000, wells) - sample_quant_csv = """ - sample_plate_1, Sample_well,DYE,DILUENT - sample_plate_1,A1,0,100 - sample_plate_1,B1,5,95 - sample_plate_1,C1,10,90 - sample_plate_1,D1,20,80 - sample_plate_1,E1,40,60 - sample_plate_1,F1,15,40 - sample_plate_1,G1,40,20 - sample_plate_1,H1,40,0 - sample_plate_1,A2,35,65 - sample_plate_1,B2,38,42 - sample_plate_1,C2,42,58 - sample_plate_1,D2,32,8 - sample_plate_1,E2,38,12 - sample_plate_1,F2,26,74 - sample_plate_1,G2,31,69 - sample_plate_1,H2,46,4 - sample_plate_1,A3,47,13 - sample_plate_1,B3,42,18 - sample_plate_1,C3,46,64 - sample_plate_1,D3,48,22 - sample_plate_1,E3,26,74 - sample_plate_1,F3,34,66 - sample_plate_1,G3,43,37 - sample_plate_1,H3,20,80 - sample_plate_1,A4,44,16 - sample_plate_1,B4,49,41 - sample_plate_1,C4,48,42 - sample_plate_1,D4,44,16 - sample_plate_1,E4,47,53 - sample_plate_1,F4,47,33 - sample_plate_1,G4,42,48 - sample_plate_1,H4,39,21 - sample_plate_1,A5,30,20 - sample_plate_1,B5,36,14 - sample_plate_1,C5,31,59 - sample_plate_1,D5,38,52 - sample_plate_1,E5,36,4 - sample_plate_1,F5,32,28 - sample_plate_1,G5,35,55 - sample_plate_1,H5,39,1 - sample_plate_1,A6,31,59 - sample_plate_1,B6,20,80 - sample_plate_1,C6,38,2 - sample_plate_1,D6,34,46 - sample_plate_1,E6,30,70 - sample_plate_1,F6,32,58 - sample_plate_1,G6,21,79 - sample_plate_1,H6,38,52 - sample_plate_1,A7,33,27 - sample_plate_1,B7,34,16 - sample_plate_1,C7,40,60 - sample_plate_1,D7,34,26 - sample_plate_1,E7,30,20 - sample_plate_1,F7,44,56 - sample_plate_1,G7,26,74 - sample_plate_1,H7,45,55 - sample_plate_1,A8,39,1 - sample_plate_1,B8,38,2 - sample_plate_1,C8,34,66 - sample_plate_1,D8,39,11 - sample_plate_1,E8,46,54 - sample_plate_1,F8,37,63 - sample_plate_1,G8,38,42 - sample_plate_1,H8,34,66 - sample_plate_1,A9,44,56 - sample_plate_1,B9,39,11 - sample_plate_1,C9,30,70 - sample_plate_1,D9,37,33 - sample_plate_1,E9,46,54 - sample_plate_1,F9,39,21 - sample_plate_1,G9,29,41 - sample_plate_1,H9,23,77 - sample_plate_1,A10,26,74 - sample_plate_1,B10,39,1 - sample_plate_1,C10,31,49 - sample_plate_1,D10,38,62 - sample_plate_1,E10,29,1 - sample_plate_1,F10,21,79 - sample_plate_1,G10,29,41 - sample_plate_1,H10,28,42 - sample_plate_1,A11,15,55 - sample_plate_1,B11,28,72 - sample_plate_1,C11,11,49 - sample_plate_1,D11,34,66 - sample_plate_1,E11,27,73 - sample_plate_1,F11,30,40 - sample_plate_1,G11,33,67 - sample_plate_1,H11,31,39 - sample_plate_1,A12,39,31 - sample_plate_1,B12,47,53 - sample_plate_1,C12,46,54 - sample_plate_1,D12,13,7 - sample_plate_1,E12,34,46 - sample_plate_1,F12,45,35 - sample_plate_1,G12,28,42 - sample_plate_1,H12,37,63 - """ - data = [r.split(",") for r in sample_quant_csv.strip().splitlines() if r][1:] for X in range(1): protocol.comment("==============================================") protocol.comment("Adding Dye Sample Plate 1") @@ -232,8 +150,8 @@ def run(protocol: ProtocolContext) -> None: well = get_next_tip_by_row(current_rack, p1000) p1000.pick_up_tip(well) while current < len(data): - CurrentWell = str(data[current][1]) - DyeVol = float(data[current][2]) + CurrentWell = str(data[current][0]) + DyeVol = float(data[current][1]) if DyeVol != 0 and DyeVol < 100: p1000.liquid_presence_detection = False p1000.transfer( @@ -245,7 +163,7 @@ def run(protocol: ProtocolContext) -> None: if DyeVol > 20: wells.append(sample_plate_1.wells_by_name()[CurrentWell]) current += 1 - p1000.blow_out() + p1000.blow_out(location=waste_reservoir["A1"]) p1000.touch_tip() p1000.drop_tip() p1000.liquid_presence_detection = True @@ -256,34 +174,34 @@ def run(protocol: ProtocolContext) -> None: current = 0 while current < len(data): - CurrentWell = str(data[current][1]) + CurrentWell = str(data[current][0]) DilutionVol = float(data[current][2]) if DilutionVol != 0 and DilutionVol < 100: well = get_next_tip_by_row(current_rack, p1000) p1000.pick_up_tip(well) - p1000.aspirate(DilutionVol, Diluent_1.bottom(z=2)) + p1000.aspirate(DilutionVol, Diluent_1.bottom(z=dot_bottom)) p1000.dispense( DilutionVol, sample_plate_1.wells_by_name()[CurrentWell].top(z=0.2) ) if DilutionVol > 20: wells.append(sample_plate_1.wells_by_name()[CurrentWell]) - p1000.blow_out() + p1000.blow_out(location=waste_reservoir["A1"]) p1000.touch_tip() p1000.drop_tip() current += 1 + protocol.comment("Changing pipette configuration to 8ch.") + protocol.comment("==============================================") protocol.comment("Adding Dye Sample Plate 2") protocol.comment("==============================================") - current = 0 - well = get_next_tip_by_row(tiprack_x_2, p1000) - p1000.pick_up_tip(well) + p1000_single.pick_up_tip() while current < len(data): - CurrentWell = str(data[current][1]) - DyeVol = float(data[current][2]) + CurrentWell = str(data[current][0]) + DyeVol = float(data[current][1]) if DyeVol != 0 and DyeVol < 100: - p1000.transfer( + p1000_single.transfer( DyeVol, Dye_2.bottom(z=2), sample_plate_2.wells_by_name()[CurrentWell].top(z=1), @@ -292,9 +210,9 @@ def run(protocol: ProtocolContext) -> None: if DyeVol > 20: wells.append(sample_plate_2.wells_by_name()[CurrentWell]) current += 1 - p1000.blow_out() - p1000.touch_tip() - p1000.drop_tip() + p1000_single.blow_out(location=waste_reservoir["A1"]) + p1000_single.touch_tip() + p1000_single.return_tip() protocol.comment("==============================================") protocol.comment("Adding Diluent Sample Plate 2") @@ -302,20 +220,19 @@ def run(protocol: ProtocolContext) -> None: current = 0 while current < len(data): - CurrentWell = str(data[current][1]) + CurrentWell = str(data[current][0]) DilutionVol = float(data[current][2]) if DilutionVol != 0 and DilutionVol < 100: - well = get_next_tip_by_row(tiprack_x_2, p1000) - p1000.pick_up_tip(well) - p1000.aspirate(DilutionVol, Diluent_2.bottom(z=2)) - p1000.dispense( + p1000_single.pick_up_tip() + p1000_single.aspirate(DilutionVol, Diluent_2.bottom(z=dot_bottom)) + p1000_single.dispense( DilutionVol, sample_plate_2.wells_by_name()[CurrentWell].top(z=0.2) ) if DilutionVol > 20: wells.append(sample_plate_2.wells_by_name()[CurrentWell]) - p1000.blow_out() - p1000.touch_tip() - p1000.drop_tip() + p1000_single.blow_out(location=waste_reservoir["A1"]) + p1000_single.touch_tip() + p1000_single.return_tip() current += 1 protocol.comment("==============================================") @@ -323,14 +240,13 @@ def run(protocol: ProtocolContext) -> None: protocol.comment("==============================================") current = 0 - well = get_next_tip_by_row(tiprack_x_3, p1000) - p1000.pick_up_tip(well) + p1000_single.pick_up_tip() while current < len(data): - CurrentWell = str(data[current][1]) - DyeVol = float(data[current][2]) + CurrentWell = str(data[current][0]) + DyeVol = float(data[current][1]) if DyeVol != 0 and DyeVol < 100: - p1000.liquid_presence_detection = False - p1000.transfer( + p1000_single.liquid_presence_detection = False + p1000_single.transfer( DyeVol, Dye_3.bottom(z=2), sample_plate_3.wells_by_name()[CurrentWell].top(z=1), @@ -341,14 +257,85 @@ def run(protocol: ProtocolContext) -> None: if DyeVol > 20: wells.append(sample_plate_3.wells_by_name()[CurrentWell]) current += 1 - p1000.liquid_presence_detection = True - p1000.blow_out() - p1000.touch_tip() - p1000.drop_tip() + p1000_single.liquid_presence_detection = True + p1000_single.blow_out(location=waste_reservoir["A1"]) + p1000_single.touch_tip() + p1000_single.return_tip() protocol.comment("==============================================") protocol.comment("Adding Diluent Sample Plate 3") protocol.comment("==============================================") + current = 0 + while current < len(data): + CurrentWell = str(data[current][0]) + DilutionVol = float(data[current][2]) + if DilutionVol != 0 and DilutionVol < 100: + p1000_single.pick_up_tip() + p1000_single.aspirate(DilutionVol, Diluent_3.bottom(z=dot_bottom)) + p1000_single.dispense( + DilutionVol, sample_plate_3.wells_by_name()[CurrentWell].top(z=0.2) + ) + if DilutionVol > 20: + wells.append(sample_plate_3.wells_by_name()[CurrentWell]) + p1000_single.blow_out(location=waste_reservoir["A1"]) + p1000_single.touch_tip() + p1000_single.return_tip() + current += 1 + protocol.comment("==============================================") + protocol.comment("Adding Dye Sample Plate 4") + protocol.comment("==============================================") + p1000_single.reset_tipracks() current = 0 - # Probe heights - helpers.find_liquid_height_of_all_wells(protocol, p1000, wells) + p1000_single.pick_up_tip() + while current < len(data): + CurrentWell = str(data[current][0]) + DyeVol = float(data[current][1]) + if DyeVol != 0 and DyeVol < 100: + p1000_single.liquid_presence_detection = False + p1000_single.transfer( + DyeVol, + Dye_3.bottom(z=2), + sample_plate_4.wells_by_name()[CurrentWell].top(z=1), + blow_out=True, + blowout_location="destination well", + new_tip="never", + ) + if DyeVol > 20: + wells.append(sample_plate_4.wells_by_name()[CurrentWell]) + current += 1 + p1000_single.liquid_presence_detection = True + p1000_single.blow_out(location=waste_reservoir["A1"]) + p1000_single.touch_tip() + p1000_single.return_tip() + protocol.comment("==============================================") + protocol.comment("Adding Diluent Sample Plate 4") + protocol.comment("==============================================") + current = 0 + while current < len(data): + CurrentWell = str(data[current][0]) + DilutionVol = float(data[current][2]) + if DilutionVol != 0 and DilutionVol < 100: + p1000_single.pick_up_tip() + p1000_single.aspirate(DilutionVol, Diluent_3.bottom(z=dot_bottom)) + p1000_single.dispense( + DilutionVol, sample_plate_4.wells_by_name()[CurrentWell].top(z=0.2) + ) + if DilutionVol > 20: + wells.append(sample_plate_4.wells_by_name()[CurrentWell]) + p1000_single.blow_out(location=waste_reservoir["A1"]) + p1000_single.touch_tip() + p1000_single.return_tip() + current += 1 + + current = 0 + # Probe heights + p1000.configure_nozzle_layout(style=ALL, tip_racks=[tiprack_x_3]) + helpers.clean_up_plates( + p1000, + [sample_plate_1, sample_plate_2, sample_plate_3, sample_plate_4], + waste_reservoir["A1"], + 200, + ) + helpers.find_liquid_height_of_all_wells( + protocol, p1000_single, [waste_reservoir["A1"]] + ) diff --git a/abr-testing/abr_testing/protocols/active_protocols/2_BMS_PCR_Protocol.py b/abr-testing/abr_testing/protocols/active_protocols/2_BMS_PCR_Protocol.py index 24e7358f6e1..703085a88d8 100644 --- a/abr-testing/abr_testing/protocols/active_protocols/2_BMS_PCR_Protocol.py +++ b/abr-testing/abr_testing/protocols/active_protocols/2_BMS_PCR_Protocol.py @@ -5,7 +5,7 @@ ThermocyclerContext, TemperatureModuleContext, ) -from opentrons.protocol_api import SINGLE, Well +from opentrons.protocol_api import SINGLE, Well, ALL from abr_testing.protocols import helpers from typing import List, Dict @@ -46,17 +46,17 @@ def run(ctx: ProtocolContext) -> None: helpers.temp_str, location="D3" ) # type: ignore[assignment] reagent_rack = temp_mod.load_labware( - "opentrons_24_aluminumblock_nest_1.5ml_snapcap" - ) # check if 2mL - - dest_plate = tc_mod.load_labware( - "opentrons_96_wellplate_200ul_pcr_full_skirt" - ) # do I change this to tough plate if they run pcr? - - source_plate = ctx.load_labware( - "opentrons_96_wellplate_200ul_pcr_full_skirt", location="D1" - ) # do I change this to their plate? + "opentrons_24_aluminumblock_nest_1.5ml_snapcap", "Reagent Rack" + ) + dest_plate_1 = tc_mod.load_labware( + "opentrons_96_wellplate_200ul_pcr_full_skirt", "Destination Plate 1" + ) + source_plate_1 = ctx.load_labware( + "opentrons_96_wellplate_200ul_pcr_full_skirt", "D1", "DNA Plate 1" + ) + waste = ctx.load_labware("nest_1_reservoir_195ml", "D2", "Liquid Waste") + liquid_waste = waste["A1"] tiprack_50 = [ ctx.load_labware("opentrons_flex_96_tiprack_50ul", slot) for slot in [8, 9] ] @@ -81,23 +81,18 @@ def run(ctx: ProtocolContext) -> None: # LOAD LIQUIDS water: Well = reagent_rack["B1"] mmx_pic: List[Well] = reagent_rack.rows()[0] - dna_pic: List[Well] = source_plate.wells() + dna_pic: List[Well] = source_plate_1.wells() liquid_vols_and_wells: Dict[str, List[Dict[str, Well | List[Well] | float]]] = { - "Water": [{"well": water, "volume": 1500.0}], - "Mastermix": [{"well": mmx_pic, "volume": 1500.0}], - "DNA": [{"well": dna_pic, "volume": 50.0}], + "Water": [{"well": water, "volume": 500.0}], + "Mastermix": [{"well": mmx_pic, "volume": 500.0}], + "DNA": [{"well": dna_pic, "volume": 100.0}], } - helpers.load_wells_with_custom_liquids(ctx, liquid_vols_and_wells) - wells_to_probe = [[water], mmx_pic, dna_pic] - wells_to_probe_flattened = [ - well for list_of_wells in wells_to_probe for well in list_of_wells - ] - helpers.find_liquid_height_of_all_wells(ctx, p50, wells_to_probe_flattened) + helpers.find_liquid_height_of_loaded_liquids(ctx, liquid_vols_and_wells, p50) # adding water ctx.comment("\n\n----------ADDING WATER----------\n") p50.pick_up_tip() - # p50.aspirate(40, water) # prewet - # p50.dispense(40, water) + p50.aspirate(40, water) # prewet + p50.dispense(40, water) parsed_csv = parsed_csv[1:] num_of_rows = len(parsed_csv) for row_index in range(num_of_rows): @@ -112,9 +107,9 @@ def run(ctx: ProtocolContext) -> None: p50.configure_for_volume(water_vol) p50.aspirate(water_vol, water) - p50.dispense(water_vol, dest_plate[dest_well], rate=0.5) + p50.dispense(water_vol, dest_plate_1[dest_well], rate=0.5) p50.configure_for_volume(50) - # p50.blow_out() + p50.blow_out() p50.drop_tip() # adding Mastermix @@ -144,7 +139,7 @@ def run(ctx: ProtocolContext) -> None: break p50.configure_for_volume(mmx_vol) p50.aspirate(mmx_vol, reagent_rack[mmx_tube]) - p50.dispense(mmx_vol, dest_plate[dest_well].top()) + p50.dispense(mmx_vol, dest_plate_1[dest_well].top()) ctx.delay(seconds=2) p50.blow_out() p50.touch_tip() @@ -168,24 +163,23 @@ def run(ctx: ProtocolContext) -> None: if dna_vol == 0: break p50.configure_for_volume(dna_vol) - p50.aspirate(dna_vol, source_plate[dest_and_source_well]) - p50.dispense(dna_vol, dest_plate[dest_and_source_well], rate=0.5) + p50.aspirate(dna_vol, source_plate_1[dest_and_source_well]) + p50.dispense(dna_vol, dest_plate_1[dest_and_source_well], rate=0.5) p50.mix( 10, 0.7 * rxn_vol if 0.7 * rxn_vol < 30 else 30, - dest_plate[dest_and_source_well], + dest_plate_1[dest_and_source_well], ) p50.drop_tip() p50.configure_for_volume(50) - wells_to_probe_flattened.append(dest_plate[dest_well]) ctx.comment("\n\n-----------Running PCR------------\n") if real_mode: if disposable_lid: lid_on_plate, unused_lids, used_lids = helpers.use_disposable_lid_with_tc( - ctx, unused_lids, used_lids, dest_plate, tc_mod + ctx, unused_lids, used_lids, dest_plate_1, tc_mod ) else: tc_mod.close_lid() @@ -210,4 +204,9 @@ def run(ctx: ProtocolContext) -> None: ctx.move_labware(lid_on_plate, used_lids[-2], use_gripper=True) p50.drop_tip() p50.configure_nozzle_layout(style=SINGLE, start="A1", tip_racks=tiprack_50) - helpers.find_liquid_height_of_all_wells(ctx, p50, wells_to_probe_flattened) + mmx_pic.append(water) + # Empty plates into liquid waste + p50.configure_nozzle_layout(style=ALL, tip_racks=tiprack_50) + helpers.clean_up_plates(p50, [source_plate_1, dest_plate_1], liquid_waste, 50) + # Probe liquid waste + helpers.find_liquid_height_of_all_wells(ctx, p50, [liquid_waste]) diff --git a/abr-testing/abr_testing/protocols/active_protocols/3_Tartrazine Protocol.py b/abr-testing/abr_testing/protocols/active_protocols/3_Tartrazine Protocol.py index 66db85468f4..64595fb69e1 100644 --- a/abr-testing/abr_testing/protocols/active_protocols/3_Tartrazine Protocol.py +++ b/abr-testing/abr_testing/protocols/active_protocols/3_Tartrazine Protocol.py @@ -1,5 +1,10 @@ """Tartrazine Protocol.""" -from opentrons.protocol_api import ProtocolContext, ParameterContext, Well +from opentrons.protocol_api import ( + ProtocolContext, + ParameterContext, + Well, + InstrumentContext, +) from abr_testing.protocols import helpers from opentrons.protocol_api.module_contexts import ( AbsorbanceReaderContext, @@ -27,97 +32,165 @@ def add_parameters(parameters: ParameterContext) -> None: minimum=1, maximum=4, ) + helpers.create_channel_parameter(parameters) def run(ctx: ProtocolContext) -> None: """Protocol.""" + # Load parameters number_of_plates = ctx.params.number_of_plates # type: ignore [attr-defined] + channels = ctx.params.channels # type: ignore [attr-defined] # Plate Reader plate_reader: AbsorbanceReaderContext = ctx.load_module( helpers.abs_mod_str, "A3" ) # type: ignore[assignment] hs: HeaterShakerContext = ctx.load_module(helpers.hs_str, "A1") # type: ignore[assignment] hs_adapter = hs.load_adapter("opentrons_universal_flat_adapter") - tube_rack = ctx.load_labware( - "opentrons_10_tuberack_nest_4x50ml_6x15ml_conical", "C2", "Reagent Tube" - ) - tartrazine_tube = tube_rack["A3"] - water_tube_1 = tube_rack["A4"] - water_tube_2 = tube_rack["B3"] - sample_plate_1 = ctx.load_labware( - "corning_96_wellplate_360ul_flat", "D1", "Sample Plate 1" - ) - sample_plate_2 = ctx.load_labware( - "corning_96_wellplate_360ul_flat", "D2", "Sample Plate 2" - ) - sample_plate_3 = ctx.load_labware( - "corning_96_wellplate_360ul_flat", "C1", "Sample Plate 3" - ) - sample_plate_4 = ctx.load_labware( - "corning_96_wellplate_360ul_flat", "B1", "Sample Plate 4" - ) - - sample_plate_list = [sample_plate_1, sample_plate_2, sample_plate_3, sample_plate_4] - tiprack_50_1 = ctx.load_labware("opentrons_flex_96_tiprack_50ul", "D3") - tiprack_50_2 = ctx.load_labware("opentrons_flex_96_tiprack_50ul", "C3") - tiprack_50_3 = ctx.load_labware("opentrons_flex_96_tiprack_50ul", "B3") + # Load Plates based off of number_of_plates parameter + available_deck_slots = ["D1", "D2", "C1", "B1"] + sample_plate_list = [] + for plate_num, slot in zip(range(number_of_plates), available_deck_slots): + plate = ctx.load_labware( + "corning_96_wellplate_360ul_flat", slot, f"Sample Plate {plate_num + 1}" + ) + sample_plate_list.append(plate) + available_tip_rack_slots = ["D3", "C3", "B3", "B2"] + # LOAD PIPETTES AND TIP RACKS + # 50 CHANNEL + tip_racks_50 = [] + for plate_num, slot_2 in zip(range(number_of_plates), available_tip_rack_slots): + tiprack_50 = ctx.load_labware("opentrons_flex_96_tiprack_50ul", slot_2) + tip_racks_50.append(tiprack_50) + p50 = ctx.load_instrument(f"flex_{channels}_50", "left", tip_racks=tip_racks_50) + # 1000 CHANNEL tiprack_1000_1 = ctx.load_labware("opentrons_flex_96_tiprack_1000ul", "A2") - tip_racks = [tiprack_50_1, tiprack_50_2, tiprack_50_3] - - # Pipette - p50 = ctx.load_instrument("flex_1channel_50", "left", tip_racks=tip_racks) p1000 = ctx.load_instrument( - "flex_1channel_1000", "right", tip_racks=[tiprack_1000_1] + f"flex_{channels}_1000", "right", tip_racks=[tiprack_1000_1] ) + # DETERMINE RESERVOIR BASED OFF # OF PIPETTE CHANNELS + # 1 CHANNEL = TUBE RACK + if p50.active_channels == 1: + reservoir = ctx.load_labware( + "opentrons_10_tuberack_nest_4x50ml_6x15ml_conical", "C2", "Reservoir" + ) + water_max_vol = reservoir["A3"].max_volume - 500 + reservoir_wells = reservoir.wells()[6:] # Skip first 4 bc they are 15ml + else: + # 8 CHANNEL = 12 WELL RESERVOIR + reservoir = ctx.load_labware("nest_12_reservoir_15ml", "C2", "Reservoir") + water_max_vol = reservoir["A1"].max_volume - 500 + reservoir_wells = reservoir.wells()[ + 1: + ] # Skip A1 as it's reserved for tartrazine + + # LABEL RESERVOIR WELLS AND DETERMINE NEEDED LIQUID + tartrazine_well = reservoir["A1"] + # NEEDED TARTRAZINE + needed_tartrazine: float = ( + float(number_of_plates) * 96.0 + ) * 10.0 + 1000.0 # loading extra as a safety factor + # NEEDED WATER + needed_water: float = ( + float(number_of_plates) * 96.0 * 250 + ) # loading extra as a safety factor + # CALCULATING NEEDED # OF WATER WELLS + needed_wells = round(needed_water / water_max_vol) + water_wells = [] + for i in range(needed_wells + 1): + water_wells.append(reservoir_wells[i]) - # Probe wells + def _mix_tartrazine(pipette: InstrumentContext, well_to_probe: Well) -> None: + """Mix Tartrazine.""" + # Mix step is needed to ensure tartrazine does not settle between plates. + pipette.pick_up_tip() + top_of_tartrazine = helpers.find_liquid_height(pipette, well_to_probe) + for i in range(20): + p50.aspirate(1, well_to_probe.bottom(z=1)) + p50.dispense(1, well_to_probe.bottom(z=top_of_tartrazine + 1)) + pipette.return_tip() + + # LOAD LIQUIDS AND PROBE WELLS liquid_vols_and_wells: Dict[str, List[Dict[str, Well | List[Well] | float]]] = { - "Tartrazine": [{"well": tartrazine_tube, "volume": 45.0}], - "Water": [{"well": [water_tube_1, water_tube_2], "volume": 45.0}], + "Tartrazine": [{"well": tartrazine_well, "volume": needed_tartrazine}], + "Water": [{"well": water_wells, "volume": water_max_vol}], } helpers.find_liquid_height_of_loaded_liquids(ctx, liquid_vols_and_wells, p50) - + tip_count = 1 * p50.active_channels # number of 50 ul tip uses. + p50.reset_tipracks() i = 0 all_percent_error_dict = {} cv_dict = {} - vol = 0.0 - tip_count = 0 + vol = 0.0 # counter to track available water volume + water_tip_count = 0 * p1000.active_channels # number of 1000 ul tip uses + well_num = 0 # index of well being used for water for sample_plate in sample_plate_list[:number_of_plates]: - deck_locations = ["D1", "D2", "C1", "B1"] - p1000.pick_up_tip() - for well in sample_plate.wells(): - if vol < 45000: - tube_of_choice = water_tube_1 + return_location = sample_plate.parent + # Mix Tartrazine to ensure no settling as occurred + _mix_tartrazine(p50, tartrazine_well) + tip_count += 1 * p50.active_channels + # Determine list of wells to probe + if p50.active_channels == 1: + well_list = sample_plate.wells() + elif p50.active_channels == 8: + well_list = sample_plate.rows()[0] + for well in well_list: + p1000.pick_up_tip() + # Determine which water well to aspirate from. + if vol < water_max_vol - 6000: + well_of_choice = water_wells[well_num] else: - tube_of_choice = water_tube_2 + well_num += 1 + well_of_choice = water_wells[well_num] + vol = 0.0 p50.pick_up_tip() - p1000.aspirate(190, tube_of_choice) - p1000.air_gap(5) - p1000.dispense(5, well.top()) + p1000.aspirate(190, well_of_choice) + p1000.air_gap(10) + p1000.dispense(10, well.top()) p1000.dispense(190, well) - vol += 190 - height = helpers.find_liquid_height(p50, tartrazine_tube) - p50.aspirate(10, tartrazine_tube.bottom(z=height)) + # Two blow outs ensures water is completely removed from pipette + p1000.blow_out(well.top()) + ctx.delay(minutes=0.1) + p1000.blow_out(well.top()) + vol += 190 * p1000.active_channels + # Probe to find liquid height of tartrazine to ensure correct amount is aspirated + height = helpers.find_liquid_height(p50, tartrazine_well) + if height <= 0.0: + # If a negative tartrazine height is found, + # the protocol will pause, prompt a refill, and reprobe. + ctx.pause("Fill tartrazine") + height = helpers.find_liquid_height(p50, tartrazine_well) + p50.aspirate(10, tartrazine_well.bottom(z=height), rate=0.15) p50.air_gap(5) p50.dispense(5, well.top()) - p50.dispense(10, well.bottom(z=0.5)) + p50.dispense(10, well.bottom(z=0.5), rate=0.15) + p50.blow_out() + ctx.delay(minutes=0.1) p50.blow_out() p50.return_tip() - tip_count += 1 - if tip_count >= (96 * 3): + tip_count += p50.active_channels + if tip_count >= (96 * len(tip_racks_50)): p50.reset_tipracks() - p1000.return_tip() + tip_count = 0 + p1000.return_tip() + water_tip_count += p1000.active_channels + if water_tip_count >= 96: + p1000.reset_tipracks() + water_tip_count = 0 + # Move labware to heater shaker to be mixed helpers.move_labware_to_hs(ctx, sample_plate, hs, hs_adapter) helpers.set_hs_speed(ctx, hs, 1500, 2.0, True) hs.open_labware_latch() + # Initialize plate reader plate_reader.close_lid() plate_reader.initialize("single", [450]) plate_reader.open_lid() + # Move sample plate into plate reader ctx.move_labware(sample_plate, plate_reader, use_gripper=True) sample_plate_name = "sample plate_" + str(i + 1) csv_string = sample_plate_name + "_" + str(datetime.now()) plate_reader.close_lid() result = plate_reader.read(csv_string) + # Calculate CV and % error of expected value. for wavelength in result: dict_of_wells = result[wavelength] readings_and_wells = dict_of_wells.items() @@ -145,11 +218,13 @@ def run(ctx: ProtocolContext) -> None: "SD": standard_deviation, "Avg Percent Error": avg_percent_error, } + # Move Plate back to original location all_percent_error_dict[sample_plate_name] = percent_error_dict plate_reader.open_lid() - ctx.move_labware(sample_plate, deck_locations[i], use_gripper=True) + ctx.comment(f"------plate {sample_plate}. {cv_dict[sample_plate_name]}------") + ctx.move_labware(sample_plate, return_location, use_gripper=True) i += 1 # Print percent error dictionary ctx.comment("Percent Error: " + str(all_percent_error_dict)) # Print cv dictionary - ctx.comment("Plate Reader result: " + str(cv_dict)) + ctx.comment("Plate Reader Result: " + str(cv_dict)) diff --git a/abr-testing/abr_testing/protocols/active_protocols/4_Illumina DNA Enrichment.py b/abr-testing/abr_testing/protocols/active_protocols/4_Illumina DNA Enrichment.py new file mode 100644 index 00000000000..dbba84c3b6d --- /dev/null +++ b/abr-testing/abr_testing/protocols/active_protocols/4_Illumina DNA Enrichment.py @@ -0,0 +1,1010 @@ +"""DVT1ABR4: Illumina DNA Enrichment.""" +from opentrons.protocol_api import ( + ParameterContext, + ProtocolContext, + Labware, + Well, + InstrumentContext, +) +from opentrons import types +from abr_testing.protocols import helpers +from opentrons.protocol_api.module_contexts import ( + HeaterShakerContext, + MagneticBlockContext, + ThermocyclerContext, + TemperatureModuleContext, +) +from opentrons.hardware_control.modules.types import ThermocyclerStep +from typing import List, Dict + + +metadata = { + "protocolName": "Illumina DNA Enrichment v4 with TC Auto Sealing Lid", + "author": "Opentrons ", + "source": "Protocol Library", +} + +requirements = { + "robotType": "Flex", + "apiLevel": "2.21", +} + +# SCRIPT SETTINGS +DRYRUN = False # True = skip incubation times, shorten mix, for testing purposes +USE_GRIPPER = True # True = Uses Gripper, False = Manual Move +TIP_TRASH = False # True = Used tips go in Trash, False = Used tips go back into rack +HYBRID_PAUSE = True # True = sets a pause on the Hybridization + +# PROTOCOL SETTINGS +COLUMNS = 4 # 1-4 +HYBRIDDECK = True +HYBRIDTIME = 1.6 # Hours + +# PROTOCOL BLOCKS +STEP_VOLPOOL = 0 +STEP_HYB = 0 +STEP_CAPTURE = 1 +STEP_WASH = 1 +STEP_PCR = 1 +STEP_PCRDECK = 1 +STEP_CLEANUP = 1 + +p200_tips = 0 +p50_tips = 0 +total_waste_volume = 0.0 + + +RUN = 1 + + +def add_parameters(parameters: ParameterContext) -> None: + """Add parameters.""" + helpers.create_hs_speed_parameter(parameters) + helpers.create_dot_bottom_parameter(parameters) + helpers.create_disposable_lid_parameter(parameters) + helpers.create_tc_lid_deck_riser_parameter(parameters) + helpers.create_disposable_lid_trash_location(parameters) + + +def run(protocol: ProtocolContext) -> None: + """Protocol.""" + heater_shaker_speed = protocol.params.heater_shaker_speed # type: ignore[attr-defined] + dot_bottom = protocol.params.dot_bottom # type: ignore[attr-defined] + disposable_lid = protocol.params.disposable_lid # type: ignore[attr-defined] + deck_riser = protocol.params.deck_riser # type: ignore[attr-defined] + trash_lid = protocol.params.trash_lid # type: ignore[attr-defined] + unused_lids: List[Labware] = [] + used_lids: List[Labware] = [] + global p200_tips + global p50_tips + + protocol.comment("THIS IS A DRY RUN") if DRYRUN else protocol.comment( + "THIS IS A REACTION RUN" + ) + protocol.comment("USED TIPS WILL GO IN TRASH") if TIP_TRASH else protocol.comment( + "USED TIPS WILL BE RE-RACKED" + ) + + # DECK SETUP AND LABWARE + # ========== FIRST ROW =========== + heatershaker: HeaterShakerContext = protocol.load_module( + helpers.hs_str, "1" + ) # type: ignore[assignment] + heatershaker.close_labware_latch() + sample_plate_2 = heatershaker.load_labware( + "thermoscientificnunc_96_wellplate_1300ul" + ) + reservoir = protocol.load_labware("nest_96_wellplate_2ml_deep", "2", "Liquid Waste") + temp_block: TemperatureModuleContext = protocol.load_module( + helpers.temp_str, "3" + ) # type: ignore[assignment] + reagent_plate, temp_adapter = helpers.load_temp_adapter_and_labware( + "armadillo_96_wellplate_200ul_pcr_full_skirt", temp_block, "Reagent Plate" + ) + # ========== SECOND ROW ========== + MAG_PLATE_SLOT: MagneticBlockContext = protocol.load_module( + helpers.mag_str, "C1" + ) # type: ignore[assignment] + tiprack_200_1 = protocol.load_labware("opentrons_flex_96_tiprack_200ul", "5") + tiprack_50_1 = protocol.load_labware("opentrons_flex_96_tiprack_50ul", "6") + # Opentrons tough pcr auto sealing lids + if disposable_lid: + unused_lids = helpers.load_disposable_lids(protocol, 3, ["C4"], deck_riser) + # ========== THIRD ROW =========== + thermocycler: ThermocyclerContext = protocol.load_module( + helpers.tc_str + ) # type: ignore[assignment] + sample_plate_1 = thermocycler.load_labware( + "armadillo_96_wellplate_200ul_pcr_full_skirt" + ) + thermocycler.open_lid() + tiprack_200_2 = protocol.load_labware("opentrons_flex_96_tiprack_200ul", "8") + tiprack_50_2 = protocol.load_labware("opentrons_flex_96_tiprack_50ul", "9") + # ========== FOURTH ROW ========== + tiprack_200_3 = protocol.load_labware("opentrons_flex_96_tiprack_200ul", "11") + trash_bin = protocol.load_trash_bin("A3") + # reagent + AMPure = reservoir["A1"] + SMB = reservoir["A2"] + + EtOH = reservoir["A4"] + RSB = reservoir["A5"] + Liquid_trash_well_1 = reservoir["A9"] + Liquid_trash_well_2 = reservoir["A10"] + Liquid_trash_well_3 = reservoir["A11"] + Liquid_trash_well_4 = reservoir["A12"] + liquid_trash_list = { + Liquid_trash_well_1: 0.0, + Liquid_trash_well_2: 0.0, + Liquid_trash_well_3: 0.0, + Liquid_trash_well_4: 0.0, + } + + def trash_liquid( + protocol: ProtocolContext, + pipette: InstrumentContext, + vol_to_trash: float, + liquid_trash_list: Dict[Well, float], + ) -> None: + """Determine which wells to use as liquid waste.""" + remaining_volume = vol_to_trash + max_capacity = 1500.0 + # Determine liquid waste location depending on current total volume + # Distribute the liquid volume sequentially + for well, current_volume in liquid_trash_list.items(): + if remaining_volume <= 0.0: + break + available_capacity = max_capacity - current_volume + if available_capacity < remaining_volume: + continue + pipette.dispense(remaining_volume, well.top()) + protocol.delay(minutes=0.1) + pipette.blow_out(well.top()) + liquid_trash_list[well] += remaining_volume + if pipette.current_volume <= 0.0: + break + + # Will Be distributed during the protocol + EEW_1 = sample_plate_2.wells_by_name()["A9"] + EEW_2 = sample_plate_2.wells_by_name()["A10"] + EEW_3 = sample_plate_2.wells_by_name()["A11"] + EEW_4 = sample_plate_2.wells_by_name()["A12"] + + NHB2 = reagent_plate.wells_by_name()["A1"] + Panel = reagent_plate.wells_by_name()["A2"] + EHB2 = reagent_plate.wells_by_name()["A3"] + Elute = reagent_plate.wells_by_name()["A4"] + ET2 = reagent_plate.wells_by_name()["A5"] + PPC = reagent_plate.wells_by_name()["A6"] + EPM = reagent_plate.wells_by_name()["A7"] + + # pipette + p1000 = protocol.load_instrument( + "flex_8channel_1000", + "left", + tip_racks=[tiprack_200_1, tiprack_200_2, tiprack_200_3], + ) + p50 = protocol.load_instrument( + "flex_8channel_50", "right", tip_racks=[tiprack_50_1, tiprack_50_2] + ) + reagent_plate.columns()[3] + # Load liquids and probe + liquid_vols_and_wells: Dict[str, List[Dict[str, Well | List[Well] | float]]] = { + "Reagents": [ + {"well": reagent_plate.columns()[3], "volume": 75.0}, + {"well": reagent_plate.columns()[4], "volume": 15.0}, + {"well": reagent_plate.columns()[5], "volume": 20.0}, + {"well": reagent_plate.columns()[6], "volume": 65.0}, + ], + "AMPure": [{"well": reservoir.columns()[0], "volume": 120.0}], + "SMB": [{"well": reservoir.columns()[1], "volume": 750.0}], + "EtOH": [{"well": reservoir.columns()[3], "volume": 900.0}], + "RSB": [{"well": reservoir.columns()[4], "volume": 96.0}], + "Wash": [ + {"well": sample_plate_2.columns()[8], "volume": 1000.0}, + {"well": sample_plate_2.columns()[9], "volume": 1000.0}, + {"well": sample_plate_2.columns()[10], "volume": 1000.0}, + {"well": sample_plate_2.columns()[11], "volume": 1000.0}, + ], + "Samples": [{"well": sample_plate_1.wells(), "volume": 150.0}], + } + helpers.find_liquid_height_of_loaded_liquids(protocol, liquid_vols_and_wells, p50) + # tip and sample tracking + if COLUMNS == 1: + column_1_list = ["A1"] # Plate 1 + column_2_list = ["A1"] # Plate 2 + column_3_list = ["A4"] # Plate 2 + column_4_list = ["A4"] # Plate 1 + column_5_list = ["A7"] # Plate 2 + column_6_list = ["A7"] # Plate 1 + WASHES = [EEW_1] + if COLUMNS == 2: + column_1_list = ["A1", "A2"] # Plate 1 + column_2_list = ["A1", "A2"] # Plate 2 + column_3_list = ["A4", "A5"] # Plate 2 + column_4_list = ["A4", "A5"] # Plate 1 + column_5_list = ["A7", "A8"] # Plate 2 + column_6_list = ["A7", "A8"] # Plate 1 + WASHES = [EEW_1, EEW_2] + if COLUMNS == 3: + column_1_list = ["A1", "A2", "A3"] # Plate 1 + column_2_list = ["A1", "A2", "A3"] # Plate 2 + column_3_list = ["A4", "A5", "A6"] # Plate 2 + column_4_list = ["A4", "A5", "A6"] # Plate 1 + column_5_list = ["A7", "A8", "A9"] # Plate 2 + column_6_list = ["A7", "A8", "A9"] # Plate 1 + WASHES = [EEW_1, EEW_2, EEW_3] + if COLUMNS == 4: + column_1_list = ["A1", "A2", "A3", "A4"] # Plate 1 + column_2_list = ["A1", "A2", "A3", "A4"] # Plate 2 + column_3_list = ["A5", "A6", "A7", "A8"] # Plate 2 + column_4_list = ["A5", "A6", "A7", "A8"] # Plate 1 + column_5_list = ["A9", "A10", "A11", "A12"] # Plate 2 + column_6_list = ["A9", "A10", "A11", "A12"] # Plate 1 + WASHES = [EEW_1, EEW_2, EEW_3, EEW_4] + + def tipcheck() -> None: + """Tip tracking function.""" + if p200_tips >= 3 * 12: + p1000.reset_tipracks() + p200_tips == 0 + if p50_tips >= 2 * 12: + p50.reset_tipracks() + p50_tips == 0 + + # commands + for loop in range(RUN): + thermocycler.open_lid() + heatershaker.open_labware_latch() + if DRYRUN is False: + if STEP_HYB == 1: + protocol.comment("SETTING THERMO and TEMP BLOCK Temperature") + thermocycler.set_block_temperature(4) + thermocycler.set_lid_temperature(100) + temp_block.set_temperature(4) + else: + protocol.comment("SETTING THERMO and TEMP BLOCK Temperature") + thermocycler.set_block_temperature(58) + thermocycler.set_lid_temperature(58) + heatershaker.set_and_wait_for_temperature(58) + heatershaker.close_labware_latch() + + # Sample Plate contains 30ul of DNA + + if STEP_VOLPOOL == 1: + protocol.comment("==============================================") + protocol.comment("--> Quick Vol Pool") + protocol.comment("==============================================") + + if STEP_HYB == 1: + protocol.comment("==============================================") + protocol.comment("--> HYB") + protocol.comment("==============================================") + + protocol.comment("--> Adding NHB2") + NHB2Vol = 50 + for loop, X in enumerate(column_1_list): + p50.pick_up_tip() + p50.aspirate(NHB2Vol, NHB2.bottom(z=dot_bottom)) # original = () + p50.dispense( + NHB2Vol, sample_plate_1[X].bottom(z=dot_bottom) + ) # original = () + p50.return_tip() if TIP_TRASH is False else p50.drop_tip() + p50_tips += 1 + tipcheck() + + protocol.comment("--> Adding Panel") + PanelVol = 10 + for loop, X in enumerate(column_1_list): + p50.pick_up_tip() + p50.aspirate(PanelVol, Panel.bottom(z=dot_bottom)) # original = () + p50.dispense( + PanelVol, sample_plate_1[X].bottom(z=dot_bottom) + ) # original = () + p50.return_tip() if TIP_TRASH is False else p50.drop_tip() + p50_tips += 1 + tipcheck() + + protocol.comment("--> Adding EHB2") + EHB2Vol = 10 + EHB2MixRep = 10 if DRYRUN is False else 1 + EHB2MixVol = 90 + for loop, X in enumerate(column_1_list): + p1000.pick_up_tip() + p1000.aspirate(EHB2Vol, EHB2.bottom(z=dot_bottom)) # original = () + p1000.dispense( + EHB2Vol, sample_plate_1[X].bottom(z=dot_bottom) + ) # original = () + p1000.move_to(sample_plate_1[X].bottom(z=dot_bottom)) # original = () + p1000.mix(EHB2MixRep, EHB2MixVol) + p1000.return_tip() if TIP_TRASH is False else p1000.drop_tip() + p50_tips += 1 + tipcheck() + + if HYBRIDDECK: + protocol.comment("Hybridize on Deck") + if disposable_lid: + ( + lid_on_plate, + unused_lids, + used_lids, + ) = helpers.use_disposable_lid_with_tc( + protocol, unused_lids, used_lids, sample_plate_1, thermocycler + ) + else: + thermocycler.close_lid() + if DRYRUN is False: + profile_TAGSTOP: List[ThermocyclerStep] = [ + {"temperature": 98, "hold_time_minutes": 5}, + {"temperature": 97, "hold_time_minutes": 1}, + {"temperature": 95, "hold_time_minutes": 1}, + {"temperature": 93, "hold_time_minutes": 1}, + {"temperature": 91, "hold_time_minutes": 1}, + {"temperature": 89, "hold_time_minutes": 1}, + {"temperature": 87, "hold_time_minutes": 1}, + {"temperature": 85, "hold_time_minutes": 1}, + {"temperature": 83, "hold_time_minutes": 1}, + {"temperature": 81, "hold_time_minutes": 1}, + {"temperature": 79, "hold_time_minutes": 1}, + {"temperature": 77, "hold_time_minutes": 1}, + {"temperature": 75, "hold_time_minutes": 1}, + {"temperature": 73, "hold_time_minutes": 1}, + {"temperature": 71, "hold_time_minutes": 1}, + {"temperature": 69, "hold_time_minutes": 1}, + {"temperature": 67, "hold_time_minutes": 1}, + {"temperature": 65, "hold_time_minutes": 1}, + {"temperature": 63, "hold_time_minutes": 1}, + {"temperature": 62, "hold_time_minutes": HYBRIDTIME * 60}, + ] + thermocycler.execute_profile( + steps=profile_TAGSTOP, repetitions=1, block_max_volume=100 + ) + thermocycler.set_block_temperature(62) + if HYBRID_PAUSE: + protocol.comment("HYBRIDIZATION PAUSED") + thermocycler.set_block_temperature(10) + thermocycler.open_lid() + if disposable_lid: + if trash_lid: + protocol.move_labware(lid_on_plate, trash_bin, use_gripper=True) + elif len(used_lids) <= 1: + protocol.move_labware(lid_on_plate, "B4", use_gripper=True) + else: + protocol.move_labware( + lid_on_plate, used_lids[-2], use_gripper=True + ) + else: + protocol.comment("Hybridize off Deck") + + if STEP_CAPTURE == 1: + protocol.comment("==============================================") + protocol.comment("--> Capture") + protocol.comment("==============================================") + # Standard Setup + + if DRYRUN is False: + protocol.comment("SETTING THERMO and TEMP BLOCK Temperature") + thermocycler.set_block_temperature(58) + thermocycler.set_lid_temperature(58) + + if DRYRUN is False: + heatershaker.set_and_wait_for_temperature(58) + + protocol.comment("--> Transfer Hybridization") + TransferSup = 100 + for loop, X in enumerate(column_1_list): + p1000.pick_up_tip() + p1000.move_to(sample_plate_1[X].bottom(z=0.5)) + p1000.aspirate(TransferSup + 1, rate=0.25) + p1000.dispense( + TransferSup + 1, sample_plate_2[column_2_list[loop]].bottom(z=1) + ) + p1000.return_tip() if TIP_TRASH is False else p1000.drop_tip() + p200_tips += 1 + tipcheck() + if disposable_lid: + ( + lid_on_plate, + unused_lids, + used_lids, + ) = helpers.use_disposable_lid_with_tc( + protocol, + unused_lids, + used_lids, + sample_plate_1, + thermocycler, + ) + else: + thermocycler.close_lid() + + protocol.comment("--> ADDING SMB") + SMBVol = 250 + SMBMixRPM = heater_shaker_speed + SMBMixRep = 5.0 if DRYRUN is False else 0.1 # minutes + SMBPremix = 3 if DRYRUN is False else 1 + # ============================== + for loop, X in enumerate(column_2_list): + p1000.pick_up_tip() + p1000.mix(SMBPremix, 200, SMB.bottom(z=1)) + p1000.aspirate(SMBVol / 2, SMB.bottom(z=1), rate=0.25) + p1000.dispense(SMBVol / 2, sample_plate_2[X].top(z=-7), rate=0.25) + p1000.aspirate(SMBVol / 2, SMB.bottom(z=1), rate=0.25) + p1000.dispense(SMBVol / 2, sample_plate_2[X].bottom(z=1), rate=0.25) + p1000.default_speed = 5 + p1000.move_to(sample_plate_2[X].bottom(z=5)) + for Mix in range(2): + p1000.aspirate(100, rate=0.5) + p1000.move_to(sample_plate_2[X].bottom(z=1)) + p1000.aspirate(80, rate=0.5) + p1000.dispense(80, rate=0.5) + p1000.move_to(sample_plate_2[X].bottom(z=5)) + p1000.dispense(100, rate=0.5) + Mix += 1 + p1000.blow_out(sample_plate_2[X].top(z=-7)) + p1000.default_speed = 400 + p1000.move_to(sample_plate_2[X].top(z=5)) + p1000.move_to(sample_plate_2[X].top(z=0)) + p1000.move_to(sample_plate_2[X].top(z=5)) + p1000.return_tip() if TIP_TRASH is False else p1000.drop_tip() + p200_tips += 1 + tipcheck() + # ============================== + helpers.set_hs_speed(protocol, heatershaker, SMBMixRPM, SMBMixRep, True) + + # GRIPPER MOVE sample_plate_2 FROM heatershaker TO MAGPLATE + helpers.move_labware_from_hs_to_destination( + protocol, sample_plate_2, heatershaker, MAG_PLATE_SLOT + ) + + thermocycler.open_lid() + if disposable_lid: + if trash_lid: + protocol.move_labware(lid_on_plate, trash_bin, use_gripper=True) + elif len(used_lids) <= 1: + protocol.move_labware(lid_on_plate, "B4", use_gripper=True) + else: + protocol.move_labware(lid_on_plate, used_lids[-2], use_gripper=True) + + if DRYRUN is False: + protocol.delay(minutes=2) + + protocol.comment("==============================================") + protocol.comment("--> WASH") + protocol.comment("==============================================") + # Setting Labware to Resume at Cleanup 1 + + protocol.comment("--> Remove SUPERNATANT") + for loop, X in enumerate(column_2_list): + p1000.pick_up_tip() + p1000.move_to(sample_plate_2[X].bottom(4)) + p1000.aspirate(200, rate=0.25) + trash_liquid(protocol, p1000, 200.0, liquid_trash_list) + p1000.move_to(sample_plate_2[X].bottom(0.5)) + p1000.aspirate(200, rate=0.25) + trash_liquid(protocol, p1000, 200.0, liquid_trash_list) + p1000.aspirate(20) + p1000.return_tip() if TIP_TRASH is False else p1000.drop_tip() + p200_tips += 1 + tipcheck() + + # GRIPPER MOVE sample_plate_2 FROM MAGPLATE TO heatershaker + helpers.move_labware_to_hs( + protocol, sample_plate_2, heatershaker, heatershaker + ) + + protocol.comment("--> Repeating 6 washes") + washreps = 6 + washcount = 0 + for wash in range(washreps): + + protocol.comment("--> Adding EEW") + EEWVol = 200 + for loop, X in enumerate(column_2_list): + p1000.pick_up_tip() + p1000.aspirate( + EEWVol, WASHES[loop].bottom(z=dot_bottom) + ) # original = () + p1000.dispense( + EEWVol, sample_plate_2[X].bottom(z=dot_bottom) + ) # original = () + p1000.return_tip() if TIP_TRASH is False else p1000.drop_tip() + p200_tips += 1 + tipcheck() + helpers.set_hs_speed( + protocol, heatershaker, int(heater_shaker_speed * 0.9), 4.0, True + ) + heatershaker.open_labware_latch() + + if DRYRUN is False: + protocol.delay(seconds=5 * 60) + + # GRIPPER MOVE sample_plate_2 FROM heatershaker TO MAGPLATE + helpers.move_labware_from_hs_to_destination( + protocol, sample_plate_2, heatershaker, MAG_PLATE_SLOT + ) + + if DRYRUN is False: + protocol.delay(seconds=1 * 60) + + protocol.comment("--> Removing Supernatant") + RemoveSup = 200 + for loop, X in enumerate(column_2_list): + p1000.pick_up_tip() + p1000.move_to(sample_plate_2[X].bottom(z=3.5)) + p1000.aspirate(RemoveSup - 100, rate=0.25) + protocol.delay(minutes=0.1) + p1000.move_to(sample_plate_2[X].bottom(z=0.5)) + p1000.aspirate(100, rate=0.25) + trash_liquid(protocol, p1000, RemoveSup, liquid_trash_list) + p1000.return_tip() if TIP_TRASH is False else p1000.drop_tip() + p200_tips += 1 + tipcheck() + + # ============================================================================================ + # GRIPPER MOVE sample_plate_2 FROM MAGPLATE TO heatershaker + helpers.move_labware_to_hs( + protocol, sample_plate_2, heatershaker, heatershaker + ) + washcount += 1 + + protocol.comment("--> Adding EEW") + EEWVol = 200 + for loop, X in enumerate(column_2_list): + p1000.pick_up_tip() + p1000.aspirate( + EEWVol, WASHES[loop].bottom(z=dot_bottom) + ) # original = () + p1000.dispense( + EEWVol, sample_plate_2[X].bottom(z=dot_bottom) + ) # original = () + p1000.return_tip() if TIP_TRASH is False else p1000.drop_tip() + p200_tips += 1 + tipcheck() + + helpers.set_hs_speed( + protocol, heatershaker, int(heater_shaker_speed * 0.9), 4.0, True + ) + + if DRYRUN is False: + protocol.delay(seconds=1 * 60) + + protocol.comment("--> Transfer Hybridization") + TransferSup = 200 + for loop, X in enumerate(column_2_list): + p1000.pick_up_tip() + p1000.move_to(sample_plate_2[X].bottom(z=0.5)) + p1000.aspirate(TransferSup, rate=0.25) + p1000.dispense( + TransferSup, sample_plate_2[column_3_list[loop]].bottom(z=1) + ) + p1000.return_tip() if TIP_TRASH is False else p1000.drop_tip() + p200_tips += 1 + tipcheck() + + if DRYRUN is False: + protocol.delay(seconds=5 * 60) + + # GRIPPER MOVE sample_plate_2 FROM heatershaker TO MAGPLATE + helpers.move_labware_from_hs_to_destination( + protocol, sample_plate_2, heatershaker, MAG_PLATE_SLOT + ) + if DRYRUN is False: + protocol.delay(seconds=1 * 60) + + protocol.comment("--> Removing Supernatant") + RemoveSup = 200 + for loop, X in enumerate(column_3_list): + p1000.pick_up_tip() + p1000.move_to(sample_plate_2[X].bottom(z=3.5)) + p1000.aspirate(RemoveSup - 100, rate=0.25) + protocol.delay(minutes=0.1) + p1000.move_to(sample_plate_2[X].bottom(z=0.5)) + p1000.aspirate(100, rate=0.25) + p1000.move_to(sample_plate_2[X].top(z=0.5)) + trash_liquid(protocol, p1000, 100, liquid_trash_list) + p1000.aspirate(20) + p1000.return_tip() if TIP_TRASH is False else p1000.drop_tip() + p200_tips += 1 + tipcheck() + + protocol.comment("--> Removing Residual") + for loop, X in enumerate(column_3_list): + p50.pick_up_tip() + p50.move_to(sample_plate_2[X].bottom(z=dot_bottom)) # original = z=0 + p50.aspirate(50, rate=0.25) + p50.default_speed = 200 + trash_liquid(protocol, p50, 50, liquid_trash_list) + p50.return_tip() if TIP_TRASH is False else p50.drop_tip() + p50_tips += 1 + tipcheck() + + protocol.comment("==============================================") + protocol.comment("--> ELUTE") + protocol.comment("==============================================") + + protocol.comment("--> Adding Elute") + EluteVol = 23 + for loop, X in enumerate(column_3_list): + p50.pick_up_tip() + p50.aspirate(EluteVol, Elute.bottom(z=dot_bottom)) # original = () + p50.dispense( + EluteVol, sample_plate_2[X].bottom(z=dot_bottom) + ) # original = () + p50.return_tip() if TIP_TRASH is False else p50.drop_tip() + p50_tips += 1 + tipcheck() + + # ============================================================================================ + # GRIPPER MOVE sample_plate_2 FROM MAGPLATE TO heatershaker + helpers.move_labware_to_hs( + protocol, sample_plate_2, heatershaker, heatershaker + ) + # ============================================================================================ + helpers.set_hs_speed( + protocol, heatershaker, int(heater_shaker_speed * 0.9), 2.0, True + ) + heatershaker.open_labware_latch() + + if DRYRUN is False: + protocol.delay(minutes=2) + + # ============================================================================================ + # GRIPPER MOVE sample_plate_2 FROM heatershaker TO MAGPLATE + helpers.move_labware_from_hs_to_destination( + protocol, sample_plate_2, heatershaker, MAG_PLATE_SLOT + ) + protocol.comment("--> Transfer Elution") + TransferSup = 21 + for loop, X in enumerate(column_3_list): + p50.pick_up_tip() + p50.move_to(sample_plate_2[X].bottom(z=0.5)) + p50.aspirate(TransferSup + 1, rate=0.25) + p50.dispense( + TransferSup + 1, sample_plate_1[column_4_list[loop]].bottom(z=1) + ) + p50.return_tip() if TIP_TRASH is False else p50.drop_tip() + p50_tips += 1 + tipcheck() + + protocol.comment("--> Adding ET2") + ET2Vol = 4 + ET2MixRep = 10 if DRYRUN is False else 1 + ET2MixVol = 20 + for loop, X in enumerate(column_4_list): + p50.pick_up_tip() + p50.aspirate(ET2Vol, ET2.bottom(z=dot_bottom)) # original = () + p50.dispense( + ET2Vol, sample_plate_1[X].bottom(z=dot_bottom) + ) # original = () + p50.move_to(sample_plate_1[X].bottom(z=dot_bottom)) # original = () + p50.mix(ET2MixRep, ET2MixVol) + p50.return_tip() if TIP_TRASH is False else p50.drop_tip() + p50_tips += 1 + tipcheck() + + if STEP_PCR == 1: + protocol.comment("==============================================") + protocol.comment("--> AMPLIFICATION") + protocol.comment("==============================================") + + protocol.comment("--> Adding PPC") + PPCVol = 5 + for loop, X in enumerate(column_4_list): + p50.pick_up_tip() + p50.aspirate(PPCVol, PPC.bottom(z=dot_bottom)) # original = () + p50.dispense( + PPCVol, sample_plate_1[X].bottom(z=dot_bottom) + ) # original = () + p50.return_tip() if TIP_TRASH is False else p50.drop_tip() + p50_tips += 1 + tipcheck() + + protocol.comment("--> Adding EPM") + EPMVol = 20 + EPMMixRep = 10 if DRYRUN is False else 1 + EPMMixVol = 45 + for loop, X in enumerate(column_4_list): + p50.pick_up_tip() + p50.aspirate(EPMVol, EPM.bottom(z=dot_bottom)) # original = () + p50.dispense( + EPMVol, sample_plate_1[X].bottom(z=dot_bottom) + ) # original = () + p50.move_to(sample_plate_1[X].bottom(z=dot_bottom)) # original = () + p50.mix(EPMMixRep, EPMMixVol) + p50.return_tip() if TIP_TRASH is False else p50.drop_tip() + p50_tips += 1 + tipcheck() + + if DRYRUN is False: + heatershaker.deactivate_heater() + + if STEP_PCRDECK == 1: + if DRYRUN is False: + if DRYRUN is False: + if disposable_lid: + ( + lid_on_plate, + unused_lids, + used_lids, + ) = helpers.use_disposable_lid_with_tc( + protocol, + unused_lids, + used_lids, + sample_plate_1, + thermocycler, + ) + else: + thermocycler.close_lid() + profile_PCR_1: List[ThermocyclerStep] = [ + {"temperature": 98, "hold_time_seconds": 45} + ] + thermocycler.execute_profile( + steps=profile_PCR_1, repetitions=1, block_max_volume=50 + ) + profile_PCR_2: List[ThermocyclerStep] = [ + {"temperature": 98, "hold_time_seconds": 30}, + {"temperature": 60, "hold_time_seconds": 30}, + {"temperature": 72, "hold_time_seconds": 30}, + ] + thermocycler.execute_profile( + steps=profile_PCR_2, repetitions=12, block_max_volume=50 + ) + profile_PCR_3: List[ThermocyclerStep] = [ + {"temperature": 72, "hold_time_minutes": 1} + ] + thermocycler.execute_profile( + steps=profile_PCR_3, repetitions=1, block_max_volume=50 + ) + thermocycler.set_block_temperature(10) + + thermocycler.open_lid() + if disposable_lid: + if trash_lid: + protocol.move_labware(lid_on_plate, trash_bin, use_gripper=True) + elif len(used_lids) <= 1: + protocol.move_labware(lid_on_plate, "B4", use_gripper=True) + else: + protocol.move_labware( + lid_on_plate, used_lids[-2], use_gripper=True + ) + + if STEP_CLEANUP == 1: + protocol.comment("==============================================") + protocol.comment("--> Cleanup") + protocol.comment("==============================================") + + # GRIPPER MOVE sample_plate_2 FROM MAGPLATE TO heatershaker + helpers.move_labware_to_hs( + protocol, sample_plate_2, heatershaker, heatershaker + ) + + protocol.comment("--> Transfer Elution") + TransferSup = 45 + for loop, X in enumerate(column_4_list): + p50.pick_up_tip() + p50.move_to(sample_plate_1[X].bottom(z=0.5)) + p50.aspirate(TransferSup + 1, rate=0.25) + p50.dispense( + TransferSup + 1, sample_plate_2[column_5_list[loop]].bottom(z=1) + ) + p50.return_tip() if TIP_TRASH is False else p50.drop_tip() + p50_tips += 1 + tipcheck() + + protocol.comment("--> ADDING AMPure (0.8x)") + AMPureVol = 40.5 + AMPureMixRep = 5.0 if DRYRUN is False else 0.1 + AMPurePremix = 3 if DRYRUN is False else 1 + # ========NEW SINGLE TIP DISPENSE=========== + for loop, X in enumerate(column_5_list): + p1000.pick_up_tip() + p1000.mix(AMPurePremix, AMPureVol + 10, AMPure.bottom(z=1)) + p1000.aspirate(AMPureVol, AMPure.bottom(z=1), rate=0.25) + p1000.dispense(AMPureVol, sample_plate_2[X].bottom(z=1), rate=0.25) + p1000.default_speed = 5 + p1000.move_to(sample_plate_2[X].bottom(z=5)) + for Mix in range(2): + p1000.aspirate(60, rate=0.5) + p1000.move_to(sample_plate_2[X].bottom(z=1)) + p1000.aspirate(60, rate=0.5) + p1000.dispense(60, rate=0.5) + p1000.move_to(sample_plate_2[X].bottom(z=5)) + p1000.dispense(30, rate=0.5) + Mix += 1 + p1000.blow_out(sample_plate_2[X].top(z=2)) + p1000.default_speed = 400 + p1000.move_to(sample_plate_2[X].top(z=5)) + p1000.move_to(sample_plate_2[X].top(z=0)) + p1000.move_to(sample_plate_2[X].top(z=5)) + p1000.return_tip() if TIP_TRASH is False else p1000.drop_tip() + p200_tips += 1 + tipcheck() + # ========NEW HS MIX========================= + helpers.set_hs_speed( + protocol, + heatershaker, + int(heater_shaker_speed * 0.9), + AMPureMixRep, + True, + ) + + # GRIPPER MOVE PLATE FROM HEATER SHAKER TO MAG PLATE + helpers.move_labware_from_hs_to_destination( + protocol, sample_plate_2, heatershaker, MAG_PLATE_SLOT + ) + + if DRYRUN is False: + protocol.delay(minutes=4) + + protocol.comment("--> Removing Supernatant") + RemoveSup = 200 + for loop, X in enumerate(column_5_list): + p1000.pick_up_tip() + p1000.move_to(sample_plate_2[X].bottom(z=3.5)) + p1000.aspirate(RemoveSup - 100, rate=0.25) + protocol.delay(minutes=0.1) + p1000.move_to(sample_plate_2[X].bottom(z=0.5)) + p1000.aspirate(100, rate=0.25) + p1000.default_speed = 5 + p1000.move_to(sample_plate_2[X].top(z=2)) + p1000.default_speed = 200 + trash_liquid(protocol, p1000, 200, liquid_trash_list) + p1000.return_tip() if TIP_TRASH is False else p1000.drop_tip() + p200_tips += 1 + tipcheck() + + for X_times in range(2): + protocol.comment("--> ETOH Wash") + ETOHMaxVol = 150 + for loop, X in enumerate(column_5_list): + p1000.pick_up_tip() + p1000.aspirate(ETOHMaxVol, EtOH.bottom(z=1)) + p1000.move_to(EtOH.top(z=0)) + p1000.move_to(EtOH.top(z=-5)) + p1000.move_to(EtOH.top(z=0)) + p1000.move_to(sample_plate_2[X].top(z=-2)) + p1000.dispense(ETOHMaxVol, rate=1) + protocol.delay(minutes=0.1) + p1000.blow_out() + p1000.move_to(sample_plate_2[X].top(z=5)) + p1000.move_to(sample_plate_2[X].top(z=0)) + p1000.move_to(sample_plate_2[X].top(z=5)) + p1000.return_tip() if TIP_TRASH is False else p1000.drop_tip() + p200_tips += 1 + tipcheck() + + if DRYRUN is False: + protocol.delay(minutes=0.5) + + protocol.comment("--> Remove ETOH Wash") + for loop, X in enumerate(column_5_list): + p1000.pick_up_tip() + p1000.move_to(sample_plate_2[X].bottom(z=3.5)) + p1000.aspirate(RemoveSup - 100, rate=0.25) + protocol.delay(minutes=0.1) + p1000.move_to(sample_plate_2[X].bottom(z=0.5)) + p1000.aspirate(100, rate=0.25) + p1000.default_speed = 5 + p1000.move_to(sample_plate_2[X].top(z=2)) + p1000.default_speed = 200 + trash_liquid(protocol, p1000, RemoveSup, liquid_trash_list) + p1000.return_tip() if TIP_TRASH is False else p1000.drop_tip() + p200_tips += 1 + tipcheck() + + if DRYRUN is False: + protocol.delay(minutes=2) + + protocol.comment("--> Removing Residual ETOH") + for loop, X in enumerate(column_5_list): + p1000.pick_up_tip() + p1000.move_to( + sample_plate_2[X].bottom(z=dot_bottom) + ) # original = (z=0) + p1000.aspirate(50, rate=0.25) + p1000.default_speed = 200 + trash_liquid(protocol, p1000, 50, liquid_trash_list) + p1000.return_tip() if TIP_TRASH is False else p1000.drop_tip() + p200_tips += 1 + tipcheck() + + if DRYRUN is False: + protocol.delay(minutes=1) + + # GRIPPER MOVE PLATE FROM MAG PLATE TO HEATER SHAKER + helpers.move_labware_to_hs( + protocol, sample_plate_2, heatershaker, heatershaker + ) + + protocol.comment("--> Adding RSB") + RSBVol = 32 + RSBMixRep = 1.0 if DRYRUN is False else 0.1 # minutes + for loop, X in enumerate(column_5_list): + p1000.pick_up_tip() + p1000.aspirate(RSBVol, RSB.bottom(z=1)) + + p1000.move_to( + ( + sample_plate_2.wells_by_name()[X] + .center() + .move(types.Point(x=1.3 * 0.8, y=0, z=-4)) + ) + ) + p1000.dispense(RSBVol, rate=1) + p1000.move_to(sample_plate_2.wells_by_name()[X].bottom(z=1)) + p1000.aspirate(RSBVol, rate=1) + p1000.move_to( + ( + sample_plate_2.wells_by_name()[X] + .center() + .move(types.Point(x=0, y=1.3 * 0.8, z=-4)) + ) + ) + p1000.dispense(RSBVol, rate=1) + p1000.move_to(sample_plate_2.wells_by_name()[X].bottom(z=1)) + p1000.aspirate(RSBVol, rate=1) + p1000.move_to( + ( + sample_plate_2.wells_by_name()[X] + .center() + .move(types.Point(x=1.3 * -0.8, y=0, z=-4)) + ) + ) + p1000.dispense(RSBVol, rate=1) + p1000.move_to(sample_plate_2.wells_by_name()[X].bottom(z=1)) + p1000.aspirate(RSBVol, rate=1) + p1000.move_to( + ( + sample_plate_2.wells_by_name()[X] + .center() + .move(types.Point(x=0, y=1.3 * -0.8, z=-4)) + ) + ) + p1000.dispense(RSBVol, rate=1) + p1000.move_to(sample_plate_2.wells_by_name()[X].bottom(z=1)) + p1000.aspirate(RSBVol, rate=1) + p1000.dispense(RSBVol, rate=1) + + p1000.blow_out(sample_plate_2.wells_by_name()[X].center()) + p1000.move_to(sample_plate_2.wells_by_name()[X].top(z=5)) + p1000.move_to(sample_plate_2.wells_by_name()[X].top(z=0)) + p1000.move_to(sample_plate_2.wells_by_name()[X].top(z=5)) + p1000.return_tip() if TIP_TRASH is False else p1000.drop_tip() + p200_tips += 1 + tipcheck() + if DRYRUN is False: + helpers.set_hs_speed( + protocol, + heatershaker, + int(heater_shaker_speed * 0.8), + RSBMixRep, + True, + ) + + # GRIPPER MOVE PLATE FROM HEATER SHAKER TO MAG PLATE + helpers.move_labware_from_hs_to_destination( + protocol, sample_plate_2, heatershaker, MAG_PLATE_SLOT + ) + + if DRYRUN is False: + protocol.delay(minutes=3) + + protocol.comment("--> Transferring Supernatant") + TransferSup = 30 + for loop, X in enumerate(column_5_list): + p1000.pick_up_tip() + p1000.move_to(sample_plate_2[X].bottom(z=0.5)) + p1000.aspirate(TransferSup + 1, rate=0.25) + p1000.dispense( + TransferSup + 1, sample_plate_1[column_6_list[loop]].bottom(z=1) + ) + p1000.return_tip() if TIP_TRASH is False else p1000.drop_tip() + p200_tips += 1 + tipcheck() + liquids_to_probe_at_end = [ + Liquid_trash_well_1, + Liquid_trash_well_2, + Liquid_trash_well_3, + Liquid_trash_well_4, + ] + helpers.find_liquid_height_of_all_wells(protocol, p50, liquids_to_probe_at_end) diff --git a/abr-testing/abr_testing/protocols/active_protocols/5_96ch complex protocol with single tip Pick Up.py b/abr-testing/abr_testing/protocols/active_protocols/5_96ch complex protocol with single tip Pick Up.py index dc40db7f177..e37199c7c60 100644 --- a/abr-testing/abr_testing/protocols/active_protocols/5_96ch complex protocol with single tip Pick Up.py +++ b/abr-testing/abr_testing/protocols/active_protocols/5_96ch complex protocol with single tip Pick Up.py @@ -1,14 +1,14 @@ """96 ch Test Single Tip and Gripper Moves.""" from opentrons.protocol_api import ( - ALL, + COLUMN, SINGLE, + ALL, ParameterContext, ProtocolContext, Labware, ) from opentrons.protocol_api.module_contexts import ( HeaterShakerContext, - MagneticBlockContext, ThermocyclerContext, TemperatureModuleContext, ) @@ -57,13 +57,12 @@ def run(ctx: ProtocolContext) -> None: waste_chute = ctx.load_waste_chute() thermocycler: ThermocyclerContext = ctx.load_module(helpers.tc_str) # type: ignore[assignment] - mag: MagneticBlockContext = ctx.load_module(helpers.mag_str, "A3") # type: ignore[assignment] h_s: HeaterShakerContext = ctx.load_module(helpers.hs_str, "D1") # type: ignore[assignment] temperature_module: TemperatureModuleContext = ctx.load_module( helpers.temp_str, "C1" ) # type: ignore[assignment] if disposable_lid: - unused_lids = helpers.load_disposable_lids(ctx, 3, ["A4"], deck_riser) + unused_lids = helpers.load_disposable_lids(ctx, 3, ["A2"], deck_riser) used_lids: List[Labware] = [] thermocycler.open_lid() h_s.open_labware_latch() @@ -77,12 +76,11 @@ def run(ctx: ProtocolContext) -> None: source_reservoir = ctx.load_labware(RESERVOIR_NAME, "D2") dest_pcr_plate = ctx.load_labware(PCR_PLATE_96_NAME, "C2") + liquid_waste = ctx.load_labware("nest_1_reservoir_195ml", "B2", "Liquid Waste") tip_rack_1 = ctx.load_labware( - TIPRACK_96_NAME, "A2", adapter=TIPRACK_96_ADAPTER_NAME + TIPRACK_96_NAME, "A3", adapter="opentrons_flex_96_tiprack_adapter" ) - tip_rack_adapter = tip_rack_1.parent - tip_rack_2 = ctx.load_labware(TIPRACK_96_NAME, "C3") tip_rack_3 = ctx.load_labware(TIPRACK_96_NAME, "C4") @@ -161,14 +159,13 @@ def test_gripper_moves() -> None: def deck_moves(labware: Labware, reset_location: str) -> None: """Function to perform the movement of labware.""" deck_move_sequence = [ - ["B2"], # Deck Moves + ["B3"], # Deck Moves ["C3"], # Staging Area Slot 3 Moves ["C4", "D4"], # Staging Area Slot 4 Moves [ thermocycler, temperature_module_adapter, h_s_adapter, - mag, ], # Module Moves ] @@ -177,14 +174,13 @@ def deck_moves(labware: Labware, reset_location: str) -> None: def staging_area_slot_3_moves(labware: Labware, reset_location: str) -> None: """Function to perform the movement of labware, starting w/ staging area slot 3.""" staging_area_slot_3_move_sequence = [ - ["B2", "C2"], # Deck Moves + ["B3", "C2"], # Deck Moves [], # Don't have Staging Area Slot 3 open ["C4", "D4"], # Staging Area Slot 4 Moves [ thermocycler, temperature_module_adapter, h_s_adapter, - mag, ], # Module Moves ] @@ -198,14 +194,13 @@ def staging_area_slot_3_moves(labware: Labware, reset_location: str) -> None: def staging_area_slot_4_moves(labware: Labware, reset_location: str) -> None: """Function to perform the movement of labware, starting with staging area slot 4.""" staging_area_slot_4_move_sequence = [ - ["C2", "B2"], # Deck Moves + ["C2", "B3"], # Deck Moves ["C3"], # Staging Area Slot 3 Moves ["C4"], # Staging Area Slot 4 Moves [ thermocycler, temperature_module_adapter, h_s_adapter, - mag, ], # Module Moves ] @@ -219,7 +214,7 @@ def staging_area_slot_4_moves(labware: Labware, reset_location: str) -> None: def module_moves(labware: Labware, module_locations: List) -> None: """Function to perform the movement of labware, starting on a module.""" module_move_sequence = [ - ["C2", "B2"], # Deck Moves + ["C2", "B3"], # Deck Moves ["C3"], # Staging Area Slot 3 Moves ["C4", "D4"], # Staging Area Slot 4 Moves ] @@ -256,7 +251,7 @@ def module_moves(labware: Labware, module_locations: List) -> None: ) staging_area_slot_4_moves(dest_pcr_plate, STAGING_AREA_SLOT_4_RESET_LOCATION) - module_locations = [thermocycler, mag] + adapters + module_locations = [thermocycler] + adapters module_moves(dest_pcr_plate, module_locations) ctx.move_labware(dest_pcr_plate, thermocycler, use_gripper=USING_GRIPPER) @@ -279,64 +274,59 @@ def test_single_tip_pickup_usage() -> None: well_position = f"{row}{col}" pipette_96_channel.pick_up_tip(tip_rack_2) - pipette_96_channel.aspirate(5, source_reservoir[well_position]) - pipette_96_channel.touch_tip() + pipette_96_channel.aspirate(45, source_reservoir[well_position]) + pipette_96_channel.air_gap(5) pipette_96_channel.dispense( - 5, dest_pcr_plate[well_position].bottom(b) + 25, dest_pcr_plate[well_position].bottom(b) ) + pipette_96_channel.blow_out(location=liquid_waste["A1"]) pipette_96_channel.drop_tip() tip_count += 1 # leave this dropping in waste chute, do not use get_disposal_preference # want to test partial drop ctx.move_labware(tip_rack_2, waste_chute, use_gripper=USING_GRIPPER) + def test_column_tip_rack_usage() -> None: + """Column Tip Pick Up.""" + list_of_columns = list(range(1, 13)) + pipette_96_channel.configure_nozzle_layout( + style=COLUMN, start="A12", tip_racks=[tip_rack_3] + ) + ctx.comment("------------------------------") + ctx.comment(f"channels {pipette_96_channel.active_channels}") + ctx.move_labware(tip_rack_3, "C3", use_gripper=USING_GRIPPER) + for well in list_of_columns: + tiprack_well = "A" + str(well) + well_name = "A" + str(well) + pipette_96_channel.liquid_presence_detection = True + pipette_96_channel.pick_up_tip(tip_rack_3[tiprack_well]) + pipette_96_channel.aspirate(45, source_reservoir[well_name]) + pipette_96_channel.liquid_presence_detection = False + pipette_96_channel.air_gap(5) + pipette_96_channel.dispense(25, dest_pcr_plate[tiprack_well].bottom(b)) + pipette_96_channel.blow_out(location=liquid_waste["A1"]) + pipette_96_channel.drop_tip() + ctx.move_labware(tip_rack_3, waste_chute, use_gripper=USING_GRIPPER) + def test_full_tip_rack_usage() -> None: """Full Tip Pick Up.""" - pipette_96_channel.configure_nozzle_layout(style=ALL, start="A1") + pipette_96_channel.configure_nozzle_layout( + style=ALL, tip_racks=[tip_rack_1] + ) + ctx.comment(f"channels {pipette_96_channel.active_channels}") pipette_96_channel.liquid_presence_detection = True - pipette_96_channel.pick_up_tip(tip_rack_1["A1"]) - - pipette_96_channel.aspirate(5, source_reservoir["A1"]) - pipette_96_channel.touch_tip() - + pipette_96_channel.pick_up_tip() + pipette_96_channel.aspirate(45, source_reservoir["A1"]) pipette_96_channel.liquid_presence_detection = False - pipette_96_channel.air_gap(height=30) - pipette_96_channel.blow_out(waste_chute) - - pipette_96_channel.aspirate(5, source_reservoir["A1"]) - pipette_96_channel.touch_tip() - - pipette_96_channel.air_gap(height=30) - pipette_96_channel.blow_out() - - pipette_96_channel.aspirate(10, source_reservoir["A1"]) - pipette_96_channel.touch_tip() - - pipette_96_channel.dispense(10, dest_pcr_plate["A1"].bottom(b)) - pipette_96_channel.mix(repetitions=5, volume=15) - pipette_96_channel.return_tip() - - ctx.move_labware(tip_rack_1, waste_chute, use_gripper=USING_GRIPPER) - ctx.move_labware(tip_rack_3, tip_rack_adapter, use_gripper=USING_GRIPPER) - - pipette_96_channel.pick_up_tip(tip_rack_3["A1"]) - pipette_96_channel.transfer( - volume=10, - source=source_reservoir["A1"], - dest=dest_pcr_plate["A1"], - new_tip="never", - touch_tip=True, - blow_out=True, - blowout_location="trash", - mix_before=(3, 5), - mix_after=(1, 5), - ) + pipette_96_channel.air_gap(5) + pipette_96_channel.dispense(25, dest_pcr_plate["A1"].bottom(b)) + pipette_96_channel.blow_out(location=liquid_waste["A1"]) pipette_96_channel.return_tip() - - ctx.move_labware(tip_rack_3, waste_chute, use_gripper=USING_GRIPPER) + pipette_96_channel.reset_tipracks() test_single_tip_pickup_usage() + test_column_tip_rack_usage() test_full_tip_rack_usage() def test_module_usage(unused_lids: List[Labware], used_lids: List[Labware]) -> None: @@ -374,7 +364,7 @@ def test_thermocycler( thermocycler.open_lid() if disposable_lid: if len(used_lids) <= 1: - ctx.move_labware(lid_on_plate, "B3", use_gripper=True) + ctx.move_labware(lid_on_plate, waste_chute, use_gripper=True) else: ctx.move_labware(lid_on_plate, used_lids[-2], use_gripper=True) thermocycler.deactivate() @@ -397,16 +387,18 @@ def test_temperature_module() -> None: temperature_module.set_temperature(10) temperature_module.deactivate() - def test_mag() -> None: - """Tests magnetic block.""" - pass - test_thermocycler(unused_lids, used_lids) test_h_s() test_temperature_module() - test_mag() test_pipetting() test_gripper_moves() test_module_usage(unused_lids, used_lids) test_manual_moves() + ctx.move_labware(source_reservoir, "C2", use_gripper=True) + helpers.clean_up_plates( + pipette_96_channel, [dest_pcr_plate, source_reservoir], liquid_waste["A1"], 50 + ) + helpers.find_liquid_height_of_all_wells( + ctx, pipette_96_channel, [liquid_waste["A1"]] + ) diff --git a/abr-testing/abr_testing/protocols/active_protocols/6_Omega_HDQ_DNA_Cells-Flex_96_channel.py b/abr-testing/abr_testing/protocols/active_protocols/6_Omega_HDQ_DNA_Cells-Flex_96_channel.py new file mode 100644 index 00000000000..89f643729fb --- /dev/null +++ b/abr-testing/abr_testing/protocols/active_protocols/6_Omega_HDQ_DNA_Cells-Flex_96_channel.py @@ -0,0 +1,351 @@ +"""Omega Bio-tek Mag-Bind Blood & Tissue DNA HDQ - Bacteria.""" +from typing import List, Dict +from abr_testing.protocols import helpers +from opentrons.protocol_api import ( + ProtocolContext, + ParameterContext, + Well, + InstrumentContext, +) +from opentrons.protocol_api.module_contexts import ( + HeaterShakerContext, + MagneticBlockContext, + TemperatureModuleContext, +) +from opentrons import types +import numpy as np + +metadata = { + "author": "Zach Galluzzo ", + "protocolName": "Omega Bio-tek Mag-Bind Blood & Tissue DNA HDQ - Bacteria", +} + +requirements = { + "robotType": "Flex", + "apiLevel": "2.21", +} + + +def add_parameters(parameters: ParameterContext) -> None: + """Parameters.""" + helpers.create_dot_bottom_parameter(parameters) + + +# Start protocol +def run(ctx: ProtocolContext) -> None: + """Protocol.""" + dot_bottom = ctx.params.dot_bottom # type: ignore[attr-defined] + + dry_run = False + tip_mixing = False + + wash_vol = 600.0 + AL_vol = 230.0 + bind_vol = 320.0 + sample_vol = 180.0 + elution_vol = 100.0 + + # Same for all HDQ Extractions + deepwell_type = "nest_96_wellplate_2ml_deep" + if not dry_run: + settling_time = 2.0 + num_washes = 3 + if dry_run: + settling_time = 0.5 + num_washes = 1 + bead_vol = PK_vol = 20.0 + inc_temp = 55.0 + AL_total_vol = AL_vol + PK_vol + binding_buffer_vol = bead_vol + bind_vol + starting_vol = AL_total_vol + sample_vol + + h_s: HeaterShakerContext = ctx.load_module(helpers.hs_str, "D1") # type: ignore[assignment] + sample_plate, h_s_adapter = helpers.load_hs_adapter_and_labware( + deepwell_type, h_s, "Sample Plate" + ) + h_s.close_labware_latch() + samples_m = sample_plate.wells()[0] + + # NOTE: MAG BLOCK will be on slot 6 + + temp: TemperatureModuleContext = ctx.load_module( + helpers.temp_str, "A3" + ) # type: ignore[assignment] + elutionplate, tempblock = helpers.load_temp_adapter_and_labware( + "armadillo_96_wellplate_200ul_pcr_full_skirt", temp, "Elution Plate/Reservoir" + ) + + magblock: MagneticBlockContext = ctx.load_module( + "magneticBlockV1", "C1" + ) # type: ignore[assignment] + liquid_waste = ctx.load_labware("nest_1_reservoir_195ml", "B3", "Liquid Waste") + waste = liquid_waste.wells()[0].top() + + lysis_reservoir = ctx.load_labware(deepwell_type, "D2", "Lysis reservoir") + lysis_res = lysis_reservoir.wells()[0] + bind_reservoir = ctx.load_labware( + deepwell_type, "C2", "Beads and binding reservoir" + ) + bind_res = bind_reservoir.wells()[0] + wash1_reservoir = ctx.load_labware(deepwell_type, "C3", "Wash 1 reservoir") + wash1_res = wash1_reservoir.wells()[0] + wash2_reservoir = ctx.load_labware(deepwell_type, "B1", "Wash 2 reservoir") + wash2_res = wash2_reservoir.wells()[0] + elution_res = elutionplate.wells()[0] + # Load Pipette and tip racks + # Load tips + tiprack_1 = ctx.load_labware( + "opentrons_flex_96_tiprack_1000ul", + "A1", + adapter="opentrons_flex_96_tiprack_adapter", + ) + tips = tiprack_1.wells()[0] + + tiprack_2 = ctx.load_labware( + "opentrons_flex_96_tiprack_1000ul", + "A2", + adapter="opentrons_flex_96_tiprack_adapter", + ) + tips1 = tiprack_2.wells()[0] + # load 96 channel pipette + pip: InstrumentContext = ctx.load_instrument( + "flex_96channel_1000", mount="left", tip_racks=[tiprack_1, tiprack_2] + ) + # Load Liquids and probe + liquid_vols_and_wells: Dict[str, List[Dict[str, Well | List[Well] | float]]] = { + "Lysis Buffer": [{"well": lysis_reservoir.wells(), "volume": AL_vol + 92.0}], + "PK Buffer": [{"well": lysis_reservoir.wells(), "volume": PK_vol + 8.0}], + "Binding Buffer": [{"well": bind_reservoir.wells(), "volume": bind_vol + 91.5}], + "Magnetic Beads": [{"well": bind_reservoir.wells(), "volume": bead_vol + 8.5}], + "Wash 1 and 2 Buffer": [ + {"well": wash1_reservoir.wells(), "volume": (wash_vol * 2.0) + 100.0} + ], + "Wash 3 Buffer": [ + {"well": wash2_reservoir.wells(), "volume": wash_vol + 100.0} + ], + "Elution Buffer": [{"well": elutionplate.wells(), "volume": elution_vol + 5}], + "Samples": [{"well": sample_plate.wells(), "volume": sample_vol}], + } + + helpers.find_liquid_height_of_loaded_liquids(ctx, liquid_vols_and_wells, pip) + + pip.flow_rate.aspirate = 50 + pip.flow_rate.dispense = 150 + pip.flow_rate.blow_out = 300 + + def resuspend_pellet(vol: float, plate: Well, reps: int = 3) -> None: + """Re-suspend pellets.""" + pip.flow_rate.aspirate = 200 + pip.flow_rate.dispense = 300 + + loc1 = plate.bottom().move(types.Point(x=1, y=0, z=1)) + loc2 = plate.bottom().move(types.Point(x=0.75, y=0.75, z=1)) + loc3 = plate.bottom().move(types.Point(x=0, y=1, z=1)) + loc4 = plate.bottom().move(types.Point(x=-0.75, y=0.75, z=1)) + loc5 = plate.bottom().move(types.Point(x=-1, y=0, z=1)) + loc6 = plate.bottom().move(types.Point(x=-0.75, y=0 - 0.75, z=1)) + loc7 = plate.bottom().move(types.Point(x=0, y=-1, z=1)) + loc8 = plate.bottom().move(types.Point(x=0.75, y=-0.75, z=1)) + + if vol > 1000: + vol = 1000 + + mixvol = vol * 0.9 + + for _ in range(reps): + pip.aspirate(mixvol, loc1) + pip.dispense(mixvol, loc1) + pip.aspirate(mixvol, loc2) + pip.dispense(mixvol, loc2) + pip.aspirate(mixvol, loc3) + pip.dispense(mixvol, loc3) + pip.aspirate(mixvol, loc4) + pip.dispense(mixvol, loc4) + pip.aspirate(mixvol, loc5) + pip.dispense(mixvol, loc5) + pip.aspirate(mixvol, loc6) + pip.dispense(mixvol, loc6) + pip.aspirate(mixvol, loc7) + pip.dispense(mixvol, loc7) + pip.aspirate(mixvol, loc8) + pip.dispense(mixvol, loc8) + if _ == reps - 1: + pip.flow_rate.aspirate = 50 + pip.flow_rate.dispense = 30 + pip.aspirate(mixvol, loc8) + pip.dispense(mixvol, loc8) + + pip.flow_rate.aspirate = 150 + pip.flow_rate.dispense = 200 + + def bead_mix(vol: float, plate: Well, reps: int = 5) -> None: + """Bead mix.""" + pip.flow_rate.aspirate = 200 + pip.flow_rate.dispense = 300 + + loc1 = plate.bottom().move(types.Point(x=0, y=0, z=1)) + loc2 = plate.bottom().move(types.Point(x=0, y=0, z=8)) + loc3 = plate.bottom().move(types.Point(x=0, y=0, z=16)) + loc4 = plate.bottom().move(types.Point(x=0, y=0, z=24)) + + if vol > 1000: + vol = 1000 + + mixvol = vol * 0.9 + + for _ in range(reps): + pip.aspirate(mixvol, loc1) + pip.dispense(mixvol, loc1) + pip.aspirate(mixvol, loc1) + pip.dispense(mixvol, loc2) + pip.aspirate(mixvol, loc1) + pip.dispense(mixvol, loc3) + pip.aspirate(mixvol, loc1) + pip.dispense(mixvol, loc4) + if _ == reps - 1: + pip.flow_rate.aspirate = 50 + pip.flow_rate.dispense = 30 + pip.aspirate(mixvol, loc1) + pip.dispense(mixvol, loc1) + + pip.flow_rate.aspirate = 150 + pip.flow_rate.dispense = 200 + + # Start Protocol + temp.set_temperature(inc_temp) + # Transfer and mix lysis + pip.pick_up_tip(tips) + pip.aspirate(AL_total_vol, lysis_res) + pip.dispense(AL_total_vol, samples_m) + resuspend_pellet(400, samples_m, reps=4 if not dry_run else 1) + if not tip_mixing: + pip.return_tip() + + # Mix, then heat + ctx.comment("Lysis Mixing") + helpers.set_hs_speed(ctx, h_s, 1800, 10, False) + if not dry_run: + h_s.set_and_wait_for_temperature(55) + ctx.delay( + minutes=10 if not dry_run else 0.25, + msg="Please allow another 10 minutes of 55C incubation to complete lysis.", + ) + h_s.deactivate_shaker() + + # Transfer and mix bind&beads + pip.pick_up_tip(tips) + bead_mix(binding_buffer_vol, bind_res, reps=4 if not dry_run else 1) + pip.aspirate(binding_buffer_vol, bind_res) + pip.dispense(binding_buffer_vol, samples_m) + bead_mix(binding_buffer_vol + starting_vol, samples_m, reps=4 if not dry_run else 1) + if not tip_mixing: + pip.return_tip() + pip.home() + + # Shake for binding incubation + ctx.comment("Binding incubation") + helpers.set_hs_speed(ctx, h_s, 1800, 10, True) + + # Transfer plate to magnet + helpers.move_labware_from_hs_to_destination(ctx, sample_plate, h_s, magblock) + + ctx.delay( + minutes=settling_time, + msg="Please wait " + str(settling_time) + " minute(s) for beads to pellet.", + ) + + # Remove Supernatant and move off magnet + pip.pick_up_tip(tips) + pip.aspirate(1000, samples_m.bottom(dot_bottom)) + pip.dispense(1000, waste) + if starting_vol + binding_buffer_vol > 1000: + pip.aspirate(1000, samples_m.bottom(dot_bottom)) + pip.dispense(1000, waste) + pip.return_tip() + + # Transfer plate from magnet to H/S + helpers.move_labware_to_hs(ctx, sample_plate, h_s, h_s_adapter) + + # Washes + for i in range(num_washes if not dry_run else 1): + if i == 0 or i == 1: + wash_res = wash1_res + else: + wash_res = wash2_res + + pip.pick_up_tip(tips) + pip.aspirate(wash_vol, wash_res) + pip.dispense(wash_vol, samples_m) + if not tip_mixing: + pip.return_tip() + helpers.set_hs_speed(ctx, h_s, 1800, 5, True) + + # Transfer plate to magnet + helpers.move_labware_from_hs_to_destination(ctx, sample_plate, h_s, magblock) + + ctx.delay( + minutes=settling_time, + msg="Please wait " + str(settling_time) + " minute(s) for beads to pellet.", + ) + + # Remove Supernatant and move off magnet + pip.pick_up_tip(tips) + pip.aspirate(1000, samples_m.bottom(dot_bottom)) + pip.dispense(1000, bind_res.top()) + if wash_vol > 1000: + pip.aspirate(1000, samples_m.bottom(dot_bottom)) + pip.dispense(1000, bind_res.top()) + pip.return_tip() + + # Transfer plate from magnet to H/S + helpers.move_labware_to_hs(ctx, sample_plate, h_s, h_s_adapter) + + # Dry beads + if dry_run: + drybeads = 0.5 + else: + drybeads = 10 + # Number of minutes you want to dry for + for beaddry in np.arange(drybeads, 0, -0.5): + ctx.delay( + minutes=0.5, + msg="There are " + str(beaddry) + " minutes left in the drying step.", + ) + + # Elution + pip.pick_up_tip(tips1) + pip.aspirate(elution_vol, elution_res) + pip.dispense(elution_vol, samples_m) + resuspend_pellet(elution_vol, samples_m, reps=3 if not dry_run else 1) + if not tip_mixing: + pip.return_tip() + pip.home() + + helpers.set_hs_speed(ctx, h_s, 2000, 5, True) + + # Transfer plate to magnet + helpers.move_labware_from_hs_to_destination(ctx, sample_plate, h_s, magblock) + + ctx.delay( + minutes=settling_time, + msg="Please wait " + str(settling_time) + " minute(s) for beads to pellet.", + ) + + pip.pick_up_tip(tips1) + pip.aspirate(elution_vol, samples_m) + pip.dispense(elution_vol, elutionplate.wells()[0]) + pip.return_tip() + + pip.home() + pip.reset_tipracks() + + # Empty Plates + pip.pick_up_tip() + pip.aspirate(1000, samples_m) + pip.dispense(1000, liquid_waste["A1"].top()) + pip.aspirate(1000, wash1_res) + pip.dispense(1000, liquid_waste["A1"].top()) + pip.aspirate(1000, wash2_res) + pip.dispense(1000, liquid_waste["A1"].top()) + pip.return_tip() + helpers.find_liquid_height_of_all_wells(ctx, pip, [liquid_waste["A1"]]) diff --git a/abr-testing/abr_testing/protocols/active_protocols/7_HDQ_DNA_Bacteria_Flex.py b/abr-testing/abr_testing/protocols/active_protocols/7_HDQ_DNA_Bacteria_Flex.py index aa33079f553..ec84da47b0c 100644 --- a/abr-testing/abr_testing/protocols/active_protocols/7_HDQ_DNA_Bacteria_Flex.py +++ b/abr-testing/abr_testing/protocols/active_protocols/7_HDQ_DNA_Bacteria_Flex.py @@ -68,7 +68,7 @@ def run(ctx: ProtocolContext) -> None: TIP_TRASH = False res_type = "nest_12_reservoir_22ml" - num_samples = 8 + num_samples = 48 wash1_vol = 600.0 wash2_vol = 600.0 wash3_vol = 600.0 @@ -170,7 +170,6 @@ def tiptrack(tipbox: List[Well]) -> None: drop_count = drop_count + 8 if drop_count >= 150: drop_count = 0 - ctx.pause("Empty Waste Bin.") def remove_supernatant(vol: float) -> None: """Remove supernatants.""" @@ -303,7 +302,6 @@ def A_lysis(vol: float, source: Well) -> None: m1000.require_liquid_presence(src) m1000.aspirate(tvol, src.bottom(1)) m1000.dispense(tvol, src.bottom(4)) - m1000.require_liquid_presence(src) m1000.aspirate(tvol, src.bottom(height)) m1000.air_gap(10) m1000.dispense(m1000.current_volume, samples_m[i].top()) @@ -504,7 +502,5 @@ def elute(vol: float) -> None: # Probe wells end_wells_with_liquid = [ waste_reservoir.wells()[0], - res1.wells()[0], - elutionplate.wells()[0], ] helpers.find_liquid_height_of_all_wells(ctx, m1000, end_wells_with_liquid) diff --git a/abr-testing/abr_testing/protocols/active_protocols/8_Illumina and Plate Reader.py b/abr-testing/abr_testing/protocols/active_protocols/8_Illumina and Plate Reader.py index 4894cae41d4..d64866ca968 100644 --- a/abr-testing/abr_testing/protocols/active_protocols/8_Illumina and Plate Reader.py +++ b/abr-testing/abr_testing/protocols/active_protocols/8_Illumina and Plate Reader.py @@ -1,5 +1,11 @@ """Illumina DNA Prep and Plate Reader Test.""" -from opentrons.protocol_api import ParameterContext, ProtocolContext, Labware +from opentrons.protocol_api import ( + ParameterContext, + ProtocolContext, + Labware, + Well, + InstrumentContext, +) from abr_testing.protocols import helpers from opentrons.protocol_api.module_contexts import ( AbsorbanceReaderContext, @@ -10,9 +16,10 @@ ) from datetime import datetime from opentrons.hardware_control.modules.types import ThermocyclerStep -from typing import List +from typing import List, Dict from opentrons import types + metadata = { "protocolName": "Illumina DNA Prep and Plate Reader Test", "author": "Platform Expansion", @@ -31,7 +38,7 @@ HYBRID_PAUSE = True # True = sets a pause on the Hybridization # PROTOCOL SETTINGS -COLUMNS = 3 # 1-3 +COLUMNS = 4 # 1-4 HYBRIDDECK = True HYBRIDTIME = 1.6 # Hours @@ -115,7 +122,9 @@ def run(protocol: ProtocolContext) -> None: tiprack_50_2 = protocol.load_labware("opentrons_flex_96_tiprack_50ul", "A3") # MODULES + LABWARE # Reservoir - reservoir = protocol.load_labware("nest_96_wellplate_2ml_deep", "D2") + reservoir = protocol.load_labware( + "nest_96_wellplate_2ml_deep", "D2", "Liquid Waste" + ) # Heatershaker heatershaker: HeaterShakerContext = protocol.load_module( helpers.hs_str, "D1" @@ -123,6 +132,7 @@ def run(protocol: ProtocolContext) -> None: sample_plate_2 = heatershaker.load_labware( "thermoscientificnunc_96_wellplate_1300ul" ) + heatershaker.close_labware_latch() # Magnetic Block mag_block: MagneticBlockContext = protocol.load_module( helpers.mag_str, "C1" @@ -133,6 +143,7 @@ def run(protocol: ProtocolContext) -> None: sample_plate_1 = thermocycler.load_labware( "armadillo_96_wellplate_200ul_pcr_full_skirt" ) + thermocycler.open_lid() # Temperature Module temp_block: TemperatureModuleContext = protocol.load_module( helpers.temp_str, "B3" @@ -154,6 +165,28 @@ def run(protocol: ProtocolContext) -> None: p50 = protocol.load_instrument( "flex_8channel_50", "right", tip_racks=[tiprack_50_1, tiprack_50_2] ) + + # Load liquids and probe + liquid_vols_and_wells: Dict[str, List[Dict[str, Well | List[Well] | float]]] = { + "Reagents": [ + {"well": reagent_plate.columns()[3], "volume": 75.0}, + {"well": reagent_plate.columns()[4], "volume": 15.0}, + {"well": reagent_plate.columns()[5], "volume": 20.0}, + {"well": reagent_plate.columns()[6], "volume": 65.0}, + ], + "AMPure": [{"well": reservoir.columns()[0], "volume": 120.0}], + "SMB": [{"well": reservoir.columns()[1], "volume": 750.0}], + "EtOH": [{"well": reservoir.columns()[3], "volume": 900.0}], + "RSB": [{"well": reservoir.columns()[4], "volume": 96.0}], + "Wash": [ + {"well": sample_plate_2.columns()[9], "volume": 1000.0}, + {"well": sample_plate_2.columns()[10], "volume": 1000.0}, + {"well": sample_plate_2.columns()[11], "volume": 1000.0}, + ], + "Samples": [{"well": sample_plate_1.wells(), "volume": 150.0}], + } + helpers.find_liquid_height_of_loaded_liquids(protocol, liquid_vols_and_wells, p50) + # reagent AMPure = reservoir["A1"] SMB = reservoir["A2"] @@ -165,11 +198,42 @@ def run(protocol: ProtocolContext) -> None: Liquid_trash_well_2 = reservoir["A10"] Liquid_trash_well_3 = reservoir["A11"] Liquid_trash_well_4 = reservoir["A12"] + liquid_trash_list = { + Liquid_trash_well_1: 0.0, + Liquid_trash_well_2: 0.0, + Liquid_trash_well_3: 0.0, + Liquid_trash_well_4: 0.0, + } + + def trash_liquid( + protocol: ProtocolContext, + pipette: InstrumentContext, + vol_to_trash: float, + liquid_trash_list: Dict[Well, float], + ) -> None: + """Determine which wells to use as liquid waste.""" + remaining_volume = vol_to_trash + max_capacity = 1500.0 + # Determine liquid waste location depending on current total volume + # Distribute the liquid volume sequentially + for well, current_volume in liquid_trash_list.items(): + if remaining_volume <= 0.0: + break + available_capacity = max_capacity - current_volume + if available_capacity < remaining_volume: + continue + pipette.dispense(remaining_volume, well.top()) + protocol.delay(minutes=0.1) + pipette.blow_out(well.top()) + liquid_trash_list[well] += remaining_volume + if pipette.current_volume <= 0.0: + break # Will Be distributed during the protocol - EEW_1 = sample_plate_2.wells_by_name()["A10"] - EEW_2 = sample_plate_2.wells_by_name()["A11"] - EEW_3 = sample_plate_2.wells_by_name()["A12"] + EEW_1 = sample_plate_2.wells_by_name()["A9"] + EEW_2 = sample_plate_2.wells_by_name()["A10"] + EEW_3 = sample_plate_2.wells_by_name()["A11"] + EEW_4 = sample_plate_2.wells_by_name()["A12"] NHB2 = reagent_plate.wells_by_name()["A1"] Panel = reagent_plate.wells_by_name()["A2"] @@ -206,6 +270,14 @@ def run(protocol: ProtocolContext) -> None: column_5_list = ["A7", "A8", "A9"] # Plate 2 column_6_list = ["A7", "A8", "A9"] # Plate 1 WASHES = [EEW_1, EEW_2, EEW_3] + if COLUMNS == 4: + column_1_list = ["A1", "A2", "A3", "A4"] # Plate 1 + column_2_list = ["A1", "A2", "A3", "A4"] # Plate 2 + column_3_list = ["A5", "A6", "A7", "A8"] # Plate 2 + column_4_list = ["A5", "A6", "A7", "A8"] # Plate 1 + column_5_list = ["A9", "A10", "A11", "A12"] # Plate 2 + column_6_list = ["A9", "A10", "A11", "A12"] # Plate 1 + WASHES = [EEW_1, EEW_2, EEW_3, EEW_4] def tipcheck() -> None: """Check tips.""" @@ -231,9 +303,7 @@ def tipcheck() -> None: thermocycler.set_block_temperature(58) thermocycler.set_lid_temperature(58) heatershaker.set_and_wait_for_temperature(58) - protocol.pause("Ready") heatershaker.close_labware_latch() - Liquid_trash = Liquid_trash_well_1 # Sample Plate contains 30ul of DNA @@ -409,20 +479,14 @@ def tipcheck() -> None: p1000.pick_up_tip() p1000.move_to(sample_plate_2[X].bottom(4)) p1000.aspirate(200, rate=0.25) - p1000.dispense(200, Liquid_trash.top(z=-7)) + trash_liquid(protocol, p1000, 200, liquid_trash_list) p1000.move_to(sample_plate_2[X].bottom(0.5)) p1000.aspirate(200, rate=0.25) - p1000.dispense(200, Liquid_trash.top(z=-7)) - p1000.move_to(Liquid_trash.top(z=-7)) - protocol.delay(minutes=0.1) - p1000.blow_out(Liquid_trash.top(z=-7)) - p1000.aspirate(20) + trash_liquid(protocol, p1000, 200, liquid_trash_list) p1000.return_tip() if TIP_TRASH is False else p1000.drop_tip() p200_tips += 1 tipcheck() - Liquid_trash = Liquid_trash_well_2 - # ============================================================================================ # GRIPPER MOVE sample_plate_2 FROM MAGPLATE TO heatershaker helpers.move_labware_to_hs( @@ -469,9 +533,6 @@ def tipcheck() -> None: if DRYRUN is False: protocol.delay(seconds=1 * 60) - if washcount > 2: - Liquid_trash = Liquid_trash_well_3 - protocol.comment("--> Removing Supernatant") RemoveSup = 200 for loop, X in enumerate(column_2_list): @@ -482,10 +543,7 @@ def tipcheck() -> None: p1000.move_to(sample_plate_2[X].bottom(z=0.5)) p1000.aspirate(100, rate=0.25) p1000.move_to(sample_plate_2[X].top(z=0.5)) - p1000.dispense(200, Liquid_trash.top(z=-7)) - protocol.delay(minutes=0.1) - p1000.blow_out(Liquid_trash.top(z=-7)) - p1000.aspirate(20) + trash_liquid(protocol, p1000, 200, liquid_trash_list) p1000.return_tip() if TIP_TRASH is False else p1000.drop_tip() p200_tips += 1 tipcheck() @@ -554,10 +612,7 @@ def tipcheck() -> None: p1000.move_to(sample_plate_2[X].bottom(z=0.5)) p1000.aspirate(100, rate=0.25) p1000.move_to(sample_plate_2[X].top(z=0.5)) - p1000.dispense(200, Liquid_trash.top(z=-7)) - protocol.delay(minutes=0.1) - p1000.blow_out(Liquid_trash.top(z=-7)) - p1000.aspirate(20) + trash_liquid(protocol, p1000, 200, liquid_trash_list) p1000.return_tip() if TIP_TRASH is False else p1000.drop_tip() p200_tips += 1 tipcheck() @@ -568,12 +623,7 @@ def tipcheck() -> None: p50.move_to(sample_plate_2[X].bottom(z=dot_bottom)) # original = z=0 p50.aspirate(50, rate=0.25) p50.default_speed = 200 - p50.dispense(50, Liquid_trash.top(z=-7)) - protocol.delay(minutes=0.1) - p50.blow_out() - p50.default_speed = 400 - p50.move_to(Liquid_trash.top(z=-7)) - p50.move_to(Liquid_trash.top(z=0)) + trash_liquid(protocol, p50, 50, liquid_trash_list) p50.return_tip() if TIP_TRASH is False else p50.drop_tip() p50_tips += 1 tipcheck() @@ -722,8 +772,6 @@ def tipcheck() -> None: p50_tips += 1 tipcheck() - Liquid_trash = Liquid_trash_well_4 - protocol.comment("--> ADDING AMPure (0.8x)") AMPureVol = 40.5 AMPureMixRep = 5 * 60 if DRYRUN is False else 0.1 * 60 @@ -777,12 +825,7 @@ def tipcheck() -> None: p1000.default_speed = 5 p1000.move_to(sample_plate_2[X].top(z=2)) p1000.default_speed = 200 - p1000.dispense(200, Liquid_trash.top(z=-7)) - protocol.delay(minutes=0.1) - p1000.blow_out() - p1000.default_speed = 400 - p1000.move_to(Liquid_trash.top(z=-7)) - p1000.move_to(Liquid_trash.top(z=0)) + trash_liquid(protocol, p1000, 200, liquid_trash_list) p1000.return_tip() if TIP_TRASH is False else p1000.drop_tip() p200_tips += 1 tipcheck() @@ -821,12 +864,7 @@ def tipcheck() -> None: p1000.default_speed = 5 p1000.move_to(sample_plate_2[X].top(z=2)) p1000.default_speed = 200 - p1000.dispense(200, Liquid_trash.top(z=-7)) - protocol.delay(minutes=0.1) - p1000.blow_out() - p1000.default_speed = 400 - p1000.move_to(Liquid_trash.top(z=-7)) - p1000.move_to(Liquid_trash.top(z=0)) + trash_liquid(protocol, p1000, 200, liquid_trash_list) p1000.return_tip() if TIP_TRASH is False else p1000.drop_tip() p200_tips += 1 tipcheck() @@ -842,12 +880,7 @@ def tipcheck() -> None: ) # original = (z=0) p1000.aspirate(50, rate=0.25) p1000.default_speed = 200 - p1000.dispense(50, Liquid_trash.top(z=-7)) - protocol.delay(minutes=0.1) - p1000.blow_out() - p1000.default_speed = 400 - p1000.move_to(Liquid_trash.top(z=-7)) - p1000.move_to(Liquid_trash.top(z=0)) + trash_liquid(protocol, p1000, 50, liquid_trash_list) p1000.return_tip() if TIP_TRASH is False else p1000.drop_tip() p200_tips += 1 tipcheck() @@ -945,4 +978,11 @@ def tipcheck() -> None: p1000.return_tip() if TIP_TRASH is False else p1000.drop_tip() p200_tips += 1 tipcheck() + liquids_to_probe_at_end = [ + Liquid_trash_well_1, + Liquid_trash_well_2, + Liquid_trash_well_3, + Liquid_trash_well_4, + ] + helpers.find_liquid_height_of_all_wells(protocol, p50, liquids_to_probe_at_end) plate_reader_actions(protocol, plate_reader, hellma_plate, plate_name_str) diff --git a/abr-testing/abr_testing/protocols/active_protocols/9_Magmax_RNA_Cells_Flex.py b/abr-testing/abr_testing/protocols/active_protocols/9_Magmax_RNA_Cells_Flex.py index 09201e58314..91dab25b493 100644 --- a/abr-testing/abr_testing/protocols/active_protocols/9_Magmax_RNA_Cells_Flex.py +++ b/abr-testing/abr_testing/protocols/active_protocols/9_Magmax_RNA_Cells_Flex.py @@ -44,15 +44,17 @@ Reservoir 1: Well 1 - 8120 ul -Well 2 - 6400 ul -Well 3-7 - 8550 ul +Well 2 - 8120 ul +Well 3 - 12800 ul +Well 4-12 - 9500 ul + """ -whichwash = 1 -sample_max = 48 -tip = 0 +whichwash = 0 +tip_pick_up = 0 drop_count = 0 waste_vol = 0 +wash_volume_tracker = 0.0 # Start protocol @@ -69,11 +71,11 @@ def run(ctx: ProtocolContext) -> None: inc_lysis = True res_type = "nest_12_reservoir_15ml" TIP_TRASH = False - num_samples = 48 + num_samples = 96 wash_vol = 150.0 lysis_vol = 140.0 stop_vol = 100.0 - elution_vol = dnase_vol = 50.0 + elution_vol = dnase_vol = 55.0 heater_shaker_speed = ctx.params.heater_shaker_speed # type: ignore[attr-defined] dot_bottom = ctx.params.dot_bottom # type: ignore[attr-defined] pipette_mount = ctx.params.pipette_mount # type: ignore[attr-defined] @@ -119,37 +121,37 @@ def run(ctx: ProtocolContext) -> None: tips201 = ctx.load_labware("opentrons_flex_96_tiprack_200ul", "A2", "Tips 2") tips202 = ctx.load_labware("opentrons_flex_96_tiprack_200ul", "B1", "Tips 3") tips203 = ctx.load_labware("opentrons_flex_96_tiprack_200ul", "B2", "Tips 4") - tips = [ - *tips200.wells()[num_samples:96], - *tips201.wells(), - *tips202.wells(), - *tips203.wells(), - ] + tips204 = ctx.load_labware("opentrons_flex_96_tiprack_200ul", "C2", "Tips 5") + tips_sn = tips200.wells()[:num_samples] # load P1000M pipette m1000 = ctx.load_instrument( "flex_8channel_1000", pipette_mount, - tip_racks=[tips200, tips201, tips202, tips203], + tip_racks=[tips200, tips201, tips202, tips203, tips204], ) # Load Liquid Locations in Reservoir elution_solution = elutionplate.rows()[0][:num_cols] - dnase1 = elutionplate.rows()[0][num_cols : 2 * num_cols] - lysis_ = res1.wells()[0] - stopreaction = res1.wells()[1] - wash1 = res1.wells()[2] - wash2 = res1.wells()[3] - wash3 = res1.wells()[4] - wash4 = res1.wells()[5] - wash5 = res1.wells()[6] - + dnase1 = elutionplate.rows()[0][:num_cols] + lysis_ = res1.wells()[0:2] + stopreaction = res1.wells()[2] + wash1 = res1.wells()[3] + wash2 = res1.wells()[4] + wash3 = res1.wells()[5] + wash4 = res1.wells()[6] + wash5 = res1.wells()[7] + wash6 = res1.wells()[8] + wash7 = res1.wells()[9] + wash8 = res1.wells()[10] + wash9 = res1.wells()[11] + all_washes = res1.wells()[3:12] """ Here is where you can define the locations of your reagents. """ samples_m = sample_plate.rows()[0][:num_cols] # 20ul beads each well - cells_m = sample_plate.rows()[0][num_cols : 2 * num_cols] + cells_m = sample_plate.rows()[0][:num_cols] elution_samples_m = elutionplate.rows()[0][:num_cols] # Do the same for color mapping beads_ = sample_plate.wells()[: (8 * num_cols)] @@ -163,13 +165,17 @@ def run(ctx: ProtocolContext) -> None: "Sample": [{"well": cells_, "volume": 0.0}], "DNAse": [{"well": dnase1_, "volume": dnase_vol}], "Elution Buffer": [{"well": elution_samps, "volume": elution_vol}], - "Lysis": [{"well": lysis_, "volume": lysis_vol}], - "Wash 1": [{"well": wash1, "volume": wash_vol}], - "Wash 2": [{"well": wash2, "volume": wash_vol}], - "Wash 3": [{"well": wash3, "volume": wash_vol}], - "Wash 4": [{"well": wash4, "volume": wash_vol}], - "Wash 5": [{"well": wash5, "volume": wash_vol}], - "Stop": [{"well": stopreaction, "volume": stop_vol}], + "Lysis": [{"well": lysis_, "volume": 8120.0}], + "Stop": [{"well": stopreaction, "volume": 6400.0}], + "Wash 1": [{"well": wash1, "volume": 9500.0}], + "Wash 2": [{"well": wash2, "volume": 9500.0}], + "Wash 3": [{"well": wash3, "volume": 9500.0}], + "Wash 4": [{"well": wash4, "volume": 9500.0}], + "Wash 5": [{"well": wash5, "volume": 9500.0}], + "Wash 6": [{"well": wash6, "volume": 9500.0}], + "Wash 7": [{"well": wash7, "volume": 9500.0}], + "Wash 8": [{"well": wash8, "volume": 9500.0}], + "Wash 9": [{"well": wash9, "volume": 9500.0}], } helpers.find_liquid_height_of_loaded_liquids(ctx, liquid_vols_and_wells, m1000) @@ -178,17 +184,19 @@ def run(ctx: ProtocolContext) -> None: m1000.flow_rate.dispense = 150 m1000.flow_rate.blow_out = 300 - def tiptrack(pip: InstrumentContext, tipbox: List[Well]) -> None: + def tiptrack(pip: InstrumentContext) -> None: """Tip Track.""" - global tip + global tip_pick_up global drop_count - pip.pick_up_tip(tipbox[int(tip)]) - tip = tip + 8 + pip.pick_up_tip() + tip_pick_up += 1 drop_count = drop_count + 8 if drop_count >= 250: drop_count = 0 if TIP_TRASH: ctx.pause("Empty Trash bin.") + if tip_pick_up >= 59: + pip.reset_tipracks() def remove_supernatant(vol: float) -> None: """Remove Supernatant.""" @@ -301,23 +309,30 @@ def mixing(well: Well, pip: InstrumentContext, mvol: float, reps: int = 8) -> No pip.flow_rate.aspirate = 300 pip.flow_rate.dispense = 300 - def lysis(vol: float, source: Well) -> None: + def lysis(vol: float, source: List[Well]) -> None: """Lysis Steps.""" + tvol_total = 0.0 ctx.comment("-----Beginning lysis steps-----") num_transfers = math.ceil(vol / 180) - tiptrack(m1000, tips) + tiptrack(m1000) + src = source[0] for i in range(num_cols): - src = source tvol = vol / num_transfers for t in range(num_transfers): m1000.require_liquid_presence(src) m1000.aspirate(tvol, src.bottom(1)) m1000.dispense(m1000.current_volume, cells_m[i].top(-3)) + tvol_total += tvol * 8 + if tvol_total > 8000.0: + ctx.comment("-----Changing to second lysis well.------") + src = source[1] + ctx.comment(f"new source {src}") + tvol_total = 0.0 # mix after adding all reagent to wells with cells for i in range(num_cols): if i != 0: - tiptrack(m1000, tips) + tiptrack(m1000) for x in range(8 if not dry_run else 1): m1000.aspirate(tvol * 0.75, cells_m[i].bottom(dot_bottom)) m1000.dispense(tvol * 0.75, cells_m[i].bottom(8)) @@ -347,7 +362,7 @@ def bind() -> None: ctx.comment("-----Beginning bind steps-----") for i, well in enumerate(samples_m): # Transfer cells+lysis/bind to wells with beads - tiptrack(m1000, tips) + tiptrack(m1000) m1000.aspirate(185, cells_m[i].bottom(dot_bottom)) m1000.air_gap(10) m1000.dispense(m1000.current_volume, well.bottom(8)) @@ -371,32 +386,28 @@ def bind() -> None: # remove initial supernatant remove_supernatant(180) - def wash(vol: float, source: Well) -> None: + def wash(vol: float, source: List[Well]) -> None: """Wash Function.""" global whichwash # Defines which wash the protocol is on to log on the app - - if source == wash1: - whichwash = 1 - if source == wash2: - whichwash = 2 - if source == wash3: - whichwash = 3 - if source == wash4: - whichwash = 4 - ctx.comment("-----Now starting Wash #" + str(whichwash) + "-----") - - tiptrack(m1000, tips) + global wash_volume_tracker + tiptrack(m1000) num_trans = math.ceil(vol / 180) vol_per_trans = vol / num_trans for i, m in enumerate(samples_m): - src = source + src = source[whichwash] for n in range(num_trans): m1000.aspirate(vol_per_trans, src) m1000.air_gap(10) m1000.dispense(m1000.current_volume, m.top(-2)) ctx.delay(seconds=2) m1000.blow_out(m.top(-2)) + wash_volume_tracker += vol_per_trans * 8 + if wash_volume_tracker > 9600: + whichwash += 1 + src = source[whichwash] + ctx.comment(f"new wash source {whichwash}") + wash_volume_tracker = 0.0 m1000.air_gap(10) m1000.drop_tip() if TIP_TRASH else m1000.return_tip() @@ -419,13 +430,14 @@ def wash(vol: float, source: Well) -> None: ) remove_supernatant(vol) + ctx.comment(f"final wash source {whichwash}") def dnase(vol: float, source: List[Well]) -> None: """Steps for DNAseI.""" ctx.comment("-----DNAseI Steps Beginning-----") num_trans = math.ceil(vol / 180) vol_per_trans = vol / num_trans - tiptrack(m1000, tips) + tiptrack(m1000) for i, m in enumerate(samples_m): src = source[i] m1000.flow_rate.aspirate = 10 @@ -442,7 +454,7 @@ def dnase(vol: float, source: List[Well]) -> None: # Is this mixing needed? \/\/\/ for i in range(num_cols): if i != 0: - tiptrack(m1000, tips) + tiptrack(m1000) mixing(samples_m[i], m1000, 45, reps=5 if not dry_run else 1) m1000.drop_tip() if TIP_TRASH else m1000.return_tip() @@ -452,7 +464,7 @@ def dnase(vol: float, source: List[Well]) -> None: def stop_reaction(vol: float, source: Well) -> None: """Adding stop solution.""" ctx.comment("-----Adding Stop Solution-----") - tiptrack(m1000, tips) + tiptrack(m1000) num_trans = math.ceil(vol / 180) vol_per_trans = vol / num_trans for i, m in enumerate(samples_m): @@ -483,7 +495,7 @@ def stop_reaction(vol: float, source: Well) -> None: def elute(vol: float) -> None: """Elution.""" ctx.comment("-----Elution Beginning-----") - tiptrack(m1000, tips) + tiptrack(m1000) m1000.flow_rate.aspirate = 10 for i, m in enumerate(samples_m): loc = m.top(-2) @@ -498,7 +510,7 @@ def elute(vol: float) -> None: # Is this mixing needed? \/\/\/ for i in range(num_cols): if i != 0: - tiptrack(m1000, tips) + tiptrack(m1000) for mixes in range(10): m1000.aspirate(elution_vol - 10, samples_m[i]) m1000.dispense(elution_vol - 10, samples_m[i].bottom(10)) @@ -523,7 +535,7 @@ def elute(vol: float) -> None: ctx.comment("-----Trasnferring Sample to Elution Plate-----") for i, (m, e) in enumerate(zip(samples_m, elution_samples_m)): - tiptrack(m1000, tips) + tiptrack(m1000) loc = m.bottom(dot_bottom) m1000.transfer(vol, loc, e.bottom(5), air_gap=20, new_tip="never") m1000.blow_out(e.top(-2)) @@ -537,15 +549,16 @@ def elute(vol: float) -> None: if inc_lysis: lysis(lysis_vol, lysis_) bind() - wash(wash_vol, wash1) - wash(wash_vol, wash2) + wash(wash_vol, all_washes) + wash(wash_vol, all_washes) + wash(wash_vol, all_washes) # dnase1 treatment dnase(dnase_vol, dnase1) stop_reaction(stop_vol, stopreaction) # Resume washes - wash(wash_vol, wash3) - wash(wash_vol, wash4) - wash(wash_vol, wash5) + wash(wash_vol, all_washes) + wash(wash_vol, all_washes) + wash(wash_vol, all_washes) for beaddry in np.arange(drybeads, 0, -0.5): ctx.delay( @@ -553,7 +566,8 @@ def elute(vol: float) -> None: msg="There are " + str(beaddry) + " minutes left in the drying step.", ) elute(elution_vol) - - end_list_of_wells_to_probe = [waste_reservoir["A1"], res1["A1"]] - end_list_of_wells_to_probe.extend(elution_samples_m) + end_list_of_wells_to_probe = [waste_reservoir["A1"]] + helpers.clean_up_plates( + m1000, [elutionplate, sample_plate], waste_reservoir["A1"], 200 + ) helpers.find_liquid_height_of_all_wells(ctx, m1000, end_list_of_wells_to_probe) diff --git a/abr-testing/abr_testing/protocols/csv_parameters/1_samplevols.csv b/abr-testing/abr_testing/protocols/csv_parameters/1_samplevols.csv new file mode 100644 index 00000000000..132b4dc70fb --- /dev/null +++ b/abr-testing/abr_testing/protocols/csv_parameters/1_samplevols.csv @@ -0,0 +1,97 @@ +Well,Dye,Diluent +A1,0,100 +B1,5,95 +C1,10,90 +D1,20,80 +E1,40,60 +F1,15,40 +G1,40,20 +H1,40,0 +A2,35,65 +B2,38,42 +C2,42,58 +D2,32,8 +E2,38,12 +F2,26,74 +G2,31,69 +H2,46,4 +A3,47,13 +B3,42,18 +C3,46,64 +D3,48,22 +E3,26,74 +F3,34,66 +G3,43,37 +H3,20,80 +A4,44,16 +B4,49,41 +C4,48,42 +D4,44,16 +E4,47,53 +F4,47,33 +G4,42,48 +H4,39,21 +A5,30,20 +B5,36,14 +C5,31,59 +D5,38,52 +E5,36,4 +F5,32,28 +G5,35,55 +H5,39,1 +A6,31,59 +B6,20,80 +C6,38,2 +D6,34,46 +E6,30,70 +F6,32,58 +G6,21,79 +H6,38,52 +A7,33,27 +B7,34,16 +C7,40,60 +D7,34,26 +E7,30,20 +F7,44,56 +G7,26,74 +H7,45,55 +A8,39,1 +B8,38,2 +C8,34,66 +D8,39,11 +E8,46,54 +F8,37,63 +G8,38,42 +H8,34,66 +A9,44,56 +B9,39,11 +C9,30,70 +D9,37,33 +E9,46,54 +F9,39,21 +G9,29,41 +H9,23,77 +A10,26,74 +B10,39,1 +C10,31,49 +D10,38,62 +E10,29,1 +F10,21,79 +G10,29,41 +H10,28,42 +A11,15,55 +B11,28,72 +C11,11,49 +D11,34,66 +E11,27,73 +F11,30,40 +G11,33,67 +H11,31,39 +A12,39,31 +B12,47,53 +C12,46,54 +D12,13,7 +E12,34,46 +F12,45,35 +G12,28,42 +H12,37,63 \ No newline at end of file diff --git a/abr-testing/abr_testing/protocols/csv_parameters/2_samplevols.csv b/abr-testing/abr_testing/protocols/csv_parameters/2_samplevols.csv index fa50562e68b..424aae072c3 100644 --- a/abr-testing/abr_testing/protocols/csv_parameters/2_samplevols.csv +++ b/abr-testing/abr_testing/protocols/csv_parameters/2_samplevols.csv @@ -6,20 +6,92 @@ D1,3,7,40,A1 E1,2,8,40,A2 F1,1,9,40,A2 G1,5,5,40,A2 -H1,3,7,40,A3 +H1,3,7,40,A2 A2,3,7,40,A3 B2,3,7,40,A3 C2,3,7,40,A3 D2,3,7,40,A3 -E2,3,7,40,A3 -F2,3,7,40,A3 -G2,3,7,40,A3 -H2,3,7,40,A3 -A3,3,7,40,A3 -B3,3,7,40,A3 -C3,3,7,45,A3 -D3,3,7,45,A3 -E3,3,5,45,A3 -F3,3,5,45,A3 +E2,3,7,40,A4 +F2,3,7,40,A4 +G2,3,7,40,A4 +H2,3,7,40,A4 +A3,3,7,40,A5 +B3,3,7,40,A5 +C3,3,7,45,A5 +D3,3,7,45,A5 +E3,3,5,45,A6 +F3,3,5,45,A6 G3,3,5,45,A6 -H3,3,4,45,A5 \ No newline at end of file +H3,3,4,45,A6 +A4,3,7,40,A1 +B4,0,10,40,A1 +C4,10,0,40,A1 +D4,3,7,40,A1 +E4,2,8,40,A2 +F4,1,9,40,A2 +G4,5,5,40,A2 +H4,3,7,40,A2 +A5,3,7,40,A3 +B5,3,7,40,A3 +C5,3,7,40,A3 +D5,3,7,40,A3 +E5,3,7,40,A4 +F5,3,7,40,A4 +G5,3,7,40,A4 +H5,3,7,40,A4 +A6,3,7,40,A5 +B6,3,7,40,A5 +C6,3,7,45,A5 +D6,3,7,45,A5 +E6,3,5,45,A6 +F6,3,5,45,A6 +G6,3,5,45,A6 +H6,3,4,45,A6 +A7,3,7,40,A1 +B7,0,10,40,A1 +C7,10,0,40,A1 +D7,3,7,40,A1 +E7,2,8,40,A2 +F7,1,9,40,A2 +G7,5,5,40,A2 +H7,3,7,40,A2 +A8,3,7,40,A3 +B8,3,7,40,A3 +C8,3,7,40,A3 +D8,3,7,40,A3 +E8,3,7,40,A4 +F8,3,7,40,A4 +G8,3,7,40,A4 +H8,3,7,40,A4 +A9,3,7,40,A5 +B9,3,7,40,A5 +C9,3,7,45,A5 +D9,3,7,45,A5 +E9,3,5,45,A6 +F9,3,5,45,A6 +G9,3,5,45,A6 +H9,3,4,45,A6 +A10,3,7,40,A1 +B10,0,10,40,A1 +C10,10,0,40,A1 +D10,3,7,40,A1 +E10,2,8,40,A2 +F10,1,9,40,A2 +G10,5,5,40,A2 +H10,3,7,40,A2 +A11,3,7,40,A3 +B11,3,7,40,A3 +C11,3,7,40,A3 +D11,3,7,40,A3 +E11,3,7,40,A4 +F11,3,7,40,A4 +G11,3,7,40,A4 +H11,3,7,40,A4 +A12,3,7,40,A5 +B12,3,7,40,A5 +C12,3,7,45,A5 +D12,3,7,45,A5 +E12,3,5,45,A6 +F12,3,5,45,A6 +G12,3,5,45,A6 +H12,3,4,45,A6 diff --git a/abr-testing/abr_testing/protocols/helpers.py b/abr-testing/abr_testing/protocols/helpers.py index 12abbfa9b3f..8fcfe757bae 100644 --- a/abr-testing/abr_testing/protocols/helpers.py +++ b/abr-testing/abr_testing/protocols/helpers.py @@ -7,14 +7,13 @@ ParameterContext, Well, ) -from typing import Tuple from opentrons.protocol_api.module_contexts import ( HeaterShakerContext, MagneticBlockContext, ThermocyclerContext, TemperatureModuleContext, ) -from typing import List, Union, Dict +from typing import List, Union, Dict, Tuple from opentrons.hardware_control.modules.types import ThermocyclerStep from opentrons_shared_data.errors.exceptions import PipetteLiquidNotFoundError @@ -107,6 +106,53 @@ def load_temp_adapter_and_labware( # FUNCTIONS FOR LOADING COMMON PARAMETERS +def create_channel_parameter(parameters: ParameterContext) -> None: + """Create pipette channel parameter.""" + parameters.add_str( + variable_name="channels", + display_name="Number of Pipette Channels", + choices=[ + {"display_name": "1 Channel", "value": "1channel"}, + {"display_name": "8 Channel", "value": "8channel"}, + ], + default="8channel", + ) + + +def create_pipette_parameters(parameters: ParameterContext) -> None: + """Create parameter for pipettes.""" + # NOTE: Place function inside def add_parameters(parameters) in protocol. + # NOTE: Copy ctx.params.left mount, ctx.params.right_mount # type: ignore[attr-defined] + # to get result + # Left Mount + parameters.add_str( + variable_name="left_mount", + display_name="Left Mount", + description="Pipette Type on Left Mount.", + choices=[ + {"display_name": "8ch 50ul", "value": "flex_8channel_50"}, + {"display_name": "8ch 1000ul", "value": "flex_8channel_1000"}, + {"display_name": "1ch 50ul", "value": "flex_1channel_50"}, + {"display_name": "1ch 1000ul", "value": "flex_1channel_1000"}, + {"display_name": "96ch 1000ul", "value": "flex_96channel_1000"}, + {"display_name": "None", "value": "none"}, + ], + default="flex_8channel_1000", + ) + # Right Mount + parameters.add_str( + variable_name="right_mount", + display_name="Right Mount", + description="Pipette Type on Right Mount.", + choices=[ + {"display_name": "8ch 50ul", "value": "flex_8channel_50"}, + {"display_name": "8ch 1000ul", "value": "flex_8channel_1000"}, + {"display_name": "1ch 50ul", "value": "flex_1channel_50"}, + {"display_name": "1ch 1000ul", "value": "flex_1channel_1000"}, + {"display_name": "None", "value": "none"}, + ], + default="none", + ) def create_single_pipette_mount_parameter(parameters: ParameterContext) -> None: @@ -163,6 +209,16 @@ def create_disposable_lid_parameter(parameters: ParameterContext) -> None: ) +def create_disposable_lid_trash_location(parameters: ParameterContext) -> None: + """Create a parameter for lid placement after use.""" + parameters.add_bool( + variable_name="trash_lid", + display_name="Trash Disposable Lid", + description="True means trash lid, false means keep on deck.", + default=True, + ) + + def create_tc_lid_deck_riser_parameter(parameters: ParameterContext) -> None: """Create parameter for tc lid deck riser.""" parameters.add_bool( @@ -184,7 +240,7 @@ def create_tip_size_parameter(parameters: ParameterContext) -> None: {"display_name": "200 µL", "value": "opentrons_flex_96_tiprack_200ul"}, {"display_name": "1000 µL", "value": "opentrons_flex_96_tiprack_1000ul"}, ], - default="opentrons_flex_96_tiprack_1000ul", + default="opentrons_flex_96_tiprack_50ul", ) @@ -314,6 +370,39 @@ def use_disposable_lid_with_tc( # FUNCTIONS FOR COMMON PIPETTE COMMAND SEQUENCES +def clean_up_plates( + pipette: InstrumentContext, + list_of_labware: List[Labware], + liquid_waste: Well, + tip_size: int, +) -> None: + """Aspirate liquid from labware and dispense into liquid waste.""" + pipette.pick_up_tip() + pipette.liquid_presence_detection = False + num_of_active_channels = pipette.active_channels + for labware in list_of_labware: + if num_of_active_channels == 8: + list_of_wells = labware.rows()[0] + elif num_of_active_channels == 1: + list_of_wells = labware.wells() + elif num_of_active_channels == 96: + list_of_wells = [labware.wells()[0]] + for well in list_of_wells: + vol_removed = 0.0 + while well.max_volume > vol_removed: + pipette.aspirate(tip_size, well) + pipette.dispense( + tip_size, + liquid_waste.top(), + ) + pipette.blow_out(liquid_waste.top()) + vol_removed += pipette.max_volume + if pipette.channels != num_of_active_channels: + pipette.drop_tip() + else: + pipette.return_tip() + + def find_liquid_height(pipette: InstrumentContext, well_to_probe: Well) -> float: """Find liquid height of well.""" try: @@ -372,6 +461,18 @@ def load_wells_with_custom_liquids( well.load_liquid(liquid, volume) +def comment_height_of_specific_labware( + protocol: ProtocolContext, labware_name: str, dict_of_labware_heights: Dict +) -> None: + """Comment height found of specific labware.""" + total_height = 0.0 + for key in dict_of_labware_heights.keys(): + if key[0] == labware_name: + height = dict_of_labware_heights[key] + total_height += height + protocol.comment(f"Liquid Waste Total Height: {total_height}") + + def find_liquid_height_of_all_wells( protocol: ProtocolContext, pipette: InstrumentContext, @@ -382,7 +483,7 @@ def find_liquid_height_of_all_wells( pipette.pick_up_tip() pip_channels = pipette.active_channels for well in wells: - labware_name = well.parent.load_name + labware_name = well.parent.name total_number_of_wells_in_plate = len(well.parent.wells()) # if pip_channels is > 1 and total_wells > 12 - only probe 1st row. if ( @@ -402,6 +503,9 @@ def find_liquid_height_of_all_wells( pipette.reset_tipracks() msg = f"result: {dict_of_labware_heights}" protocol.comment(msg=msg) + comment_height_of_specific_labware( + protocol, "Liquid Waste", dict_of_labware_heights + ) return dict_of_labware_heights @@ -423,6 +527,8 @@ def find_liquid_height_of_loaded_liquids( entry["well"] if isinstance(entry["well"], list) else [entry["well"]] ) ] + if pipette.active_channels == 96: + wells = [well for well in wells if well.display_name.split(" ")[0] == "A1"] find_liquid_height_of_all_wells(ctx, pipette, wells) return wells diff --git a/abr-testing/abr_testing/protocols/liquid_setups/10_ZymoBIOMICS Magbead Liquid Setup.py b/abr-testing/abr_testing/protocols/liquid_setups/10_ZymoBIOMICS Magbead Liquid Setup.py index 422102e4321..cb974ea990d 100644 --- a/abr-testing/abr_testing/protocols/liquid_setups/10_ZymoBIOMICS Magbead Liquid Setup.py +++ b/abr-testing/abr_testing/protocols/liquid_setups/10_ZymoBIOMICS Magbead Liquid Setup.py @@ -26,14 +26,18 @@ def run(protocol: protocol_api.ProtocolContext) -> None: p1000, ) = load_common_liquid_setup_labware_and_instruments(protocol) - res1 = protocol.load_labware("nest_12_reservoir_15ml", "C3", "R1") - res2 = protocol.load_labware("nest_12_reservoir_15ml", "B3", "R2") + res1 = protocol.load_labware("nest_12_reservoir_15ml", "D3", "Reagent Reservoir 1") + res2 = protocol.load_labware("nest_12_reservoir_15ml", "C3", "Reagent Reservoir 2") + res3 = protocol.load_labware("nest_12_reservoir_15ml", "B3", "Reagent Reservoir 3") + total_volume = 12320 + (11875 * 7) + (13500 * 4) + (9800 * 13) + 1200 + print(f"Total volume: {total_volume}") lysis_and_pk = 12320 / 8 beads_and_binding = 11875 / 8 binding2 = 13500 / 8 - wash2 = 9000 / 8 + wash2 = 9800 / 8 wash2_list = [wash2] * 12 + final_elution = 1200 / 8 # Fill up Plates # Res1 p1000.transfer( @@ -42,7 +46,10 @@ def run(protocol: protocol_api.ProtocolContext) -> None: beads_and_binding, beads_and_binding, beads_and_binding, - binding2, + beads_and_binding, + beads_and_binding, + beads_and_binding, + beads_and_binding, binding2, binding2, binding2, @@ -58,6 +65,9 @@ def run(protocol: protocol_api.ProtocolContext) -> None: res1["A6"].top(), res1["A7"].top(), res1["A8"].top(), + res1["A9"].top(), + res1["A10"].top(), + res1["A11"].top(), res1["A12"].top(), ], blow_out=True, @@ -66,10 +76,19 @@ def run(protocol: protocol_api.ProtocolContext) -> None: ) # Res2 p1000.transfer( - volume=wash2_list, - source=source_reservoir["A1"], + volume=[final_elution] + wash2_list[:11], + source=[source_reservoir["A1"]] * 12, dest=res2.wells(), blow_out=True, blowout_location="source well", trash=False, ) + # Res 3 + p1000.transfer( + volume=[wash2, wash2], + source=[source_reservoir["A1"], source_reservoir["A1"]], + dest=[res3["A1"], res3["A2"]], + blow_out=True, + blowout_location="source well", + trash=False, + ) diff --git a/abr-testing/abr_testing/protocols/liquid_setups/1_Simple normalize long Liquid Setup.py b/abr-testing/abr_testing/protocols/liquid_setups/1_Simple normalize long Liquid Setup.py index 2d995fede39..b3cbd540c58 100644 --- a/abr-testing/abr_testing/protocols/liquid_setups/1_Simple normalize long Liquid Setup.py +++ b/abr-testing/abr_testing/protocols/liquid_setups/1_Simple normalize long Liquid Setup.py @@ -26,12 +26,12 @@ def run(protocol: protocol_api.ProtocolContext) -> None: ) = load_common_liquid_setup_labware_and_instruments(protocol) reservoir = protocol.load_labware("nest_12_reservoir_15ml", "D2", "Reservoir") # Transfer Liquid - vol = 5400 / 8 - columns = ["A1", "A2", "A3", "A4", "A5"] + vol = 6175 / 8 + columns = ["A1", "A2", "A3", "A4", "A5", "A6"] for i in columns: p1000.transfer( vol, - source=source_reservoir["A1"].bottom(z=0.5), + source=source_reservoir["A1"].bottom(z=2), dest=reservoir[i].top(), blowout=True, blowout_location="source well", diff --git a/abr-testing/abr_testing/protocols/liquid_setups/2_BMS_PCR_protocol Liquid Setup.py b/abr-testing/abr_testing/protocols/liquid_setups/2_BMS_PCR_protocol Liquid Setup.py index a6c71b563d4..3268b2a72c8 100644 --- a/abr-testing/abr_testing/protocols/liquid_setups/2_BMS_PCR_protocol Liquid Setup.py +++ b/abr-testing/abr_testing/protocols/liquid_setups/2_BMS_PCR_protocol Liquid Setup.py @@ -33,9 +33,9 @@ def run(protocol: protocol_api.ProtocolContext) -> None: ) # Steps # Dispense into plate 1 - p1000.transfer(50, source_reservoir["A1"], pcr_plate_1.wells(), trash=False) + p1000.transfer(100, source_reservoir["A1"], pcr_plate_1.wells(), trash=False) # Dispense p1000.configure_nozzle_layout(protocol_api.SINGLE, start="H1", tip_racks=[tip_rack]) - p1000.transfer(1500, source_reservoir["A1"], snap_caps["B1"]) - p1000.transfer(1500, source_reservoir["A1"], snap_caps.rows()[0]) + p1000.transfer(1000, source_reservoir["A1"], snap_caps["B1"]) + p1000.transfer(1000, source_reservoir["A1"], snap_caps.rows()[0]) diff --git a/abr-testing/abr_testing/protocols/liquid_setups/3_Tartrazine Liquid Setup.py b/abr-testing/abr_testing/protocols/liquid_setups/3_Tartrazine Liquid Setup.py index 9e0b29a03ed..0b5b591dda3 100644 --- a/abr-testing/abr_testing/protocols/liquid_setups/3_Tartrazine Liquid Setup.py +++ b/abr-testing/abr_testing/protocols/liquid_setups/3_Tartrazine Liquid Setup.py @@ -1,8 +1,6 @@ """Plate Filler Protocol for Tartrazine Protocol.""" from opentrons import protocol_api -from abr_testing.protocols.helpers import ( - load_common_liquid_setup_labware_and_instruments, -) +from abr_testing.protocols import helpers metadata = { "protocolName": "DVT1ABR3 Liquids: Tartrazine Protocol", @@ -16,32 +14,73 @@ } +def add_parameters(parameters: protocol_api.ParameterContext) -> None: + """Add parameters.""" + parameters.add_int( + variable_name="number_of_plates", + display_name="Number of Plates", + default=4, + minimum=1, + maximum=4, + ) + helpers.create_channel_parameter(parameters) + + def run(protocol: protocol_api.ProtocolContext) -> None: """Protocol.""" + number_of_plates = protocol.params.number_of_plates # type: ignore [attr-defined] + channels = protocol.params.channels # type: ignore [attr-defined] # Initiate Labware ( source_reservoir, tip_rack, p1000, - ) = load_common_liquid_setup_labware_and_instruments(protocol) - reagent_tube = protocol.load_labware( - "opentrons_10_tuberack_falcon_4x50ml_6x15ml_conical", "D3", "Reagent Tube" - ) - p1000.configure_nozzle_layout( - style=protocol_api.SINGLE, start="H1", tip_racks=[tip_rack] - ) - # Transfer Liquid - p1000.transfer( - 45000, - source_reservoir["A1"], - reagent_tube["B3"].top(), - blowout=True, - blowout_location="source well", - ) - p1000.transfer( - 45000, - source_reservoir["A1"], - reagent_tube["A4"].top(), - blowout=True, - blowout_location="source well", - ) + ) = helpers.load_common_liquid_setup_labware_and_instruments(protocol) + if channels == "1channel": + reagent_tube = protocol.load_labware( + "opentrons_10_tuberack_falcon_4x50ml_6x15ml_conical", "D3", "Reagent Tube" + ) + p1000.configure_nozzle_layout( + style=protocol_api.SINGLE, start="H1", tip_racks=[tip_rack] + ) + # Transfer Liquid + p1000.transfer( + 45000, + source_reservoir["A1"], + reagent_tube["B3"].top(), + blowout=True, + blowout_location="source well", + ) + p1000.transfer( + 45000, + source_reservoir["A1"], + reagent_tube["A4"].top(), + blowout=True, + blowout_location="source well", + ) + elif channels == "8channel": + reservoir = protocol.load_labware("nest_12_reservoir_15ml", "D3", "Reservoir") + water_max_vol = reservoir["A1"].max_volume - 500 + reservoir_wells = reservoir.wells()[ + 1: + ] # Skip A1 as it's reserved for tartrazine + # NEEDED WATER + needed_water: float = ( + float(number_of_plates) * 96.0 * 250.0 + ) # loading extra as a safety factor + # CALCULATING NEEDED # OF WATER WELLS + needed_wells = round(needed_water / water_max_vol) + water_wells = [] + for i in range(needed_wells + 1): + water_wells.append(reservoir_wells[i]) + # Create lists of volumes and source that matches wells to fill + water_max_vol_list = [water_max_vol] * len(water_wells) + source_list = [source_reservoir["A1"]] * len(water_wells) + p1000.transfer( + water_max_vol_list, + source_list, + water_wells, + blowout=True, + blowout_locaiton="source", + trash=False, + ) diff --git a/abr-testing/abr_testing/protocols/liquid_setups/4_Illumina DNA Enrichment Liquid Setup.py b/abr-testing/abr_testing/protocols/liquid_setups/4_Illumina DNA Enrichment Liquid Setup.py index 18aee383ace..15b1e41cac7 100644 --- a/abr-testing/abr_testing/protocols/liquid_setups/4_Illumina DNA Enrichment Liquid Setup.py +++ b/abr-testing/abr_testing/protocols/liquid_setups/4_Illumina DNA Enrichment Liquid Setup.py @@ -27,7 +27,7 @@ def run(protocol: protocol_api.ProtocolContext) -> None: reservoir_1 = protocol.load_labware( "nest_96_wellplate_2ml_deep", "D2", "Reservoir 1" ) # Reservoir - reservoir_2 = protocol.load_labware( + sample_plate_2 = protocol.load_labware( "thermoscientificnunc_96_wellplate_1300ul", "D3", "Sample Plate 2" ) # Reservoir sample_plate_1 = protocol.load_labware( @@ -57,10 +57,10 @@ def run(protocol: protocol_api.ProtocolContext) -> None: volume=[120, 750, 900, 96], source=source_reservoir["A1"], dest=[ - reservoir_1["A1"].top(), - reservoir_1["A2"].top(), - reservoir_1["A4"].top(), - reservoir_1["A5"].top(), + reservoir_1["A1"].top(), # AMPure + reservoir_1["A2"].top(), # SMB + reservoir_1["A4"].top(), # EtOH + reservoir_1["A5"].top(), # RSB ], blow_out=True, blowout_location="source well", @@ -68,10 +68,10 @@ def run(protocol: protocol_api.ProtocolContext) -> None: ) # Reservoir 2 Plate Prep: dispense liquid into columns 1-9 total 3690 ul - reservoir_2_wells = reservoir_2.wells() + reservoir_2_wells = sample_plate_1.wells() list_of_locations = [well_location.top() for well_location in reservoir_2_wells] p1000.transfer( - volume=[50, 50, 50, 50, 50, 50, 330, 330, 330, 800, 800, 800], + volume=[150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150], source=source_reservoir["A1"], dest=list_of_locations, blow_out=True, @@ -80,9 +80,14 @@ def run(protocol: protocol_api.ProtocolContext) -> None: ) # Sample Plate Prep: total 303 - dest_list = [sample_plate_1["A1"], sample_plate_1["A2"], sample_plate_1["A3"]] + dest_list = [ + sample_plate_2["A9"], + sample_plate_2["A10"], + sample_plate_2["A11"], + sample_plate_2["A12"], + ] p1000.transfer( - volume=[101, 101, 101], + volume=[1000, 1000, 1000, 1000], source=source_reservoir["A1"], dest=dest_list, blow_out=True, diff --git a/abr-testing/abr_testing/protocols/liquid_setups/5_96ch Complex Protocol Liquid Setup.py b/abr-testing/abr_testing/protocols/liquid_setups/5_96ch Complex Protocol Liquid Setup.py index cd263318442..e9d37be0803 100644 --- a/abr-testing/abr_testing/protocols/liquid_setups/5_96ch Complex Protocol Liquid Setup.py +++ b/abr-testing/abr_testing/protocols/liquid_setups/5_96ch Complex Protocol Liquid Setup.py @@ -5,7 +5,7 @@ ) metadata = { - "protocolName": "DVT2ABR5 and 6 Liquids: 96ch Complex Protocol", + "protocolName": "DVT2ABR5 Liquids: 96ch Complex Protocol", "author": "Rhyann clarke ", "source": "Protocol Library", } @@ -29,7 +29,7 @@ def run(protocol: protocol_api.ProtocolContext) -> None: "nest_96_wellplate_2ml_deep", "D2", "Reservoir" ) # Reservoir - vol = 500 + vol = 1000 column_list = [ "A1", @@ -45,9 +45,9 @@ def run(protocol: protocol_api.ProtocolContext) -> None: "A11", "A12", ] + p1000.pick_up_tip() for i in column_list: - p1000.pick_up_tip() p1000.aspirate(vol, source_reservoir["A1"].bottom(z=0.5)) p1000.dispense(vol, reservoir[i].top()) p1000.blow_out(location=source_reservoir["A1"].top()) - p1000.return_tip() + p1000.return_tip() diff --git a/abr-testing/abr_testing/protocols/liquid_setups/6_Omega_HDQ_DNA_Cells Liquid Setup.py b/abr-testing/abr_testing/protocols/liquid_setups/6_Omega_HDQ_DNA_Cells Liquid Setup.py new file mode 100644 index 00000000000..02a1a207351 --- /dev/null +++ b/abr-testing/abr_testing/protocols/liquid_setups/6_Omega_HDQ_DNA_Cells Liquid Setup.py @@ -0,0 +1,92 @@ +"""Plate Filler Protocol for Omega HDQ DNA Cell Protocol.""" +from opentrons import protocol_api +from abr_testing.protocols.helpers import ( + load_common_liquid_setup_labware_and_instruments, +) + +metadata = { + "protocolName": "DVT2ABR6: Omega HDQ DNA Cells Protocol", + "author": "Rhyann clarke ", + "source": "Protocol Library", +} + +requirements = { + "robotType": "Flex", + "apiLevel": "2.21", +} + + +def run(protocol: protocol_api.ProtocolContext) -> None: + """Protocol.""" + # Initiate Labware + ( + source_reservoir, + tip_rack, + p1000, + ) = load_common_liquid_setup_labware_and_instruments(protocol) + deepwell_type = "nest_96_wellplate_2ml_deep" + + lysis_reservoir = protocol.load_labware(deepwell_type, "D2", "Lysis reservoir") + bind_reservoir = protocol.load_labware( + deepwell_type, "D3", "Beads and binding reservoir" + ) + wash1_reservoir = protocol.load_labware(deepwell_type, "C3", "Wash 1 and 2 Buffer") + wash2_reservoir = protocol.load_labware(deepwell_type, "B3", "Wash 3 Buffer") + sample_plate = protocol.load_labware(deepwell_type, "B2", "Sample Plate") + elution_plate = protocol.load_labware( + "armadillo_96_wellplate_200ul_pcr_full_skirt", "B1", "Elution Plate" + ) + p1000.transfer( + volume=350, + source=source_reservoir["A1"].bottom(z=2), + dest=lysis_reservoir.wells(), + blow_out=True, + blowout_location="source well", + new_tip="once", + trash=False, + ) + p1000.transfer( + 440, + source=source_reservoir["A1"].bottom(z=2), + dest=bind_reservoir.wells(), + blow_out=True, + blowout_location="source well", + new_tip="once", + trash=False, + ) + p1000.transfer( + 1300, + source_reservoir["A1"].bottom(z=2), + wash1_reservoir.wells(), + blow_out=True, + blowout_location="source well", + new_tip="once", + trash=False, + ) + p1000.transfer( + 700, + source_reservoir["A1"].bottom(z=2), + wash2_reservoir.wells(), + blow_out=True, + blowout_location="source well", + new_tip="once", + trash=False, + ) + p1000.transfer( + 180, + source_reservoir["A1"].bottom(z=2), + sample_plate.wells(), + blow_out=True, + blowout_location="source well", + new_tip="once", + trash=False, + ) + p1000.transfer( + 100, + source_reservoir["A1"].bottom(z=2), + elution_plate.wells(), + blow_out=True, + blowout_location="source well", + new_tip="once", + trash=False, + ) diff --git a/abr-testing/abr_testing/protocols/liquid_setups/7_HDQ DNA Bacteria Extraction Liquid Setup.py b/abr-testing/abr_testing/protocols/liquid_setups/7_HDQ DNA Bacteria Extraction Liquid Setup.py index 4addbd5c7e8..e2534f3608d 100644 --- a/abr-testing/abr_testing/protocols/liquid_setups/7_HDQ DNA Bacteria Extraction Liquid Setup.py +++ b/abr-testing/abr_testing/protocols/liquid_setups/7_HDQ DNA Bacteria Extraction Liquid Setup.py @@ -52,12 +52,19 @@ def run(protocol: protocol_api.ProtocolContext) -> None: beads = 230 pk = 230 lysis = 230 - + source = source_reservoir["A1"].bottom(z=0.5) # Sample Plate p1000.transfer( volume=180, - source=source_reservoir["A1"].bottom(z=0.5), - dest=sample_plate["A1"].top(), + source=[source, source, source, source, source, source], + dest=[ + sample_plate["A1"].top(), + sample_plate["A2"].top(), + sample_plate["A3"].top(), + sample_plate["A4"].top(), + sample_plate["A5"].top(), + sample_plate["A6"].top(), + ], blowout=True, blowout_location="source well", trash=False, @@ -65,8 +72,15 @@ def run(protocol: protocol_api.ProtocolContext) -> None: # Elution Plate p1000.transfer( volume=100, - source=source_reservoir["A1"].bottom(z=0.5), - dest=elution_plate["A1"].top(), + source=[source, source, source, source, source, source], + dest=[ + elution_plate["A1"].top(), + elution_plate["A2"].top(), + elution_plate["A3"].top(), + elution_plate["A4"].top(), + elution_plate["A5"].top(), + elution_plate["A6"].top(), + ], blowout=True, blowout_location="source well", trash=False, diff --git a/abr-testing/abr_testing/protocols/liquid_setups/9_Thermo MagMax RNA Extraction Liquid Setup.py b/abr-testing/abr_testing/protocols/liquid_setups/9_Thermo MagMax RNA Extraction Liquid Setup.py index c6ded28719d..2e090408317 100644 --- a/abr-testing/abr_testing/protocols/liquid_setups/9_Thermo MagMax RNA Extraction Liquid Setup.py +++ b/abr-testing/abr_testing/protocols/liquid_setups/9_Thermo MagMax RNA Extraction Liquid Setup.py @@ -34,15 +34,28 @@ def run(protocol: protocol_api.ProtocolContext) -> None: ) # Volumes + lysis = 8120 / 8 + stop_reaction_vol = 6400 / 8 elution_vol = 55 - well1 = 8120 / 8 - well2 = 6400 / 8 - well3_7 = 8550 / 8 + well4_12 = 9500 / 8 sample_vol = 100 # Reservoir p1000.transfer( - volume=[well1, well2, well3_7, well3_7, well3_7, well3_7, well3_7], + volume=[ + lysis, + lysis, + stop_reaction_vol, + well4_12, + well4_12, + well4_12, + well4_12, + well4_12, + well4_12, + well4_12, + well4_12, + well4_12, + ], source=source_reservoir["A1"].bottom(z=0.2), dest=[ res1["A1"].top(), @@ -52,6 +65,11 @@ def run(protocol: protocol_api.ProtocolContext) -> None: res1["A5"].top(), res1["A6"].top(), res1["A7"].top(), + res1["A8"].top(), + res1["A9"].top(), + res1["A10"].top(), + res1["A11"].top(), + res1["A12"].top(), ], blow_out=True, blowout_location="source well", @@ -94,7 +112,20 @@ def run(protocol: protocol_api.ProtocolContext) -> None: ) # Sample Plate p1000.transfer( - volume=[sample_vol, sample_vol, sample_vol, sample_vol, sample_vol, sample_vol], + volume=[ + sample_vol, + sample_vol, + sample_vol, + sample_vol, + sample_vol, + sample_vol, + sample_vol, + sample_vol, + sample_vol, + sample_vol, + sample_vol, + sample_vol, + ], source=source_reservoir["A1"].bottom(z=0.2), dest=[ sample_plate["A1"].top(), @@ -103,6 +134,12 @@ def run(protocol: protocol_api.ProtocolContext) -> None: sample_plate["A4"].top(), sample_plate["A5"].top(), sample_plate["A6"].top(), + sample_plate["A7"].top(), + sample_plate["A8"].top(), + sample_plate["A9"].top(), + sample_plate["A10"].top(), + sample_plate["A11"].top(), + sample_plate["A12"].top(), ], blow_out=True, blowout_location="source well", diff --git a/abr-testing/abr_testing/protocols/test_protocols/static_trash_bin_movement.py b/abr-testing/abr_testing/protocols/test_protocols/static_trash_bin_movement.py new file mode 100644 index 00000000000..744f1ac33fd --- /dev/null +++ b/abr-testing/abr_testing/protocols/test_protocols/static_trash_bin_movement.py @@ -0,0 +1,160 @@ +"""Protocol to test tip knock off on trash bin.""" +from abr_testing.protocols import helpers +from opentrons.protocol_api import ( + ProtocolContext, + InstrumentContext, + ParameterContext, + Labware, + TrashBin, +) + + +metadata = { + "protocolName": "Test Trash Bin Knock Off", + "author": "Rhyann Clarke ", +} + +requirements = { + "robotType": "OT-3", + "apiLevel": "2.21", +} + + +# def return_tip(instrument: InstrumentContext, tiprack: Labware, well_name: str) -> None: +# """Drop a tip in a tiprack (not for reuse) avoiding static retention. +# Call this function like drop_tip(left_instrument, some_tiprack, "A2"). +# This function uses internal machinery that is not part of Opentrons' stable API. It should +# be assumed to be broken whenever you update the robot. +# This function imports everything it needs and should be safe to copy-paste. +# """ +# from opentrons.types import Point +# from opentrons.hardware_control.types import OT3Mount, Axis +# from opentrons.protocol_api.core.engine.instrument import InstrumentCore +# from typing import cast + +# instrument_core = cast(InstrumentCore, instrument._core) +# protocol_core = instrument_core._protocol_core +# instrument.move_to( +# tiprack[well_name].top(z=(-instrument.return_height * tiprack.tip_length)) +# ) +# protocol_core.comment( +# f"Dropping tip from {instrument.mount} in {well_name} of {tiprack.name}" +# ) +# # Do what we do internally when we drop a tip without actually calling drop_tip() +# pipette_id = instrument_core._pipette_id +# instrument_core._engine_client.state.tips._state.length_by_pipette_id[pipette_id] +# pipette_state = instrument_core._engine_client.state.pipettes +# pipette_state._state.aspirated_volume_by_id[pipette_id] = None +# pipette_state._state.attached_tip_by_id[pipette_id] = None +# if protocol_core.is_simulating(): +# return +# # This uses internal tools that aren't stable - expect this part of the protocol to +# # fail when the robot is updated. +# hardware = instrument_core._sync_hardware_api +# mount = OT3Mount.from_mount(instrument_core.get_mount()) +# hw_instrument = hardware._pipette_handler.get_pipette(mount) +# config = hw_instrument.drop_configurations.plunger_eject +# well_is_left_half = int(well_name[1:]) < 8 +# if well_is_left_half: +# delta = Point(x=10, y=0, z=0) +# else: +# delta = Point(x=-10, y=0, z=0) +# hardware._backend.set_active_current( +# {Axis.of_main_tool_actuator(mount): config.current} +# ) +# hardware.move_axes( +# position={ +# Axis.of_main_tool_actuator(mount): hw_instrument.plunger_positions.drop_tip +# }, +# speed=config.speed, +# ) +# hardware._backend.set_default_currents() +# hardware.current_position_ot3(mount, refresh=True) +# hardware.move_rel(mount, delta) +# hw_instrument.set_current_volume(0) +# hw_instrument.current_tiprack_diameter = 0.0 +# hw_instrument.remove_tip() +# hardware.home([Axis.of_main_tool_actuator(mount), Axis.by_mount(mount)]) +# protocol_core.set_last_location(location=None, mount=instrument_core.get_mount()) + + +def test_pick_up_and_drop( + ctx: ProtocolContext, + pipette: InstrumentContext, + tip_rack: Labware, + trash_bin: TrashBin, + offset: float, +) -> None: + """Pick up tips, drop in trash, move left or right.""" + for tips in tip_rack.columns(): + pipette.pick_up_tip() + # Drop tip in trash_bin + pipette.drop_tip() + # move to trash_bin_edge + # Move to 5 mm past the edge of trash_bin in slot C3 + pipette.move_to(trash_bin.top(-100, 0, 10)) + ctx.pause("position.") + pipette.move_to(trash_bin.top(-100 + offset, 0, 10), force_direct=True) + + +def add_parameters(parameters: ParameterContext) -> None: + """Parameters.""" + helpers.create_tip_size_parameter(parameters) + helpers.create_pipette_parameters(parameters) + parameters.add_float( + variable_name="offset", + display_name="Offset", + description="Offset on Left Side of Trash Bin", + choices=[ + {"display_name": "-25", "value": -25.0}, + {"display_name": "-20", "value": -20.0}, + {"display_name": "-15", "value": -15.0}, + {"display_name": "-10", "value": -10.0}, + {"display_name": "-5", "value": -5.0}, + ], + default=-10.0, + ) + parameters.add_bool( + variable_name="drop_tip", + display_name="Drop Tip", + description="True means tip is dropped", + default=False, + ) + + +def run(ctx: ProtocolContext) -> None: + """Protocol to Throw Away Tips with Offset.""" + left_mount_pipette = ctx.params.left_mount # type: ignore[attr-defined] + right_mount_pipette = ctx.params.right_mount # type: ignore[attr-defined] + tip_size = ctx.params.tip_size # type: ignore[attr-defined] + offset = ctx.params.offset # type: ignore[attr-defined] + drop_tip = ctx.params.drop_tip # type: ignore[attr-defined] + trash_bin = ctx.load_trash_bin("A3") + tip_rack = ctx.load_labware(tip_size, "A2") + if left_mount_pipette != "none": + pipette = ctx.load_instrument(left_mount_pipette, "left", tip_racks=[tip_rack]) + if right_mount_pipette != "none": + pipette = ctx.load_instrument( + right_mount_pipette, "right", tip_racks=[tip_rack] + ) + if drop_tip: + test_pick_up_and_drop(ctx, pipette, tip_rack, trash_bin, offset) + else: + return_spots = [ + "A1", + "A2", + "A3", + "A4", + "A5", + "A6", + "A7", + "A8", + "A9", + "A10", + "A11", + "A12", + ] + for (column, return_well) in zip(tip_rack.columns(), return_spots): + pipette.pick_up_tip() + pipette.return_tip() + # return_tip(pipette, tip_rack, return_well) diff --git a/abr-testing/abr_testing/protocols/test_protocols/tc_lid_x_offset_test.py b/abr-testing/abr_testing/protocols/test_protocols/tc_lid_x_offset_test.py index df85453ff28..a1401fec0d6 100644 --- a/abr-testing/abr_testing/protocols/test_protocols/tc_lid_x_offset_test.py +++ b/abr-testing/abr_testing/protocols/test_protocols/tc_lid_x_offset_test.py @@ -56,6 +56,7 @@ def add_parameters(parameters: ParameterContext) -> None: description="Turn on to make offset negative.", default=False, ) + helpers.create_disposable_lid_trash_location(parameters) def run(protocol: ProtocolContext) -> None: @@ -64,6 +65,8 @@ def run(protocol: ProtocolContext) -> None: lids_in_stack = protocol.params.lids_in_a_stack # type: ignore[attr-defined] x_offset = protocol.params.x_offset # type: ignore[attr-defined] negative = protocol.params.negative # type: ignore[attr-defined] + trash_lid = protocol.params.trash_lid # type: ignore[attr-defined] + if negative: x_offset = x_offset * -1 # Thermocycler @@ -73,6 +76,7 @@ def run(protocol: ProtocolContext) -> None: plate_in_cycler = thermocycler.load_labware( "armadillo_96_wellplate_200ul_pcr_full_skirt" ) + trash_bin = protocol.load_trash_bin("A3") thermocycler.open_lid() # Load Lids lid_stack_1 = helpers.load_disposable_lids(protocol, lids_in_stack, ["D2"]) @@ -86,11 +90,12 @@ def run(protocol: ProtocolContext) -> None: lids = [lid_stack_1, lid_stack_2, lid_stack_3, lid_stack_4, lid_stack_5] for lid_list in lids: lid_to_move = lid_list[0] - - lid_to_move_back_to = lid_list[1] protocol.comment(f"Offset {x_offset}, Lid # {slot+1}") # move lid to plate in thermocycler protocol.move_labware( lid_to_move, plate_in_cycler, use_gripper=True, drop_offset=drop_offset ) - protocol.move_labware(lid_to_move, lid_to_move_back_to, use_gripper=True) + if trash_lid: + protocol.move_labware(lid_to_move, trash_bin, use_gripper=True) + else: + protocol.move_labware(lid_to_move, lid_list[1], use_gripper=True) diff --git a/abr-testing/abr_testing/tools/abr_scale.py b/abr-testing/abr_testing/tools/abr_scale.py index a35fee93fbf..e91abf114b2 100644 --- a/abr-testing/abr_testing/tools/abr_scale.py +++ b/abr-testing/abr_testing/tools/abr_scale.py @@ -149,14 +149,11 @@ def get_most_recent_run_and_record( headers, runs_and_lpc, headers_lpc, - list_of_heights, ) = abr_google_drive.create_data_dictionary( most_recent_run_id, storage_directory, "", - labware, - accuracy, - hellma_plate_standards=hellma_file_values, + hellma_file_values, ) google_sheet_abr_data = google_sheets_tool.google_sheet( credentials_path, "ABR-run-data", tab_number=0 @@ -164,15 +161,6 @@ def get_most_recent_run_and_record( start_row = google_sheet_abr_data.get_index_row() + 1 google_sheet_abr_data.batch_update_cells(runs_and_robots, "A", start_row, "0") print("Wrote run to ABR-run-data") - # Add liquid height detection to abr sheet - google_sheet_ldf = google_sheets_tool.google_sheet( - credentials_path, "ABR-run-data", 4 - ) - start_row_lhd = google_sheet_ldf.get_index_row() + 1 - google_sheet_ldf.batch_update_cells( - list_of_heights, "A", start_row_lhd, "1795535088" - ) - print("Wrote found liquid heights to ABR-run-data") # Add LPC to google sheet google_sheet_lpc = google_sheets_tool.google_sheet( credentials_path, "ABR-LPC", tab_number=0