Skip to content

Commit

Permalink
feat(analyses-snapshot): partial tip test
Browse files Browse the repository at this point in the history
  • Loading branch information
y3rsh committed Aug 1, 2024
1 parent 53e65de commit 83d30ea
Show file tree
Hide file tree
Showing 3 changed files with 43,867 additions and 16 deletions.
7 changes: 7 additions & 0 deletions analyses-snapshot-testing/automation/data/protocols.py
Original file line number Diff line number Diff line change
Expand Up @@ -641,6 +641,13 @@ class Protocols:
robot="Flex",
)

Flex_S_v2_20_P1000_96_PartialTipPickupSmokeTest: Protocol = Protocol(
file_stem="Flex_S_v2_20_P1000_96_PartialTipPickupSmokeTest",
file_extension="py",
robot="Flex",
custom_labware=["hacky_1000ul_flex_tiprack"]
)

OT2_X_v2_18_None_None_duplicateRTPVariableName: Protocol = Protocol(
file_stem="OT2_X_v2_18_None_None_duplicateRTPVariableName",
file_extension="py",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import typing
from typing import Literal, Union, ClassVar, Dict, List, Optional
from dataclasses import dataclass
from opentrons import protocol_api
from opentrons.protocol_api import OFF_DECK, SINGLE, ROW, COLUMN, PARTIAL_COLUMN
Expand All @@ -7,8 +7,8 @@
# Need to add transfer, consolidate, and distribute
# Tip pickup around thermocycler

PipetteNames = typing.Literal["flex_8channel_50", "flex_8channel_1000", "flex_96channel_1000"]
TipRackNames = typing.Literal["opentrons_flex_96_tiprack_1000ul", "opentrons_flex_96_tiprack_200ul", "opentrons_flex_96_tiprack_50ul"]
PipetteNames = Literal["flex_8channel_50", "flex_8channel_1000", "flex_96channel_1000"]
TipRackNames = Literal["opentrons_flex_96_tiprack_1000ul", "opentrons_flex_96_tiprack_200ul", "opentrons_flex_96_tiprack_50ul"]

NUM_ROWS_IN_TIPRACK = 8
NUM_COLUMNS_IN_TIPRACK = 12
Expand All @@ -21,12 +21,12 @@
class LiquidTransferSettings:
source_labware_deck_slot: str
destination_labware_deck_slot: str
transfer_volume: int = LIQUID_TRANSFER_AMOUNT
transfer_volume: float = LIQUID_TRANSFER_AMOUNT


@dataclass
class PipetteConfiguration:
num_to_row_lookup: typing.ClassVar[typing.Dict[int, str]] = {
num_to_row_lookup: ClassVar[Dict[int, str]] = {
1: "A",
2: "B",
3: "C",
Expand All @@ -36,7 +36,7 @@ class PipetteConfiguration:
7: "G",
8: "H",
}
number_per_pickup_to_slot_lookup: typing.ClassVar[typing.Dict[int, str]] = {
number_per_pickup_to_slot_lookup: ClassVar[Dict[int, str]] = {
2: "G1",
3: "F1",
4: "E1",
Expand All @@ -45,13 +45,14 @@ class PipetteConfiguration:
7: "B1",
}

pickup_mode: typing.Literal[SINGLE, ROW, COLUMN, PARTIAL_COLUMN]
pickup_mode: Union[Literal["SINGLE"], Literal["ROW"], Literal["COLUMN"], Literal["PARTIAL_COLUMN"]]
starting_pipette_nozzle: str
ending_pipette_nozzle: typing.Optional[str] # for PARTIAL_COLUMN only
ending_pipette_nozzle: Optional[str] # for PARTIAL_COLUMN only

def _calculate_number_per_pickup_for_partial_column(self) -> int:
assert self.pickup_mode == PARTIAL_COLUMN
for num_pickups_key, self.ending_pipette_nozzle in self.number_per_pickup_to_slot_lookup.items():
well_name = self.ending_pipette_nozzle
for num_pickups_key, well_name_key in self.number_per_pickup_to_slot_lookup.items():
if well_name == well_name_key:
return num_pickups_key
else:
Expand All @@ -67,7 +68,7 @@ def _calculate_max_pickups_for_partial_column(self) -> int:

return NUM_COLUMNS_IN_TIPRACK * self._calculate_number_pickups_per_column_for_partial_column()

def _calculate_drop_location_list_for_partial_column(self) -> typing.List[str]:
def _calculate_drop_location_list_for_partial_column(self) -> List[str]:
assert self.pickup_mode == PARTIAL_COLUMN
# we should have the same number of drops as number of pickups
num_drops = self._calculate_number_pickups_per_column_for_partial_column()
Expand All @@ -81,6 +82,8 @@ def _calculate_drop_location_list_for_partial_column(self) -> typing.List[str]:
drop_row = PipetteConfiguration.num_to_row_lookup[(NUM_ROWS_IN_TIPRACK + 1) - (drop_number * num_per_pickup)]
drop_location_list.append(f"{drop_row}{col_number}")

return drop_location_list

@property
def max_number_of_pickups(self) -> int:
match self.pickup_mode.value:
Expand Down Expand Up @@ -447,19 +450,16 @@ def run(protocol_context: protocol_api.ProtocolContext):
raise ValueError("50μL pipette requires 50μL tip rack")

if "8_channel" in PIPETTE_NAME:
PICKUP_CASES = EIGHT_CH_TEST_CASES
raise NotImplementedError("8 channel test cases not yet defined")
# PICKUP_CASES = EIGHT_CH_TEST_CASES
else:
PICKUP_CASES = NINETY_SIX_CH_TEST_CASES

pipette = protocol_context.load_instrument(PIPETTE_NAME, mount="left")
pipette.default_speed = PIPETTING_SPEED

for test_case in PICKUP_CASES:
pickup_tip_rack = protocol_context.load_labware(
load_name=TIP_RACK_NAME,
label="Tip Rack - Full",
location=protocol_api.OFF_DECK
)
pickup_tip_rack = protocol_context.load_labware(load_name=TIP_RACK_NAME, label="Tip Rack - Full", location=protocol_api.OFF_DECK)

drop_tip_rack = protocol_context.load_labware(
load_name=HACKY_FLEX_1000_UL_TIPRACK_LOAD_NAME,
Expand Down
Loading

0 comments on commit 83d30ea

Please sign in to comment.