Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
“ramifarawi” committed Nov 14, 2023
1 parent 659401c commit e56ff4d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion protoBuilds/5c7384/mass_spec_sample_prep.ot2.apiv2.py.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"content": "import math\n\nmetadata = {\n 'protocolName': 'Mass Spec Sample Prep',\n 'author': 'Nick <[email protected]',\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 ctx.pause('Place plate in thermocycler')\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 <[email protected]',\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.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 ctx.pause('Place plate in thermocycler')\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",
"custom_labware_defs": [],
"fields": [
{
Expand Down

0 comments on commit e56ff4d

Please sign in to comment.