From 2136fde9225657c275c9a1f68565dc2581eae5b8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E2=80=9Cramifarawi=E2=80=9D?=
 <“rami.farawi@opentrons.com”>
Date: Mon, 13 Nov 2023 12:53:30 -0500
Subject: [PATCH] fix

---
 .../5c7384/mass_spec_sample_prep.ot2.apiv2.py.json | 14 +++++++++-----
 protocols/2bba96/2bba96.ot2.apiv2.py               |  5 ++---
 .../5c7384/mass_spec_sample_prep.ot2.apiv2.py      |  2 +-
 3 files changed, 12 insertions(+), 9 deletions(-)

diff --git a/protoBuilds/5c7384/mass_spec_sample_prep.ot2.apiv2.py.json b/protoBuilds/5c7384/mass_spec_sample_prep.ot2.apiv2.py.json
index e2068d7f1..4b6e43d48 100644
--- a/protoBuilds/5c7384/mass_spec_sample_prep.ot2.apiv2.py.json
+++ b/protoBuilds/5c7384/mass_spec_sample_prep.ot2.apiv2.py.json
@@ -1,5 +1,5 @@
 {
-    "content": "import math\n\nmetadata = {\n    'protocolName': 'Mass Spec Sample Prep',\n    'author': 'Nick <ndiehl@opentrons.com',\n    'source': 'Custom Protocol Request',\n    'apiLevel': '2.9'\n}\n\n\ndef run(ctx):\n\n    [num_samples, p20_type, p300_type, p20_mount, p300_mount, plate_def,\n     module_type] = get_values(  # noqa: F821\n        'num_samples', 'p20_type', 'p300_type', 'p20_mount', 'p300_mount',\n        'plate_def', 'module_type')\n\n    waste = ctx.load_labware('nest_1_reservoir_195ml', '1',\n                             'waste container (load empty)').wells()[0].top()\n    tips20 = [\n        ctx.load_labware('opentrons_96_tiprack_20ul', slot)\n        for slot in ['6']]\n    tips300 = [\n        ctx.load_labware('opentrons_96_tiprack_300ul', slot)\n        for slot in ['9']]\n    magdeck = ctx.load_module('magnetic module gen2', '4')\n    mag_plate = magdeck.load_labware(plate_def)\n    reagent_plate = ctx.load_labware(plate_def, '5', 'reagent plate')\n    etoh_plate = ctx.load_labware(plate_def, '2', 'ethanol plate')\n    acetonitrile_plate = ctx.load_labware(\n        plate_def, '3', 'acetonitrile plate')\n    if module_type == 'thermocycler':\n        temp_module = ctx.load_module('thermocycler')\n        heat_func = temp_module.set_block_temperature\n    else:\n        tips20.insert(-1, ctx.load_labware('opentrons_96_tiprack_20ul', '8'))\n        tips300.insert(\n            -1, ctx.load_labware('opentrons_96_tiprack_300ul', '11'))\n        temp_module = ctx.load_module('temperature module gen2', '7')\n        heat_func = temp_module.set_temperature\n\n    sample_plate = temp_module.load_labware(plate_def, 'sample plate')\n    num_cols = math.ceil(num_samples/8)\n    samples_s = sample_plate.wells()[:num_samples]\n    samples_m = sample_plate.rows()[0][:num_cols]\n    mag_samples_s = mag_plate.wells()[:num_samples]\n    mag_samples_m = mag_plate.rows()[0][:num_cols]\n\n    p20 = ctx.load_instrument(p20_type, p20_mount, tip_racks=tips20)\n    p300 = ctx.load_instrument(p300_type, p300_mount,\n                               tip_racks=tips300)\n\n    if p20.channels == 1:\n        dtt = reagent_plate.columns()[0]\n        caa = reagent_plate.columns()[1]\n        mag_bead_stock = reagent_plate.columns()[2]\n        acetonitrile = acetonitrile_plate.wells()[:num_samples]\n    else:\n        dtt = reagent_plate.rows()[0][0]\n        caa = reagent_plate.rows()[0][1]\n        mag_bead_stock = reagent_plate.rows()[0][2]\n        acetonitrile = acetonitrile_plate.rows()[0][:num_cols]\n\n    if p300.channels == 1:\n        etoh = etoh_plate.wells()[:num_samples]\n        abc = reagent_plate.columns()[3:5]\n        trypsin = reagent_plate.columns()[5]\n    else:\n        etoh = etoh_plate.rows()[0][:num_cols]\n        abc = reagent_plate.rows()[0][3:5]\n        trypsin = reagent_plate.rows()[0][5]\n\n    heat_func(60)\n\n    tip_log = {}\n    if p20.channels == 1:\n        tip_list20 = [tip for rack in tips20 for tip in rack.wells()]\n    else:\n        tip_list20 = [tip for rack in tips20 for tip in rack.rows()[0]]\n    if p300.channels == 1:\n        tip_list300 = [tip for rack in tips300 for tip in rack.wells()]\n    else:\n        tip_list300 = [tip for rack in tips300 for tip in rack.rows()[0]]\n\n    tip_log['tips'] = {\n        p20: tip_list20,\n        p300: tip_list300}\n    tip_log['max'] = {\n        p20: len(tip_log['tips'][p20]),\n        p300: len(tip_log['tips'][p300])}\n    tip_log['count'] = {p20: 0, p300: 0}\n\n    def _pick_up(pip, loc=None):\n        if tip_log['count'][pip] == tip_log['max'][pip] and not loc:\n            ctx.pause('Replace ' + str(pip.max_volume) + '\u00b5l tipracks before \\\nresuming.')\n            pip.reset_tipracks()\n            tip_log['count'][pip] = 0\n        if loc:\n            pip.pick_up_tip(loc)\n        else:\n            pip.pick_up_tip(tip_log['tips'][pip][tip_log['count'][pip]])\n            tip_log['count'][pip] += 1\n\n    \"\"\" Reduction and Alkylation \"\"\"\n    samples = samples_s if p20.channels == 1 else samples_m\n    for i, s in enumerate(samples):\n        _pick_up(p20)\n        p20.transfer(5, dtt, s, mix_after=(2, 5), new_tip='never')\n        p20.drop_tip()\n\n    ctx.delay(minutes=30, msg='Incubating 30 minutes at 60C for reduction.')\n\n    for i, s in enumerate(samples):\n        _pick_up(p20)\n        p20.transfer(5, caa, s, mix_after=(2, 5), new_tip='never')\n        p20.drop_tip()\n\n    heat_func(25)\n    ctx.delay(minutes=30, msg='Incubating 30 minutes at RT (25C) for \\\nalkylation.')\n\n    \"\"\" Protein Binding \"\"\"\n    for i, s in enumerate(samples):\n        _pick_up(p20)\n        p20.transfer(5, mag_bead_stock, s, mix_after=(2, 5),\n                     new_tip='never')\n        p20.drop_tip()\n\n    for i, (s, a) in enumerate(zip(samples, acetonitrile)):\n        _pick_up(p20)\n        p20.transfer(15, a, s, mix_after=(2, 20),\n                     new_tip='never')\n        p20.drop_tip(tips20[0].wells()[i])\n\n    ctx.pause('Please move plate from thermocycler to magnetic module. Resume \\\nwhen the plate has been moved.')\n\n    magdeck.engage()\n    ctx.delay(minutes=5, msg='Incubating on magnet for 5 minutes.')\n\n    mag_samples = mag_samples_s if p20.channels == 1 else mag_samples_m\n    for i, m in enumerate(mag_samples):\n        _pick_up(p20, tips20[0].wells()[i])\n        p20.transfer(43, m.bottom(1), waste, new_tip='never')\n        p20.drop_tip()\n\n    \"\"\" Ethanol Wash \"\"\"\n    mag_samples = mag_samples_s if p300.channels == 1 else mag_samples_m\n    for wash in range(2):\n        magdeck.disengage()\n        for i, (m, e) in enumerate(zip(mag_samples, etoh)):\n            _pick_up(p300)\n            p300.transfer(200, e, m, mix_after=(10, 50), new_tip='never')\n            p300.drop_tip(tips300[0].wells()[i])\n\n        magdeck.engage()\n        ctx.delay(minutes=5, msg='Incubating on magnet for 5 minutes.')\n\n        for i, m in enumerate(mag_samples):\n            _pick_up(p300)\n            p300.transfer(230, m.bottom(1), waste, new_tip='never')\n            p300.drop_tip(tips300[0].wells()[i])\n\n        ctx.pause('Please replace the ethanol plate (slot 6) with a fresh \\\nplate of ethanol before resuming.')\n\n    \"\"\" Acetonitrile Wash \"\"\"\n    magdeck.disengage()\n    for i, (m, a) in enumerate(zip(mag_samples, acetonitrile)):\n        _pick_up(p300, tips300[0].wells()[i])\n        p300.transfer(171.5, a, m, mix_after=(10, 50), new_tip='never')\n        p300.drop_tip(tips300[0].wells()[i])\n\n    magdeck.engage()\n    ctx.delay(minutes=5, msg='Incubating on magnet for 5 minutes.')\n\n    for i, m in enumerate(mag_samples):\n        _pick_up(p300, tips300[0].wells()[i])\n        p300.transfer(230, m.bottom(1), waste, new_tip='never')\n        p300.drop_tip()\n\n    \"\"\" On-Bead Digestion \"\"\"\n    if p300.channels == 1:\n        samples = samples_s\n        for i, s in enumerate(samples):\n            _pick_up(p300)\n            p300.transfer(35, abc[i//48][(i % 48) % 8], s, new_tip='never')\n            p300.drop_tip()\n    else:\n        samples = samples_m\n        for i, s in enumerate(samples):\n            _pick_up(p300)\n            p300.transfer(35, abc[i//6], s, new_tip='never')\n            p300.drop_tip()\n\n    if p20.channels == 1:\n        samples = samples_s\n        for i, s in enumerate(samples):\n            _pick_up(p20)\n            p20.transfer(5, trypsin[i % 8], s, mix_after=(2, 5),\n                         new_tip='never')\n            p20.drop_tip()\n    else:\n        samples = samples_m\n        for i, s in enumerate(samples):\n            _pick_up(p20)\n            p20.transfer(5, trypsin, s, mix_after=(2, 5), new_tip='never')\n            p20.drop_tip()\n\n    heat_func(37)\n    ctx.comment('Protocol complete. Please shake the plate from the magnetic \\\nmodule to resuspend the beads, and replace on the thermocycler now set at \\\n37C.')\n",
+    "content": "import math\n\nmetadata = {\n    'protocolName': 'Mass Spec Sample Prep',\n    'author': 'Nick <ndiehl@opentrons.com',\n    'source': 'Custom Protocol Request',\n    'apiLevel': '2.9'\n}\n\n\ndef run(ctx):\n\n    [num_samples, p20_type, p300_type, p20_mount, p300_mount, plate_def,\n     module_type] = get_values(  # noqa: F821\n        'num_samples', 'p20_type', 'p300_type', 'p20_mount', 'p300_mount',\n        'plate_def', 'module_type')\n\n    waste = ctx.load_labware('nest_1_reservoir_195ml', '1',\n                             'waste container (load empty)').wells()[0].top()\n    tips20 = [\n        ctx.load_labware('opentrons_96_tiprack_20ul', slot)\n        for slot in ['6']]\n    tips300 = [\n        ctx.load_labware('opentrons_96_tiprack_300ul', slot)\n        for slot in ['9']]\n    magdeck = ctx.load_module('magnetic module gen2', '4')\n    mag_plate = magdeck.load_labware(plate_def)\n    reagent_plate = ctx.load_labware(plate_def, '5', 'reagent plate')\n    etoh_plate = ctx.load_labware(plate_def, '2', 'ethanol plate')\n    acetonitrile_plate = ctx.load_labware(\n        plate_def, '3', 'acetonitrile plate')\n    if module_type == 'thermocycler':\n        temp_module = ctx.load_module('thermocycler')\n        heat_func = temp_module.set_block_temperature\n    else:\n        tips20.insert(-1, ctx.load_labware('opentrons_96_tiprack_20ul', '8'))\n        tips300.insert(\n            -1, ctx.load_labware('opentrons_96_tiprack_300ul', '11'))\n        temp_module = ctx.load_module('temperature module gen2', '7')\n        heat_func = temp_module.set_temperature\n\n    sample_plate = temp_module.load_labware(plate_def, 'sample plate')\n    num_cols = math.ceil(num_samples/8)\n    samples_s = sample_plate.wells()[:num_samples]\n    samples_m = sample_plate.rows()[0][:num_cols]\n    mag_samples_s = mag_plate.wells()[:num_samples]\n    mag_samples_m = mag_plate.rows()[0][:num_cols]\n\n    p20 = ctx.load_instrument(p20_type, p20_mount, tip_racks=tips20)\n    p300 = ctx.load_instrument(p300_type, p300_mount,\n                               tip_racks=tips300)\n\n    if p20.channels == 1:\n        dtt = reagent_plate.columns()[0]\n        caa = reagent_plate.columns()[1]\n        mag_bead_stock = reagent_plate.columns()[2]\n        acetonitrile = acetonitrile_plate.wells()[:num_samples]\n    else:\n        dtt = reagent_plate.rows()[0][0]\n        caa = reagent_plate.rows()[0][1]\n        mag_bead_stock = reagent_plate.rows()[0][2]\n        acetonitrile = acetonitrile_plate.rows()[0][:num_cols]\n\n    if p300.channels == 1:\n        etoh = etoh_plate.wells()[:num_samples]\n        abc = reagent_plate.columns()[3:5]\n        trypsin = reagent_plate.columns()[5]\n    else:\n        etoh = etoh_plate.rows()[0][:num_cols]\n        abc = reagent_plate.rows()[0][3:5]\n        trypsin = reagent_plate.rows()[0][5]\n\n    heat_func(60)\n\n    tip_log = {}\n    if p20.channels == 1:\n        tip_list20 = [tip for rack in tips20 for tip in rack.wells()]\n    else:\n        tip_list20 = [tip for rack in tips20 for tip in rack.rows()[0]]\n    if p300.channels == 1:\n        tip_list300 = [tip for rack in tips300 for tip in rack.wells()]\n    else:\n        tip_list300 = [tip for rack in tips300 for tip in rack.rows()[0]]\n\n    tip_log['tips'] = {\n        p20: tip_list20,\n        p300: tip_list300}\n    tip_log['max'] = {\n        p20: len(tip_log['tips'][p20]),\n        p300: len(tip_log['tips'][p300])}\n    tip_log['count'] = {p20: 0, p300: 0}\n\n    def _pick_up(pip, loc=None):\n        if tip_log['count'][pip] == tip_log['max'][pip] and not loc:\n            ctx.pause('Replace ' + str(pip.max_volume) + '\u00b5l tipracks before \\\nresuming.')\n            pip.reset_tipracks()\n            tip_log['count'][pip] = 0\n        if loc:\n            pip.pick_up_tip(loc)\n        else:\n            pip.pick_up_tip(tip_log['tips'][pip][tip_log['count'][pip]])\n            tip_log['count'][pip] += 1\n\n    \"\"\" Reduction and Alkylation \"\"\"\n    samples = samples_s if p20.channels == 1 else samples_m\n    for i, s in enumerate(samples):\n        _pick_up(p20)\n        p20.transfer(5, dtt, s, mix_after=(2, 5), new_tip='never')\n        p20.drop_tip()\n\n    ctx.delay(minutes=30, msg='Incubating 30 minutes at 60C for reduction.')\n\n    for i, s in enumerate(samples):\n        _pick_up(p20)\n        p20.transfer(5, caa, s, mix_after=(2, 5), new_tip='never')\n        p20.drop_tip()\n\n    ctx.pause('Put plate back in temperature module.')\n    heat_func(25)\n    ctx.delay(minutes=30, msg='Incubating 30 minutes at RT (25C) for \\\nalkylation.')\n\n    \"\"\" Protein Binding \"\"\"\n    for i, s in enumerate(samples):\n        _pick_up(p20)\n        p20.transfer(5, mag_bead_stock, s, mix_after=(2, 5),\n                     new_tip='never')\n        p20.drop_tip()\n\n    for i, (s, a) in enumerate(zip(samples, acetonitrile)):\n        _pick_up(p20)\n        p20.transfer(15, a, s, mix_after=(2, 20),\n                     new_tip='never')\n        p20.return_tip()\n\n    ctx.pause('Please move plate from thermocycler to magnetic module. Resume \\\nwhen the plate has been moved.')\n\n    magdeck.engage()\n    ctx.delay(minutes=5, msg='Incubating on magnet for 5 minutes.')\n\n    mag_samples = mag_samples_s if p20.channels == 1 else mag_samples_m\n    for i, m in enumerate(mag_samples):\n        _pick_up(p20, tips20[0].wells()[i])\n        p20.transfer(43, m.bottom(1), waste, new_tip='never')\n        p20.drop_tip()\n\n    \"\"\" Ethanol Wash \"\"\"\n    mag_samples = mag_samples_s if p300.channels == 1 else mag_samples_m\n    for wash in range(2):\n        magdeck.disengage()\n        for i, (m, e) in enumerate(zip(mag_samples, etoh)):\n            _pick_up(p300)\n            p300.transfer(200, e, m, mix_after=(10, 50), new_tip='never')\n            p300.return_tip()\n\n        magdeck.engage()\n        ctx.delay(minutes=5, msg='Incubating on magnet for 5 minutes.')\n\n        for i, m in enumerate(mag_samples):\n            _pick_up(p300)\n            p300.transfer(230, m.bottom(1), waste, new_tip='never')\n            p300.return_tip()\n\n        ctx.pause('Please replace the ethanol plate (slot 6) with a fresh \\\nplate of ethanol before resuming.')\n\n    \"\"\" Acetonitrile Wash \"\"\"\n    magdeck.disengage()\n    for i, (m, a) in enumerate(zip(mag_samples, acetonitrile)):\n        _pick_up(p300, tips300[0].wells()[i])\n        p300.transfer(171.5, a, m, mix_after=(10, 50), new_tip='never')\n        p300.return_tip()\n\n    magdeck.engage()\n    ctx.delay(minutes=5, msg='Incubating on magnet for 5 minutes')\n\n    for i, m in enumerate(mag_samples):\n        _pick_up(p300, tips300[0].wells()[i])\n        p300.transfer(230, m.bottom(1), waste, new_tip='never')\n        p300.drop_tip()\n\n    \"\"\" On-Bead Digestion \"\"\"\n    if p300.channels == 1:\n        samples = samples_s\n        for i, s in enumerate(samples):\n            _pick_up(p300)\n            p300.transfer(35, abc[i//48][(i % 48) % 8], s, new_tip='never')\n            p300.drop_tip()\n    else:\n        samples = samples_m\n        for i, s in enumerate(samples):\n            _pick_up(p300)\n            p300.transfer(35, abc[i//6], s, new_tip='never')\n            p300.drop_tip()\n\n    if p20.channels == 1:\n        samples = samples_s\n        for i, s in enumerate(samples):\n            _pick_up(p20)\n            p20.transfer(5, trypsin[i % 8], s, mix_after=(2, 5),\n                         new_tip='never')\n            p20.drop_tip()\n    else:\n        samples = samples_m\n        for i, s in enumerate(samples):\n            _pick_up(p20)\n            p20.transfer(5, trypsin, s, mix_after=(2, 5), new_tip='never')\n            p20.drop_tip()\n\n    heat_func(37)\n    ctx.pause('Put plate back in temperature module')\n    ctx.comment('Protocol complete. Please shake the plate from the magnetic \\\nmodule to resuspend the beads, and replace on the thermocycler now set at \\\n37C.')\n",
     "custom_labware_defs": [],
     "fields": [
         {
@@ -13,11 +13,11 @@
             "name": "p20_type",
             "options": [
                 {
-                    "label": "multi",
+                    "label": "multi (GEN2)",
                     "value": "p20_multi_gen2"
                 },
                 {
-                    "label": "single",
+                    "label": "single (GEN2)",
                     "value": "p20_single_gen2"
                 }
             ],
@@ -28,11 +28,15 @@
             "name": "p300_type",
             "options": [
                 {
-                    "label": "multi",
+                    "label": "multi (GEN2)",
                     "value": "p300_multi_gen2"
                 },
                 {
-                    "label": "single",
+                    "label": "multi (GEN1)",
+                    "value": "p300_multi"
+                },
+                {
+                    "label": "single (GEN2)",
                     "value": "p300_single_gen2"
                 }
             ],
diff --git a/protocols/2bba96/2bba96.ot2.apiv2.py b/protocols/2bba96/2bba96.ot2.apiv2.py
index 51fad9c81..52a716b87 100644
--- a/protocols/2bba96/2bba96.ot2.apiv2.py
+++ b/protocols/2bba96/2bba96.ot2.apiv2.py
@@ -2,12 +2,11 @@
 from types import MethodType
 import math
 import csv
-from opentrons.protocols.api_support.types import APIVersion
 
 metadata = {
     'title': 'Custom Dilution From CSV',
     'author': 'Steve Plonk',
-    'apiLevel': '2.13'
+    'apiLevel': '2.10'
 }
 
 
@@ -71,7 +70,7 @@ def pause_attention(message):
     class WellH(Well):
         def __init__(self, well, min_height=5, comp_coeff=1.15,
                      current_volume=0):
-            super().__init__(well.parent, well._core, APIVersion(2, 13))
+            super().__init__(well._impl)
             self.well = well
             self.min_height = min_height
             self.comp_coeff = comp_coeff
diff --git a/protocols/5c7384/mass_spec_sample_prep.ot2.apiv2.py b/protocols/5c7384/mass_spec_sample_prep.ot2.apiv2.py
index 23d14d549..fa405f08f 100644
--- a/protocols/5c7384/mass_spec_sample_prep.ot2.apiv2.py
+++ b/protocols/5c7384/mass_spec_sample_prep.ot2.apiv2.py
@@ -116,7 +116,7 @@ def _pick_up(pip, loc=None):
         p20.transfer(5, caa, s, mix_after=(2, 5), new_tip='never')
         p20.drop_tip()
 
-    ctx.pause('Put plate back in temperature module')
+    ctx.pause('Put plate back in temperature module.')
     heat_func(25)
     ctx.delay(minutes=30, msg='Incubating 30 minutes at RT (25C) for \
 alkylation.')