Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(abr-testing): Flex stacker protocol edits #17159

Open
wants to merge 10 commits into
base: edge
Choose a base branch
from
Original file line number Diff line number Diff line change
Expand Up @@ -57,43 +57,41 @@ def run(protocol: ProtocolContext) -> None:
single_channel_mount = protocol.params.pipette_mount_1 # type: ignore[attr-defined]
eight_channel_mount = protocol.params.pipette_mount_2 # type: ignore[attr-defined]
deactivate_modules_bool = protocol.params.deactivate_modules # type: ignore[attr-defined]
helpers.comment_protocol_version(protocol, "01")
helpers.comment_protocol_version(protocol, "02")

MIX_SPEED = heater_shaker_speed
MIX_SEC = 10

# if on deck:
INCUBATION_SPEED = heater_shaker_speed * 0.5
INCUBATION_MIN = 60
# load labware

sample_plate_1 = protocol.load_labware(
"nest_96_wellplate_2ml_deep", "B2", "sample plate 1"
# load labware stacker
stacker_deep_wells = helpers.load_stacker_module(
protocol, "PS241204SZEVT22", "C4", "nest_96_wellplate_2ml_deep"
)
sample_plate_2 = protocol.load_labware(
"nest_96_wellplate_2ml_deep", "C4", "sample plate 2"
)

# load labware
sample_plate_1 = stacker_deep_wells.unload_and_move_labware("B2")
wash_res = protocol.load_labware("nest_12_reservoir_15ml", "B1", "wash")
reagent_res = protocol.load_labware(
"opentrons_15_tuberack_nest_15ml_conical", "C3", "reagents"
)
waste_res = protocol.load_labware("nest_1_reservoir_290ml", "D2", "Liquid Waste")

tips = protocol.load_labware("opentrons_flex_96_tiprack_1000ul", "B3")
tips_sample = protocol.load_labware(
"opentrons_flex_96_tiprack_1000ul", "A2", "sample tips"
# stacker 1: 1000 ul tips
tip_stacker_1000 = helpers.load_stacker_module(
protocol, "PS241204SZEVT25", "B4", "opentrons_flex_96_tiprack_1000ul"
)
# Unload tip racks
tips = tip_stacker_1000.unload_and_move_labware("B3")
tips_sample = tip_stacker_1000.unload_and_move_labware("A2")
tips_sample_loc = tips_sample.wells()[:95]
tips_reused = tip_stacker_1000.unload_and_move_labware("C2")
tips_reused_loc = tips_reused.wells()[:95]
tip_rack_list: List[Labware] = [tips, tips_sample, tips_reused]
if READY_FOR_SDSPAGE == 0:
tips_elu = protocol.load_labware(
"opentrons_flex_96_tiprack_1000ul", "A1", "elution tips"
)
tips_elu = tip_stacker_1000.unload_and_move_labware("A1")
tips_elu_loc = tips_elu.wells()[:95]
tips_reused = protocol.load_labware(
"opentrons_flex_96_tiprack_1000ul", "C2", "reused tips"
)
tips_reused_loc = tips_reused.wells()[:95]
tip_rack_list.append(tips_elu)

p1000 = protocol.load_instrument(
"flex_8channel_1000", eight_channel_mount, tip_racks=[tips]
)
Expand All @@ -103,24 +101,21 @@ def run(protocol: ProtocolContext) -> None:
h_s: HeaterShakerContext = protocol.load_module(
helpers.hs_str, "D1"
) # type: ignore[assignment]
working_plate, h_s_adapter = helpers.load_hs_adapter_and_labware(
"nest_96_wellplate_2ml_deep", h_s, "Working Plate"
)
h_s_adapter = h_s.load_adapter("opentrons_96_deep_well_adapter")
h_s.open_labware_latch()
working_plate = stacker_deep_wells.unload_and_move_labware(h_s_adapter)

if READY_FOR_SDSPAGE == 0:
temp: TemperatureModuleContext = protocol.load_module(
helpers.temp_str, "D3"
) # type: ignore[assignment]
final_plate, temp_adapter = helpers.load_temp_adapter_and_labware(
"nest_96_wellplate_2ml_deep", temp, "Final Plate"
)
temp_adapter = temp.load_adapter("opentrons_96_deep_well_adapter")
final_plate = stacker_deep_wells.unload_and_move_labware(temp_adapter)
mag: MagneticBlockContext = protocol.load_module(
helpers.mag_str, "C1"
) # type: ignore[assignment]

# liquids
samples1 = sample_plate_1.rows()[0][:NUM_COL] # 1
samples2 = sample_plate_2.rows()[0][:NUM_COL] # 1
beads = reagent_res.wells()[0] # 2
ab = reagent_res.wells()[1] # 3
elu = reagent_res.wells()[2] # 4
Expand All @@ -139,7 +134,6 @@ def run(protocol: ProtocolContext) -> None:
"Elution": [{"well": elu, "volume": 9800.0}],
"Wash": [{"well": wash, "volume": 1500.0}],
"Samples 1": [{"well": samples1, "volume": 250.0}],
"Samples 2": [{"well": samples2, "volume": 250.0}],
}
helpers.find_liquid_height_of_loaded_liquids(
protocol, liquid_vols_and_wells, p1000_single
Expand Down Expand Up @@ -289,11 +283,21 @@ def run(sample_plate: Labware) -> None:

run(sample_plate_1)
# swap plates
protocol.move_labware(sample_plate_1, "B4", True)
protocol.move_labware(sample_plate_2, "B2", True)
helpers.move_labware_to_destination(
protocol=protocol,
labware=sample_plate_1,
dest="B4",
use_gripper=True,
flex_stacker=True,
)
sample_plate_2 = stacker_deep_wells.unload_and_move_labware("B2")
stacker_deep_wells.move_and_store_labware(sample_plate_1)

run(sample_plate_2)

helpers.clean_up_plates(p1000_single, [wash_res], waste, 1000)
helpers.find_liquid_height_of_all_wells(protocol, p1000_single, [waste_res["A1"]])
# reload tip racks and labware
helpers.move_to_stacker_and_store(tip_stacker_1000, tip_rack_list)
if deactivate_modules_bool:
helpers.deactivate_modules(protocol)
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
MagneticBlockContext,
ThermocyclerContext,
)
from typing import List, Tuple, Dict
from typing import List, Dict, Tuple

metadata = {
"protocolName": "KAPA HyperPlus Library Preparation",
Expand All @@ -39,8 +39,8 @@ def add_parameters(parameters: ParameterContext) -> None:
default=False,
)
helpers.create_disposable_lid_parameter(parameters)
helpers.create_tc_lid_deck_riser_parameter(parameters)
helpers.create_two_pipette_mount_parameters(parameters)
helpers.create_tc_lid_deck_riser_parameter(parameters)
helpers.create_deactivate_modules_parameter(parameters)
parameters.add_int(
variable_name="num_samples",
Expand Down Expand Up @@ -78,7 +78,7 @@ def run(protocol: ProtocolContext) -> None:
pipette_1000_mount = protocol.params.pipette_mount_1 # type: ignore[attr-defined]
pipette_50_mount = protocol.params.pipette_mount_2 # type: ignore[attr-defined]
deck_riser = protocol.params.deck_riser # type: ignore[attr-defined]
helpers.comment_protocol_version(protocol, "01")
helpers.comment_protocol_version(protocol, "02")

REUSE_ETOH_TIPS = True
REUSE_RSB_TIPS = (
Expand All @@ -95,6 +95,10 @@ def run(protocol: ProtocolContext) -> None:
trash_tips = False

num_cols = math.ceil(num_samples / 8)
unused_lids: List[Labware] = []
# Load TC Lids
if disposable_lid:
unused_lids = helpers.load_disposable_lids(protocol, 5, ["D3"], deck_riser)

# Pre-set parameters
# sample_vol = 35.0
Expand All @@ -121,49 +125,52 @@ def run(protocol: ProtocolContext) -> None:
temp_mod: TemperatureModuleContext = protocol.load_module(
helpers.temp_str, "B3"
) # type: ignore[assignment]
temp_plate, temp_adapter = helpers.load_temp_adapter_and_labware(
"armadillo_96_wellplate_200ul_pcr_full_skirt",
temp_mod,
"Temp Module Reservoir Plate",
temp_adapter = temp_mod.load_adapter("opentrons_96_well_aluminum_block")
tip_stacker_200 = helpers.load_stacker_module(
protocol, "PS241204SZEVT24", "D4", "opentrons_flex_96_tiprack_200ul"
)
tip_stacker_50 = helpers.load_stacker_module(
protocol, "PS241204SZEVT26", "A4", "opentrons_flex_96_tiprack_50ul"
)
tip_stacker_plates = helpers.load_stacker_module(
protocol, "PS241204SZEVT18", "C4", "armadillo_96_wellplate_200ul_pcr_full_skirt"
)

if not dry_run:
temp_mod.set_temperature(4)
tc_mod: ThermocyclerContext = protocol.load_module(helpers.tc_str) # type: ignore[assignment]
# Just in case
tc_mod.open_lid()
# Unload Armadillo plates
FLP_plate = tip_stacker_plates.unload_and_move_labware(magblock)

FLP_plate = magblock.load_labware(
"armadillo_96_wellplate_200ul_pcr_full_skirt", "FLP Plate"
)
samples_flp = FLP_plate.rows()[0][:num_cols]

sample_plate = protocol.load_labware(
"armadillo_96_wellplate_200ul_pcr_full_skirt", "D1", "Sample Plate 1"
)

sample_plate_2 = protocol.load_labware(
"armadillo_96_wellplate_200ul_pcr_full_skirt", "B2", "Sample Plate 2"
)
sample_plate = tip_stacker_plates.unload_and_move_labware("D1")
sample_plate_2 = tip_stacker_plates.unload_and_move_labware("B2")
temp_plate = tip_stacker_plates.unload_and_move_labware(temp_adapter)
samples_2 = sample_plate_2.rows()[0][:num_cols]
samples = sample_plate.rows()[0][:num_cols]
reservoir = protocol.load_labware(
"nest_96_wellplate_2ml_deep", "C2", "Beads + Buffer + Ethanol"
)
# Load tipracks
tiprack_50_1 = protocol.load_labware("opentrons_flex_96_tiprack_50ul", "A3")
tiprack_50_2 = protocol.load_labware("opentrons_flex_96_tiprack_50ul", "A2")

tiprack_200_1 = protocol.load_labware("opentrons_flex_96_tiprack_200ul", "C1")
tiprack_200_2 = protocol.load_labware("opentrons_flex_96_tiprack_200ul", "C3")
# Unload tipracks
tiprack_50_locations = ["A2", "A3"]
tiprack_200_locations = ["C1", "C3"]
tipracks_50 = []
tipracks_200 = []

# Unload 50 ul tips
for tip_rack_destination_50 in tiprack_50_locations:
tip_rack_50 = tip_stacker_50.unload_and_move_labware(tip_rack_destination_50)
tipracks_50.append(tip_rack_50)
# Unload 200 ul tips
for tip_rack_destination_200 in tiprack_200_locations:
tip_rack_200 = tip_stacker_200.unload_and_move_labware(tip_rack_destination_200)
tipracks_200.append(tip_rack_200)

if trash_tips:
protocol.load_waste_chute()

unused_lids: List[Labware] = []
# Load TC Lids
if disposable_lid:
unused_lids = helpers.load_disposable_lids(protocol, 5, ["C4"], deck_riser)
# Import Global Variables

global tip50
Expand All @@ -175,10 +182,10 @@ def run(protocol: ProtocolContext) -> None:
p200 = protocol.load_instrument(
"flex_8channel_1000",
pipette_1000_mount,
tip_racks=[tiprack_200_1, tiprack_200_2],
tip_racks=tipracks_200,
)
p50 = protocol.load_instrument(
"flex_8channel_50", pipette_50_mount, tip_racks=[tiprack_50_1, tiprack_50_2]
"flex_8channel_50", pipette_50_mount, tip_racks=tipracks_50
)

# Load Reagent Locations in Reservoirs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def run(protocol: ProtocolContext) -> None:
deck_riser = protocol.params.deck_riser # type: ignore[attr-defined]
trash_lid = protocol.params.trash_lid # type: ignore[attr-defined]
deactivate_modules_bool = protocol.params.deactivate_modules # type: ignore[attr-defined]
helpers.comment_protocol_version(protocol, "01")
helpers.comment_protocol_version(protocol, "02")

unused_lids: List[Labware] = []
used_lids: List[Labware] = []
Expand Down Expand Up @@ -333,7 +333,12 @@ def tipcheck() -> None:
unused_lids,
used_lids,
) = helpers.use_disposable_lid_with_tc(
protocol, unused_lids, used_lids, sample_plate_1, thermocycler
protocol,
unused_lids,
used_lids,
sample_plate_1,
thermocycler,
flex_stacker=True,
)
else:
thermocycler.close_lid()
Expand Down Expand Up @@ -417,6 +422,7 @@ def tipcheck() -> None:
used_lids,
sample_plate_1,
thermocycler,
flex_stacker=True,
)
else:
thermocycler.close_lid()
Expand Down Expand Up @@ -736,6 +742,7 @@ def tipcheck() -> None:
used_lids,
sample_plate_1,
thermocycler,
flex_stacker=True,
)
else:
thermocycler.close_lid()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,21 +130,42 @@ def move_to_locations(

def reset_labware() -> None:
"""Reset the labware to the reset location."""
protocol.move_labware(
labware_to_move, reset_location, use_gripper=use_gripper
)
if reset_location in ["C4"] or helpers.get_parent(labware_to_move) in [
"C4"
]:
helpers.move_labware_to_destination(
protocol=protocol,
labware=labware_to_move,
dest=reset_location,
use_gripper=True,
flex_stacker=True,
)
else:
protocol.move_labware(
labware_to_move, reset_location, use_gripper=use_gripper
)

if len(move_locations) == 0:
return

for location in move_locations:
protocol.move_labware(
labware_to_move, location, use_gripper=use_gripper
)
if location in ["C4"] or helpers.get_parent(labware_to_move) in [
"C4",
]:
helpers.move_labware_to_destination(
protocol=protocol,
labware=labware_to_move,
dest=location,
use_gripper=True,
flex_stacker=True,
)
else:
protocol.move_labware(
labware_to_move, location, use_gripper=use_gripper
)

if reset_after_each_move:
reset_labware()

if not reset_after_each_move:
reset_labware()

Expand Down Expand Up @@ -214,7 +235,6 @@ def staging_area_slot_4_moves(labware: Labware, reset_location: str) -> None:
h_s_adapter,
], # Module Moves
]

run_moves(
labware,
staging_area_slot_4_move_sequence,
Expand Down Expand Up @@ -255,20 +275,28 @@ def module_moves(labware: Labware, module_locations: List) -> None:
)
staging_area_slot_3_moves(dest_pcr_plate, STAGING_AREA_SLOT_3_RESET_LOCATION)

protocol.move_labware(
dest_pcr_plate,
STAGING_AREA_SLOT_4_RESET_LOCATION,
helpers.move_labware_to_destination(
protocol=protocol,
labware=dest_pcr_plate,
dest=STAGING_AREA_SLOT_4_RESET_LOCATION,
use_gripper=USING_GRIPPER,
flex_stacker=True,
)
staging_area_slot_4_moves(dest_pcr_plate, STAGING_AREA_SLOT_4_RESET_LOCATION)

module_locations = [thermocycler] + adapters
module_moves(dest_pcr_plate, module_locations)

protocol.move_labware(dest_pcr_plate, thermocycler, use_gripper=USING_GRIPPER)

def test_manual_moves() -> None:
"""Test manual moves."""
protocol.move_labware(source_reservoir, "D4", use_gripper=USING_GRIPPER)
helpers.move_labware_to_destination(
protocol=protocol,
labware=source_reservoir,
dest="D4",
use_gripper=USING_GRIPPER,
flex_stacker=True,
)

def test_pipetting() -> None:
"""Test pipetting."""
Expand Down Expand Up @@ -306,7 +334,13 @@ def test_column_tip_rack_usage() -> None:
)
protocol.comment("------------------------------")
protocol.comment(f"channels {pipette_96_channel.active_channels}")
protocol.move_labware(tip_rack_3, "C3", use_gripper=USING_GRIPPER)
helpers.move_labware_to_destination(
protocol=protocol,
labware=tip_rack_3,
dest="C3",
use_gripper=USING_GRIPPER,
flex_stacker=True,
)
for well in list_of_columns:
tiprack_well = "A" + str(well)
well_name = "A" + str(well)
Expand Down
Loading
Loading