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 8f90210 commit 217ec10
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion protoBuilds/0ca318/0ca318.ot2.apiv2.py.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"content": "import math\nfrom opentrons import protocol_api\n\nmetadata = {\n 'protocolName': 'PCR Prep and PCR',\n 'author': 'Rami <[email protected]>',\n 'source': 'Custom Protocol Request',\n 'apiLevel': '2.11'\n}\n\n\ndef run(ctx):\n\n [num_samp, source_type, mmx_type, start_tip,\n p20_mount, m20_mount] = get_values( # noqa: F821\n \"num_samp\", \"source_type\", \"mmx_type\",\n \"start_tip\", \"p20_mount\", \"m20_mount\")\n\n # num_samp = 96\n # source_type = \"tuberack\"\n # p20_mount = \"left\"\n # m20_mount = \"right\"\n\n # load modules\n tc_mod = ctx.load_module('Thermocycler Module')\n tc_mod.open_lid()\n tc_mod.set_lid_temperature(105)\n pcr_plate = tc_mod.load_labware('nest_96_wellplate_100ul_pcr_full_skirt') # noqa: E501\n\n temp_mod = ctx.load_module('temperature module gen2', 3)\n temp_mod.set_temperature(4)\n\n # load labware\n if source_type == \"tuberack\":\n samples_racks = [ctx.load_labware('opentrons_24_tuberack_nest_1.5ml_snapcap', # noqa: E501\n slot) for slot in [4, 5, 1, 2]]\n sample_tubes = [tube for rack in samples_racks\n for row in rack.rows() for tube in row][:num_samp]\n\n if mmx_type == \"mmx_wellplate\":\n mmx_plate = temp_mod.load_labware('opentrons_96_aluminumblock_nest_wellplate_100ul') # noqa: E501\n else:\n mmx_plate = temp_mod.load_labware('opentrons_24_aluminumblock_nest_1.5ml_snapcap') # noqa: E501\n\n tips = [ctx.load_labware('opentrons_96_filtertiprack_20ul', slot)\n for slot in [6, 9]]\n\n # load pipettes\n p20 = ctx.load_instrument('p20_single_gen2', p20_mount,\n tip_racks=tips)\n m20 = ctx.load_instrument('p20_multi_gen2', m20_mount,\n tip_racks=tips)\n all_tips = [tip for rack in tips for tip in rack.wells()]\n start_tip -= 1\n m20.starting_tip = all_tips[start_tip]\n p20.starting_tip = all_tips[start_tip]\n\n def pick_up(pip):\n try:\n pip.pick_up_tip()\n except protocol_api.labware.OutOfTipsError:\n ctx.pause(f\"Replace empty tip rack for {pip}\")\n pip.reset_tipracks()\n pip.pick_up_tip()\n\n # mapping\n num_full_cols = math.floor(num_samp/8)\n dispense_wells = [well for column in pcr_plate.columns()[1:11]\n for well in column[1:7]][:num_samp]\n\n remainder = False if num_samp % 8 == 0 else True\n\n num_mmx_cols = math.ceil(num_samp/24)\n if mmx_type == \"mmx_wellplate\":\n mmx = mmx_plate.rows()[0][:num_mmx_cols]*24\n else:\n mmx = mmx_plate.rows()[0][:num_mmx_cols]*96\n\n unfilled_mmx_col = mmx_plate.rows()[0][5]\n\n if mmx_type == 'mmx_wellplate':\n ctx.comment('\\n\\nTRANSFERRING MASTERMIX TO PLATE\\n')\n m20.pick_up_tip()\n\n for i, (s_col, d_col) in enumerate(zip(\n mmx,\n pcr_plate.rows()[0][:num_full_cols])): # noqa: E501\n if i % 4 == 0 and i > 0:\n if m20.has_tip:\n m20.drop_tip()\n m20.pick_up_tip()\n\n m20.aspirate(10, s_col, rate=0.5)\n m20.dispense(10, d_col, rate=0.5) # noqa: E501\n m20.aspirate(12.5, s_col, rate=0.5)\n m20.dispense(12.5, d_col, rate=0.5) # noqa: E501\n m20.blow_out(d_col.top())\n m20.touch_tip()\n ctx.comment('\\n')\n\n if m20.has_tip:\n m20.drop_tip()\n\n if remainder:\n ctx.comment('\\n\\nTRANSFERRING MASTERMIX TO UNFILLED COLUMN\\n')\n remaining_wells = num_samp % 8\n unfilled_col = pcr_plate.columns()[num_full_cols][:remaining_wells]\n p20.pick_up_tip()\n\n for well in unfilled_col:\n p20.aspirate(10, unfilled_mmx_col, rate=0.5)\n p20.dispense(10, well, rate=0.5) # noqa: E501\n p20.aspirate(12.5, unfilled_mmx_col, rate=0.5)\n p20.dispense(12.5, well, rate=0.5) # noqa: E501\n p20.blow_out(well.top())\n p20.touch_tip()\n p20.drop_tip()\n\n elif mmx_type == \"mmx_tuberack\":\n\n ctx.comment('\\n\\nTRANSFERRING MASTERMIX TO PLATE\\n')\n p20.pick_up_tip()\n\n for i, (s, d) in enumerate(zip(mmx, dispense_wells)):\n\n if i % 4 == 0 and i > 0:\n if p20.has_tip:\n p20.drop_tip()\n p20.pick_up_tip()\n\n p20.aspirate(10, s, rate=0.5)\n p20.dispense(10, d, rate=0.5) # noqa: E501\n p20.aspirate(12.5, s, rate=0.5)\n p20.dispense(12.5, d, rate=0.5) # noqa: E501\n ctx.delay(seconds=1)\n p20.blow_out(d.top())\n p20.touch_tip()\n ctx.comment('\\n')\n p20.drop_tip()\n\n if source_type == \"tuberack\":\n ctx.comment('\\n\\nTRANSFERRING SAMPLE TO PCR PLATE\\n')\n for tube, dest in zip(sample_tubes, dispense_wells):\n p20.pick_up_tip()\n p20.aspirate(2.5, tube, rate=0.5)\n p20.dispense(2.5, dest)\n p20.mix(6, 20, dest, rate=0.5)\n p20.blow_out(dest.top())\n p20.touch_tip()\n p20.drop_tip()\n\n ctx.comment('\\n\\n-----------Running PCR------------\\n')\n\n profile1 = [\n\n {'temperature': 95, 'hold_time_seconds': 180},\n\n ]\n\n profile2 = [\n\n {'temperature': 95, 'hold_time_seconds': 30},\n {'temperature': 55, 'hold_time_seconds': 30},\n {'temperature': 72, 'hold_time_seconds': 30}\n\n ]\n\n profile3 = [\n\n {'temperature': 72, 'hold_time_seconds': 300}\n\n ]\n\n tc_mod.close_lid()\n tc_mod.execute_profile(steps=profile1, repetitions=1, block_max_volume=25)\n tc_mod.execute_profile(steps=profile2, repetitions=25, block_max_volume=25)\n tc_mod.execute_profile(steps=profile3, repetitions=1, block_max_volume=25)\n tc_mod.set_block_temperature(4)\n tc_mod.set_lid_temperature(25)\n tc_mod.open_lid()\n\n ctx.comment('''Centrifuge the PCR plate at 1,000 \u00d7 g at 20\u00b0C for 1 minute\n to collect condensation, carefully remove seal.\n\n Place pcr plate in slot 4 of robot 2.\n\n Also ensure that beads are vortexed and placed in column 1\n of the reagent plate. For part 2 of the protocol.''')\n",
"content": "import math\nfrom opentrons import protocol_api\n\nmetadata = {\n 'protocolName': 'PCR Prep and PCR',\n 'author': 'Rami <[email protected]>',\n 'source': 'Custom Protocol Request',\n 'apiLevel': '2.11'\n}\n\n\ndef run(ctx):\n\n [num_samp, source_type, mmx_type, start_tip,\n p20_mount, m20_mount] = get_values( # noqa: F821\n \"num_samp\", \"source_type\", \"mmx_type\",\n \"start_tip\", \"p20_mount\", \"m20_mount\")\n\n # num_samp = 96\n # source_type = \"tuberack\"\n # p20_mount = \"left\"\n # m20_mount = \"right\"\n\n # load modules\n tc_mod = ctx.load_module('Thermocycler Module')\n tc_mod.open_lid()\n tc_mod.set_lid_temperature(105)\n pcr_plate = tc_mod.load_labware('nest_96_wellplate_100ul_pcr_full_skirt') # noqa: E501\n\n temp_mod = ctx.load_module('temperature module gen2', 3)\n temp_mod.set_temperature(4)\n\n # load labware\n if source_type == \"tuberack\":\n samples_racks = [ctx.load_labware('opentrons_24_tuberack_nest_1.5ml_snapcap', # noqa: E501\n slot) for slot in [4, 5, 1, 2]]\n sample_tubes = [tube for rack in samples_racks\n for row in rack.rows() for tube in row][:num_samp]\n\n if mmx_type == \"mmx_wellplate\":\n mmx_plate = temp_mod.load_labware('opentrons_96_aluminumblock_nest_wellplate_100ul') # noqa: E501\n else:\n mmx_plate = temp_mod.load_labware('opentrons_24_aluminumblock_nest_1.5ml_snapcap') # noqa: E501\n\n tips = [ctx.load_labware('opentrons_96_filtertiprack_20ul', slot)\n for slot in [6, 9]]\n\n # load pipettes\n p20 = ctx.load_instrument('p20_single_gen2', p20_mount,\n tip_racks=tips)\n m20 = ctx.load_instrument('p20_multi_gen2', m20_mount,\n tip_racks=tips)\n all_tips = [tip for rack in tips for tip in rack.wells()]\n start_tip -= 1\n m20.starting_tip = all_tips[start_tip]\n p20.starting_tip = all_tips[start_tip]\n\n def pick_up(pip):\n try:\n pip.pick_up_tip()\n except protocol_api.labware.OutOfTipsError:\n ctx.pause(f\"Replace empty tip rack for {pip}\")\n pip.reset_tipracks()\n pip.pick_up_tip()\n\n # mapping\n num_full_cols = math.floor(num_samp/8)\n dispense_wells = [well for column in pcr_plate.columns()[1:11]\n for well in column[1:7]][:num_samp]\n\n remainder = False if num_samp % 8 == 0 else True\n\n num_mmx_cols = math.ceil(num_samp/24)\n if mmx_type == \"mmx_wellplate\":\n mmx = mmx_plate.rows()[0][:num_mmx_cols]*24\n else:\n mmx = mmx_plate.rows()[0][:num_mmx_cols]*96\n\n unfilled_mmx_col = mmx_plate.rows()[0][5]\n\n if mmx_type == 'mmx_wellplate':\n ctx.comment('\\n\\nTRANSFERRING MASTERMIX TO PLATE\\n')\n m20.pick_up_tip()\n\n for i, (s_col, d_col) in enumerate(zip(\n mmx,\n pcr_plate.rows()[0][:num_full_cols])): # noqa: E501\n if i % 4 == 0 and i > 0:\n if m20.has_tip:\n m20.drop_tip()\n m20.pick_up_tip()\n\n m20.aspirate(10, s_col, rate=0.5)\n m20.dispense(10, d_col, rate=0.5) # noqa: E501\n m20.aspirate(12.5, s_col, rate=0.5)\n m20.dispense(12.5, d_col, rate=0.5) # noqa: E501\n m20.blow_out(d_col.top())\n m20.touch_tip()\n ctx.comment('\\n')\n\n if m20.has_tip:\n m20.drop_tip()\n\n if remainder:\n ctx.comment('\\n\\nTRANSFERRING MASTERMIX TO UNFILLED COLUMN\\n')\n remaining_wells = num_samp % 8\n unfilled_col = pcr_plate.columns()[num_full_cols][:remaining_wells]\n p20.pick_up_tip()\n\n for well in unfilled_col:\n p20.aspirate(10, unfilled_mmx_col, rate=0.5)\n p20.dispense(10, well, rate=0.5) # noqa: E501\n p20.aspirate(12.5, unfilled_mmx_col, rate=0.5)\n p20.dispense(12.5, well, rate=0.5) # noqa: E501\n p20.blow_out(well.top())\n p20.touch_tip()\n p20.drop_tip()\n\n elif mmx_type == \"mmx_tuberack\":\n\n ctx.comment('\\n\\nTRANSFERRING MASTERMIX TO PLATE\\n')\n p20.pick_up_tip()\n\n for i, (s, d) in enumerate(zip(mmx, dispense_wells)):\n\n if i % 4 == 0 and i > 0:\n if p20.has_tip:\n p20.drop_tip()\n p20.pick_up_tip()\n\n p20.aspirate(10, s, rate=0.5)\n p20.dispense(10, d, rate=0.5) # noqa: E501\n p20.aspirate(12.5, s, rate=0.5)\n p20.dispense(12.5, d, rate=0.5) # noqa: E501\n p20.move_to(d.top())\n ctx.delay(seconds=1)\n p20.blow_out(d.top())\n p20.touch_tip(v_offset=-5)\n ctx.comment('\\n')\n p20.drop_tip()\n\n if source_type == \"tuberack\":\n ctx.comment('\\n\\nTRANSFERRING SAMPLE TO PCR PLATE\\n')\n for tube, dest in zip(sample_tubes, dispense_wells):\n p20.pick_up_tip()\n p20.aspirate(2.5, tube, rate=0.5)\n p20.dispense(2.5, dest)\n p20.mix(6, 20, dest, rate=0.5)\n p20.blow_out(dest.top())\n p20.touch_tip()\n p20.drop_tip()\n\n ctx.comment('\\n\\n-----------Running PCR------------\\n')\n\n profile1 = [\n\n {'temperature': 95, 'hold_time_seconds': 180},\n\n ]\n\n profile2 = [\n\n {'temperature': 95, 'hold_time_seconds': 30},\n {'temperature': 55, 'hold_time_seconds': 30},\n {'temperature': 72, 'hold_time_seconds': 30}\n\n ]\n\n profile3 = [\n\n {'temperature': 72, 'hold_time_seconds': 300}\n\n ]\n\n tc_mod.close_lid()\n tc_mod.execute_profile(steps=profile1, repetitions=1, block_max_volume=25)\n tc_mod.execute_profile(steps=profile2, repetitions=25, block_max_volume=25)\n tc_mod.execute_profile(steps=profile3, repetitions=1, block_max_volume=25)\n tc_mod.set_block_temperature(4)\n tc_mod.set_lid_temperature(25)\n tc_mod.open_lid()\n\n ctx.comment('''Centrifuge the PCR plate at 1,000 \u00d7 g at 20\u00b0C for 1 minute\n to collect condensation, carefully remove seal.\n\n Place pcr plate in slot 4 of robot 2.\n\n Also ensure that beads are vortexed and placed in column 1\n of the reagent plate. For part 2 of the protocol.''')\n",
"custom_labware_defs": [
{
"brand": {
Expand Down
3 changes: 2 additions & 1 deletion protocols/0ca318/0ca318.ot2.apiv2.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,10 @@ def pick_up(pip):
p20.dispense(10, d, rate=0.5) # noqa: E501
p20.aspirate(12.5, s, rate=0.5)
p20.dispense(12.5, d, rate=0.5) # noqa: E501
p20.move_to(d.top())
ctx.delay(seconds=1)
p20.blow_out(d.top())
p20.touch_tip()
p20.touch_tip(v_offset=-5)
ctx.comment('\n')
p20.drop_tip()

Expand Down

0 comments on commit 217ec10

Please sign in to comment.