Skip to content

Commit

Permalink
clean up plate function, longer pvt1abr9
Browse files Browse the repository at this point in the history
  • Loading branch information
rclarke0 committed Dec 4, 2024
1 parent afb6f35 commit c0f1bbf
Show file tree
Hide file tree
Showing 16 changed files with 318 additions and 179 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ 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")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ def run(ctx: ProtocolContext) -> None:
)
samples_2 = sample_plate_2.rows()[0][:num_cols]
samples = sample_plate.rows()[0][:num_cols]
reservoir = ctx.load_labware("nest_96_wellplate_2ml_deep", "C2")
reservoir = ctx.load_labware("nest_96_wellplate_2ml_deep", "C2", "Liquid Waste")
# Load tipracks
tiprack_50_1 = ctx.load_labware("opentrons_flex_96_tiprack_50ul", "A3")
tiprack_50_2 = ctx.load_labware("opentrons_flex_96_tiprack_50ul", "A2")
Expand Down Expand Up @@ -205,8 +205,8 @@ def run(ctx: ProtocolContext) -> None:
"Adapters": [{"well": adapters, "volume": adapter_vol * 2.0}],
"End Repair Mix": [
{
"well": end_repair_cols,
"volume": (end_repair_vol * num_cols) + (0.1 * end_repair_vol),
"well": temp_plate.wells()[: 8 * num_cols],
"volume": 10.0,
}
],
"Fragmentation Mix": [
Expand Down Expand Up @@ -981,7 +981,6 @@ def lib_cleanup_2() -> None:
lib_cleanup_2()

# Probe liquid waste
reservoir.label = "Liquid Waste" # type: ignore[attr-defined]
waste1 = reservoir.columns()[6]
waste1_res = waste1[0]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
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:
Expand Down Expand Up @@ -79,15 +79,15 @@ 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, "A1")
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"
)
Expand Down Expand Up @@ -178,7 +178,7 @@ def run(protocol: ProtocolContext) -> None:
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)
)
Expand Down Expand Up @@ -223,7 +223,7 @@ def run(protocol: ProtocolContext) -> None:
DilutionVol = float(data[current][2])
if DilutionVol != 0 and DilutionVol < 100:
p1000_single.pick_up_tip()
p1000_single.aspirate(DilutionVol, Diluent_2.bottom(z=2))
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)
)
Expand Down Expand Up @@ -269,7 +269,7 @@ def run(protocol: ProtocolContext) -> None:
DilutionVol = float(data[current][2])
if DilutionVol != 0 and DilutionVol < 100:
p1000_single.pick_up_tip()
p1000_single.aspirate(DilutionVol, Diluent_2.bottom(z=2))
p1000_single.aspirate(DilutionVol, Diluent_2.bottom(z=dot_bottom))
p1000_single.dispense(
DilutionVol, sample_plate_3.wells_by_name()[CurrentWell].top(z=0.2)
)
Expand Down Expand Up @@ -315,7 +315,7 @@ def run(protocol: ProtocolContext) -> None:
DilutionVol = float(data[current][2])
if DilutionVol != 0 and DilutionVol < 100:
p1000_single.pick_up_tip()
p1000_single.aspirate(DilutionVol, Diluent_2.bottom(z=2))
p1000_single.aspirate(DilutionVol, Diluent_2.bottom(z=dot_bottom))
p1000_single.dispense(
DilutionVol, sample_plate_4.wells_by_name()[CurrentWell].top(z=0.2)
)
Expand All @@ -327,5 +327,14 @@ def run(protocol: ProtocolContext) -> None:
current += 1

current = 0
# Probe heights
helpers.find_liquid_height_of_all_wells(protocol, p1000_single, wells)
# 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"]]
)
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
ThermocyclerContext,
TemperatureModuleContext,
)
from opentrons.protocol_api import SINGLE, Well, ALL
from opentrons.protocol_api import SINGLE, Well
from abr_testing.protocols import helpers
from typing import List, Dict

Expand Down Expand Up @@ -83,9 +83,9 @@ def run(ctx: ProtocolContext) -> None:
mmx_pic: List[Well] = reagent_rack.rows()[0]
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.find_liquid_height_of_loaded_liquids(ctx, liquid_vols_and_wells, p50)
# adding water
Expand Down Expand Up @@ -205,33 +205,7 @@ def run(ctx: ProtocolContext) -> None:
p50.drop_tip()
p50.configure_nozzle_layout(style=SINGLE, start="A1", tip_racks=tiprack_50)
mmx_pic.append(water)
helpers.find_liquid_height_of_all_wells(ctx, p50, mmx_pic)
# Empty Destination plate
p50.configure_nozzle_layout(ALL, tip_racks=[tiprack_50[1]])
first_row = [
"A1",
"A2",
"A3",
"A4",
"A5",
"A6",
"A7",
"A8",
"A9",
"A10",
"A11",
"A12",
]
p50.pick_up_tip()
for row in first_row:
p50.aspirate(50, dest_plate_1[row])
p50.dispense(50, liquid_waste.top())
p50.aspirate(50, dest_plate_1[row])
p50.dispense(50, liquid_waste.top())
p50.aspirate(50, dest_plate_1[row])
p50.dispense(50, liquid_waste.top())
p50.aspirate(50, dest_plate_1[row])
p50.dispense(50, liquid_waste.top())
p50.return_tip()

# Empty plates into liquid waste
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])
Original file line number Diff line number Diff line change
@@ -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,
Expand Down Expand Up @@ -41,7 +46,7 @@ def run(ctx: ProtocolContext) -> None:
tube_rack = ctx.load_labware(
"opentrons_10_tuberack_nest_4x50ml_6x15ml_conical", "C2", "Reagent Tube"
)
tartrazine_tube = tube_rack["A3"]
tartrazine_tube = tube_rack["A1"]
water_tube_1 = tube_rack["A4"]
water_tube_2 = tube_rack["B3"]
sample_plate_1 = ctx.load_labware(
Expand All @@ -61,18 +66,29 @@ def run(ctx: ProtocolContext) -> None:
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")
tiprack_50_4 = ctx.load_labware("opentrons_flex_96_tiprack_50ul", "B2")

tiprack_1000_1 = ctx.load_labware("opentrons_flex_96_tiprack_1000ul", "A2")
tip_racks = [tiprack_50_1, tiprack_50_2, tiprack_50_3]
tip_racks = [tiprack_50_1, tiprack_50_2, tiprack_50_3, tiprack_50_4]

# 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]
)

def _mix_tartrazine(pipette: InstrumentContext, well_to_probe: Well) -> None:
"""Mix Tartrazine."""
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 - 2))
pipette.return_tip()

# Probe wells
liquid_vols_and_wells: Dict[str, List[Dict[str, Well | List[Well] | float]]] = {
"Tartrazine": [{"well": tartrazine_tube, "volume": 45.0}],
"Tartrazine": [{"well": tartrazine_tube, "volume": 5.0}],
"Water": [{"well": [water_tube_1, water_tube_2], "volume": 45.0}],
}
helpers.find_liquid_height_of_loaded_liquids(ctx, liquid_vols_and_wells, p50)
Expand All @@ -83,6 +99,8 @@ def run(ctx: ProtocolContext) -> None:
vol = 0.0
tip_count = 0
for sample_plate in sample_plate_list[:number_of_plates]:
_mix_tartrazine(p50, tartrazine_tube)
tip_count += 1
deck_locations = ["D1", "D2", "C1", "B1"]
p1000.pick_up_tip()
for well in sample_plate.wells():
Expand All @@ -92,19 +110,19 @@ def run(ctx: ProtocolContext) -> None:
tube_of_choice = water_tube_2
p50.pick_up_tip()
p1000.aspirate(190, tube_of_choice)
p1000.air_gap(5)
p1000.air_gap(10)
p1000.dispense(5, well.top())
p1000.dispense(190, well)
vol += 190
height = helpers.find_liquid_height(p50, tartrazine_tube)
p50.aspirate(10, tartrazine_tube.bottom(z=height))
p50.aspirate(10, tartrazine_tube.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()
p50.return_tip()
tip_count += 1
if tip_count >= (96 * 3):
if tip_count >= (96 * 4):
p50.reset_tipracks()
p1000.return_tip()
helpers.move_labware_to_hs(ctx, sample_plate, hs, hs_adapter)
Expand Down Expand Up @@ -145,6 +163,7 @@ def run(ctx: ProtocolContext) -> None:
"SD": standard_deviation,
"Avg Percent Error": avg_percent_error,
}
ctx.comment(f"------plate {sample_plate}. {cv_dict[sample_plate_name]}------")
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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,7 @@ def run(ctx: ProtocolContext) -> None:
dest_pcr_plate = ctx.load_labware(PCR_PLATE_96_NAME, "C2")
liquid_waste = ctx.load_labware("nest_1_reservoir_290ml", "B2", "Liquid Waste")

tip_rack_1 = ctx.load_labware(
TIPRACK_96_NAME, "A4"
)
tip_rack_1 = ctx.load_labware(TIPRACK_96_NAME, "A4")

tip_rack_2 = ctx.load_labware(TIPRACK_96_NAME, "C3")
tip_rack_3 = ctx.load_labware(TIPRACK_96_NAME, "C4")
Expand Down Expand Up @@ -293,28 +291,34 @@ def test_single_tip_pickup_usage() -> None:
ctx.move_labware(tip_rack_2, waste_chute, use_gripper=USING_GRIPPER)

def test_column_tip_rack_usage() -> None:
"""Full Tip Pick Up."""
list_of_columns = list(range(1,13))
not_reversed = list(range(1,13))
list_of_columns.reverse()
"""Column Tip Pick Up."""
list_of_columns = list(range(1, 13))
i = 0
column_racks = [tip_rack_1, tip_rack_3]
pipette_96_channel.configure_nozzle_layout(
style=COLUMN, start="A12", tip_racks=column_racks
)
ctx.comment("------------------------------")
ctx.comment(f"channels {pipette_96_channel.active_channels}")
for rack in column_racks:
ctx.move_labware(rack, "C3", use_gripper = USING_GRIPPER)
for (column,well) in zip(list_of_columns, not_reversed):
tiprack_well = "A" + str(column)
ctx.move_labware(rack, "C3", use_gripper=USING_GRIPPER)
for well in list_of_columns:
tiprack_well = "A" + str(well)
well_name = "A" + str(well)
pipette_96_channel.configure_nozzle_layout(style=COLUMN, start="A12")

pipette_96_channel.liquid_presence_detection = True
pipette_96_channel.pick_up_tip(rack[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.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(rack, waste_chute, use_gripper=USING_GRIPPER)
i +=1
i += 1

test_single_tip_pickup_usage()
test_column_tip_rack_usage()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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."""
Expand Down Expand Up @@ -503,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)
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,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"
Expand Down Expand Up @@ -971,7 +973,6 @@ def tipcheck() -> None:
p200_tips += 1
tipcheck()

reservoir.label = "Liquid Waste" # type: ignore[attr-defined]
Liquid_trash_well_1 = reservoir["A9"]
Liquid_trash_well_2 = reservoir["A10"]
Liquid_trash_well_4 = reservoir["A12"]
Expand Down
Loading

0 comments on commit c0f1bbf

Please sign in to comment.