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

Test heater shaker #4126

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
SHELL := /bin/bash

MONOREPO_URI := https://github.com/Opentrons/opentrons.git
OT2_VERSION_TAG := v4.3.0
OT2_VERSION_TAG := v6.1.0
OT2_MONOREPO_DIR := ot2monorepoClone

# Parsers output to here
Expand Down Expand Up @@ -30,7 +30,7 @@ setup:

venvs/ot2:
mkdir -p venvs
virtualenv venvs/ot2
virtualenv -p=3.8 venvs/ot2
source venvs/ot2/bin/activate && \
pip install -e otcustomizers && \
pip install -r protolib/requirements.txt && \
Expand Down
2 changes: 1 addition & 1 deletion protoBuilds/118e8c/118e8c.ot2.apiv2.py.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion protoBuilds/121d15-4/manual_cleave.ot2.apiv2.py.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion protoBuilds/1bcd67/normalization.ot2.apiv2.py.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"content": "import math\nimport json\n\nmetadata = {\n 'protocolName': 'Normalization',\n 'author': 'Nick <[email protected]>',\n 'source': 'Protocol Library',\n 'apiLevel': '2.11'\n}\n\n\ndef run(ctx):\n\n [dil_json_1, dil_json_2, dil_json_3, p1000_mount, m300_mount, final_vol\n ] = get_values( # noqa: F821\n 'dil_json_1', 'dil_json_2', 'dil_json_3', 'p1000_mount', 'm300_mount',\n 'final_vol')\n\n # labware\n dw_plate = ctx.load_labware('thermofisherabgene_96_wellplate_2200ul', '8',\n 'deepwell plate')\n final_dilution_plates = [\n ctx.load_labware('nunc_96_wellplate_500ul', slot,\n f'final dilution plate {i+1}')\n for i, slot in enumerate(['4', '5', '6'])]\n diluent = ctx.load_labware('thermofishernalgene_1_reservoir_300000ul',\n '9', 'diluent').wells()[0]\n tipracks1000 = [\n ctx.load_labware('opentrons_96_tiprack_1000ul', slot)\n for slot in ['10']]\n tipracks300 = [\n ctx.load_labware('opentrons_96_tiprack_300ul', slot)\n for slot in ['7']]\n\n # pipettes\n if p1000_mount == m300_mount:\n raise Exception('Pipette mounts cannot match.')\n p1000 = ctx.load_instrument('p1000_single_gen2', p1000_mount,\n tip_racks=tipracks1000)\n p300 = ctx.load_instrument('p300_multi_gen2', m300_mount,\n tip_racks=tipracks300)\n\n tip_data = {\n 'single': {\n 'count': 0,\n 'tips': [\n well for rack in tipracks300[::-1]\n for col in rack.columns()[::-1]\n for well in col[::-1]]\n },\n 'multi': {\n 'count': 0,\n 'tips': [well for rack in tipracks300 for well in rack.rows()[0]]\n }\n }\n\n def pickup_p300(mode='single'):\n current = 0.1 if mode == 'single' else 0.5\n ctx._implementation._hw_manager.hardware._attached_instruments[\n p300._implementation.get_mount()].update_config_item(\n 'pick_up_current', current)\n\n p300.pick_up_tip(tip_data[mode]['tips'][tip_data[mode]['count']])\n tip_data[mode]['count'] += 1\n\n def extract_well_name(well_obj):\n return well_obj.display_name.split(' ')[0]\n\n def custom_transfer(vol, source, dest, pip=p300):\n num_trans = math.ceil(vol/pip.max_volume)\n vol_per_trans = vol/num_trans\n for n in range(num_trans):\n pip.aspirate(vol_per_trans, source)\n pip.dispense(vol_per_trans, dest)\n\n def determine_dil(col):\n rows = 'ABCDEFGH'\n col = dw_plate.rows()[0].index(col)\n dict = [dict1, dict2, dict3][col % 3]\n wells_to_check = [row + str(col+1) for row in rows]\n for well in wells_to_check:\n if dict[well]:\n return True\n return False\n\n # pre-parse `None` to `null`\n dil_json_1 = dil_json_1.replace('None', 'null')\n dil_json_2 = dil_json_2.replace('None', 'null')\n dil_json_3 = dil_json_3.replace('None', 'null')\n\n # read .json files as dictionaries\n dict1 = json.loads(dil_json_1)\n dict2 = json.loads(dil_json_2)\n dict3 = json.loads(dil_json_3)\n\n map_dil_wells = {\n well_set[0]: {\n well_set[0]: dict1[extract_well_name(well_set[0])],\n well_set[1]: dict2[extract_well_name(well_set[1])],\n well_set[2]: dict3[extract_well_name(well_set[2])]\n }\n for well_set in [\n row[i*3:(i+1)*3] for i in range(4) for row in dw_plate.rows()]\n }\n\n final_locations = []\n for key, dict in map_dil_wells.items():\n final_well = None\n for well, vol in dict.items():\n if vol:\n final_well = well\n final_locations.append(final_well)\n\n # pre-add diluent\n pickup_p300('multi')\n for col in dw_plate.rows()[0]:\n if determine_dil(col):\n for _ in range(4): # 4x 200ul = 800ul\n p300.transfer(200, diluent, col, new_tip='never')\n p300.drop_tip()\n\n # prompt user to transfer neat sample\n display_wells = [\n well for well, vol in dict1.items() if vol]\n display_vols = [\n round(vol, 2) for vol in dict1.values() if vol]\n sample_str = '\\n'.join([\n f'Transfer {display_vol}uL to well {display_well} of deepwell \\\nplate on slot 8.'\n for display_well, display_vol in zip(display_wells, display_vols)])\n ctx.pause(msg=sample_str)\n\n # perform dilutions\n for set in map_dil_wells.values():\n for i, (well, vol) in enumerate(set.items()):\n if i > 0 and vol: # neat is manually added\n if vol <= 200:\n pip = p300\n pickup_p300('single')\n else:\n pip = p1000\n p1000.pick_up_tip()\n custom_transfer(vol, list(set.keys())[i-1], well, pip)\n pip.mix(5, 200, well)\n pip.drop_tip()\n\n # final transfer\n final_targets = [\n well for plate in final_dilution_plates for well in plate.rows()[0]]\n\n for source, dest in zip(final_locations, final_targets):\n if source:\n col = int(source.display_name.split(' ')[0][1:])\n if col % 3 == 1:\n pip.mix(5, 200, source)\n p1000.transfer(final_vol, source, dest)\n",
"content": "import math\nimport json\n\nmetadata = {\n 'protocolName': 'Normalization',\n 'author': 'Nick <[email protected]>',\n 'source': 'Protocol Library',\n 'apiLevel': '2.11'\n}\n\n\ndef run(ctx):\n\n [dil_json_1, dil_json_2, dil_json_3, p1000_mount, m300_mount, final_vol\n ] = get_values( # noqa: F821\n 'dil_json_1', 'dil_json_2', 'dil_json_3', 'p1000_mount', 'm300_mount',\n 'final_vol')\n\n # labware\n dw_plate = ctx.load_labware('thermofisherabgene_96_wellplate_2200ul', '8',\n 'deepwell plate')\n final_dilution_plates = [\n ctx.load_labware('nunc_96_wellplate_500ul', slot,\n f'final dilution plate {i+1}')\n for i, slot in enumerate(['4', '5', '6'])]\n diluent = ctx.load_labware('thermofishernalgene_1_reservoir_300000ul',\n '9', 'diluent').wells()[0]\n tipracks1000 = [\n ctx.load_labware('opentrons_96_tiprack_1000ul', slot)\n for slot in ['10']]\n tipracks300 = [\n ctx.load_labware('opentrons_96_tiprack_300ul', slot)\n for slot in ['7']]\n\n # pipettes\n if p1000_mount == m300_mount:\n raise Exception('Pipette mounts cannot match.')\n p1000 = ctx.load_instrument('p1000_single_gen2', p1000_mount,\n tip_racks=tipracks1000)\n p300 = ctx.load_instrument('p300_multi_gen2', m300_mount,\n tip_racks=tipracks300)\n\n tip_data = {\n 'single': {\n 'count': 0,\n 'tips': [\n well for rack in tipracks300[::-1]\n for col in rack.columns()[::-1]\n for well in col[::-1]]\n },\n 'multi': {\n 'count': 0,\n 'tips': [well for rack in tipracks300 for well in rack.rows()[0]]\n }\n }\n\n def pickup_p300(mode='single'):\n current = 0.1 if mode == 'single' else 0.5\n ctx._hw_manager.hardware._attached_instruments[\n p300._implementation.get_mount()].update_config_item(\n 'pick_up_current', current)\n\n p300.pick_up_tip(tip_data[mode]['tips'][tip_data[mode]['count']])\n tip_data[mode]['count'] += 1\n\n def extract_well_name(well_obj):\n return well_obj.display_name.split(' ')[0]\n\n def custom_transfer(vol, source, dest, pip=p300):\n num_trans = math.ceil(vol/pip.max_volume)\n vol_per_trans = vol/num_trans\n for n in range(num_trans):\n pip.aspirate(vol_per_trans, source)\n pip.dispense(vol_per_trans, dest)\n\n def determine_dil(col):\n rows = 'ABCDEFGH'\n col = dw_plate.rows()[0].index(col)\n dict = [dict1, dict2, dict3][col % 3]\n wells_to_check = [row + str(col+1) for row in rows]\n for well in wells_to_check:\n if dict[well]:\n return True\n return False\n\n # pre-parse `None` to `null`\n dil_json_1 = dil_json_1.replace('None', 'null')\n dil_json_2 = dil_json_2.replace('None', 'null')\n dil_json_3 = dil_json_3.replace('None', 'null')\n\n # read .json files as dictionaries\n dict1 = json.loads(dil_json_1)\n dict2 = json.loads(dil_json_2)\n dict3 = json.loads(dil_json_3)\n\n map_dil_wells = {\n well_set[0]: {\n well_set[0]: dict1[extract_well_name(well_set[0])],\n well_set[1]: dict2[extract_well_name(well_set[1])],\n well_set[2]: dict3[extract_well_name(well_set[2])]\n }\n for well_set in [\n row[i*3:(i+1)*3] for i in range(4) for row in dw_plate.rows()]\n }\n\n final_locations = []\n for key, dict in map_dil_wells.items():\n final_well = None\n for well, vol in dict.items():\n if vol:\n final_well = well\n final_locations.append(final_well)\n\n # pre-add diluent\n pickup_p300('multi')\n for col in dw_plate.rows()[0]:\n if determine_dil(col):\n for _ in range(4): # 4x 200ul = 800ul\n p300.transfer(200, diluent, col, new_tip='never')\n p300.drop_tip()\n\n # prompt user to transfer neat sample\n display_wells = [\n well for well, vol in dict1.items() if vol]\n display_vols = [\n round(vol, 2) for vol in dict1.values() if vol]\n sample_str = '\\n'.join([\n f'Transfer {display_vol}uL to well {display_well} of deepwell \\\nplate on slot 8.'\n for display_well, display_vol in zip(display_wells, display_vols)])\n ctx.pause(msg=sample_str)\n\n # perform dilutions\n for set in map_dil_wells.values():\n for i, (well, vol) in enumerate(set.items()):\n if i > 0 and vol: # neat is manually added\n if vol <= 200:\n pip = p300\n pickup_p300('single')\n else:\n pip = p1000\n p1000.pick_up_tip()\n custom_transfer(vol, list(set.keys())[i-1], well, pip)\n pip.mix(5, 200, well)\n pip.drop_tip()\n\n # final transfer\n final_targets = [\n well for plate in final_dilution_plates for well in plate.rows()[0]]\n\n for source, dest in zip(final_locations, final_targets):\n if source:\n col = int(source.display_name.split(' ')[0][1:])\n if col % 3 == 1:\n pip.mix(5, 200, source)\n p1000.transfer(final_vol, source, dest)\n",
"custom_labware_defs": [
{
"brand": {
Expand Down
Loading