diff --git a/protoBuilds/gsdx/bacgene.ot2.apiv2.py.json b/protoBuilds/gsdx/bacgene.ot2.apiv2.py.json index 4e870dfa6..f46f778af 100644 --- a/protoBuilds/gsdx/bacgene.ot2.apiv2.py.json +++ b/protoBuilds/gsdx/bacgene.ot2.apiv2.py.json @@ -1,5 +1,5 @@ { - "content": "import math\nfrom opentrons.types import Point, Mount\n\n\nmetadata = {\n 'protocolName': 'BACGene',\n 'author': 'Nick Diehl 12:\n raise Exception('Combination of listeria and salmonella samples \\\nexceeds plate capacity')\n\n # define locations of lysis buffer reagents\n lysis_buffer_listeria = lysis_rack.rows_by_name()['B'][\n 1::2]\n lysis_buffer_salmonella = lysis_rack.rows_by_name()['D'][\n 1::2]\n enzyme_listeria_1 = lysis_rack.rows_by_name()['B'][\n ::2]\n enzyme_listeria_2 = lysis_rack.rows_by_name()['C']\n enzyme_salmonella = lysis_rack.rows_by_name()['D'][\n ::2]\n positive_control_l = lysis_rack.wells_by_name()['A1']\n positive_control_s = lysis_rack.wells_by_name()['E1']\n\n # define liquids\n try:\n lysis_buffer_l_prepared_liq = ctx.define_liquid(\n name=\"listeria lysis buffer (prepared)\",\n description=\"\",\n display_color=\"#B925FF\",\n )\n lysis_buffer_l_fresh_liq = ctx.define_liquid(\n name=\"listeria lysis buffer (fresh)\",\n description=\"\",\n display_color=\"#E4ABFF\",\n )\n lysis_buffer_s_prepared_liq = ctx.define_liquid(\n name=\"salmonella lysis buffer (prepared)\",\n description=\"\",\n display_color=\"#FFD600\",\n )\n lysis_buffer_s_fresh_liq = ctx.define_liquid(\n name=\"salmonella lysis buffer (fresh)\",\n description=\"\",\n display_color=\"#FFF2AD\",\n )\n enzyme_listeria_1_liq = ctx.define_liquid(\n name=\"listeria enzyme 1\",\n description=\"\",\n display_color=\"#FF9900\",\n )\n enzyme_listeria_2_liq = ctx.define_liquid(\n name=\"listeria enzyme 2\",\n description=\"\",\n display_color=\"#9DFFD8\",\n )\n enzyme_salmonella_liq = ctx.define_liquid(\n name=\"salmonella enzyme\",\n description=\"\",\n display_color=\"#50D5FF\",\n )\n positive_control_l_liq = ctx.define_liquid(\n name=\"listeria postive control\",\n description=\"\",\n display_color=\"#FF80F5\",\n )\n positive_control_s_liq = ctx.define_liquid(\n name=\"salmonella positive control\",\n description=\"\",\n display_color=\"#7EFF42\",\n )\n samples_listeria_liq_sample = ctx.define_liquid(\n name=\"listeria samples\",\n description=\"\",\n display_color=\"#0EFFFB\",\n )\n samples_listeria_liq_lysis = ctx.define_liquid(\n name=\"listeria samples\",\n description=\"\",\n display_color=\"#0756EA\",\n )\n samples_listeria_liq_pcr = ctx.define_liquid(\n name=\"listeria samples\",\n description=\"\",\n display_color=\"#130183\",\n )\n samples_salmonella_liq_sample = ctx.define_liquid(\n name=\"salmonella samples\",\n description=\"\",\n display_color=\"#F6096D\",\n )\n samples_salmonella_liq_lysis = ctx.define_liquid(\n name=\"salmonella samples\",\n description=\"\",\n display_color=\"#FF0000\",\n )\n samples_salmonella_liq_pcr = ctx.define_liquid(\n name=\"salmonella samples\",\n description=\"\",\n display_color=\"#A92F00\",\n )\n except AttributeError:\n pass\n\n samples_single_listeria = sample_plate.wells()[:num_samples_listeria]\n num_cols_offset_samples_listeria = math.ceil(num_samples_listeria/8)\n samples_single_salmonella = sample_plate.wells()[\n num_cols_offset_samples_listeria*8:\n num_cols_offset_samples_listeria*8+num_samples_salmonella]\n lysis_single_listeria = lysis_plate.wells()[:num_samples_listeria]\n lysis_single_salmonella = lysis_plate.wells()[\n num_cols_offset_samples_listeria*8:\n num_cols_offset_samples_listeria*8+num_samples_salmonella]\n pcr_single_listeria = pcr_plate.wells()[:num_samples_listeria]\n pcr_single_salmonella = pcr_plate.wells()[\n num_cols_offset_samples_listeria*8:\n num_cols_offset_samples_listeria*8+num_samples_salmonella]\n\n # load liquids\n try:\n if num_samples_listeria > 0:\n positive_control_l.load_liquid(positive_control_l_liq, volume=10)\n if num_samples_salmonella > 0:\n positive_control_s.load_liquid(positive_control_s_liq, volume=10)\n [well.load_liquid(samples_listeria_liq_sample,\n volume=30/len(samples_single_listeria))\n for well in samples_single_listeria]\n [well.load_liquid(samples_salmonella_liq_sample,\n volume=10/len(samples_single_salmonella))\n for well in samples_single_salmonella]\n [well.load_liquid(samples_listeria_liq_lysis,\n volume=30/len(lysis_single_listeria))\n for well in lysis_single_listeria]\n [well.load_liquid(samples_salmonella_liq_lysis,\n volume=10/len(lysis_single_salmonella))\n for well in lysis_single_salmonella]\n [well.load_liquid(samples_listeria_liq_pcr,\n volume=30/len(pcr_single_listeria))\n for well in pcr_single_listeria]\n [well.load_liquid(samples_salmonella_liq_pcr,\n volume=10/len(pcr_single_salmonella))\n for well in pcr_single_salmonella]\n except AttributeError:\n pass\n\n single_tip_count_map = {m300: 0, m20: 0}\n tip_ref = m300.tip_racks[0].wells()[0]\n default_current = 1\n\n right = True\n\n def drop(pip):\n nonlocal right\n offset = 30 if right else -15\n drop_loc = ctx.loaded_labwares[12].wells()[0].top().move(\n Point(x=offset))\n pip.drop_tip(drop_loc)\n right = not right\n\n def pick_up_single(pip=m300):\n mount = Mount.LEFT if pip.mount == 'left' else Mount.RIGHT\n current_single = 1/8*default_current\n if not ctx.is_simulating():\n # attenuate pickup current\n ctx._hw_manager.hardware._attached_instruments[\n mount].update_config_item(\n 'pick_up_current', current_single)\n pip.pick_up_tip(\n [well\n for col in pip.tip_racks[-1].columns()\n for well in col[::-1]][single_tip_count_map[pip]])\n single_tip_count_map[pip] += 1\n if not ctx.is_simulating():\n # reset pickup current\n ctx._hw_manager.hardware._attached_instruments[\n mount].update_config_item('pick_up_current', default_current)\n\n def slow_withdraw(pip, well, delay_seconds=2.0, y_offset=0):\n pip.default_speed /= 10\n if delay_seconds > 0:\n ctx.delay(delay_seconds)\n pip.move_to(well.top().move(Point(y=y_offset)))\n pip.default_speed *= 10\n\n def wick(pip, well, x_magnitude=0.5, z_offset=3.0):\n radius = well.diameter/2 if well.diameter else well.width/2\n pip.default_speed /= 2\n pip.move_to(well.bottom().move(Point(x=x_magnitude*radius,\n z=z_offset)))\n pip.default_speed *= 2\n\n \"\"\" create lysis buffer with enzyme \"\"\"\n if DO_CREATE_LYSIS_BUFFER:\n\n vol_enzyme = 500.0\n num_trans = math.ceil(vol_enzyme/tip_ref.max_volume)\n vol_per_trans = round(vol_enzyme/num_trans, 1)\n\n if num_samples_listeria_remaining % 48 == 0 or \\\n num_samples_listeria_remaining % 48 == 47:\n num_partial_listeria_buffers = 0\n num_bvs_effective = 0\n else:\n num_partial_listeria_buffers = 1\n if 2*math.ceil(num_samples_listeria_remaining/2) % 48 == 0:\n num_bvs_effective = 48\n else:\n num_bvs_effective = 2*math.ceil(\n num_samples_listeria_remaining/2) % 48\n\n num_additional_listeria_buffers = math.ceil(\n ((num_samples_listeria-1) - num_bvs_effective)/48)\n\n # print(f'partial: {num_partial_listeria_buffers}')\n # print(f'additional: {num_additional_listeria_buffers}')\n\n enzyme_listeria_1_creation = enzyme_listeria_1[\n num_partial_listeria_buffers:\n num_partial_listeria_buffers+num_additional_listeria_buffers]\n enzyme_listeria_2_creation = enzyme_listeria_2[\n num_partial_listeria_buffers:\n num_partial_listeria_buffers+num_additional_listeria_buffers]\n lysis_buffer_listeria_creation = lysis_buffer_listeria[\n num_partial_listeria_buffers:\n num_partial_listeria_buffers+num_additional_listeria_buffers]\n # print(lysis_buffer_listeria_creation)\n\n # load partial liq\n try:\n [well.load_liquid(\n lysis_buffer_l_prepared_liq,\n volume=11000/num_partial_listeria_buffers)\n for well in lysis_buffer_listeria[:num_partial_listeria_buffers]]\n\n # load full liq\n [well.load_liquid(\n lysis_buffer_l_fresh_liq,\n volume=11000/num_additional_listeria_buffers)\n for well in lysis_buffer_listeria[\n num_partial_listeria_buffers:\n num_partial_listeria_buffers+num_additional_listeria_buffers]]\n [well.load_liquid(\n enzyme_listeria_1_liq,\n volume=500/num_additional_listeria_buffers)\n for well in enzyme_listeria_1[\n num_partial_listeria_buffers:\n num_partial_listeria_buffers+num_additional_listeria_buffers]]\n [well.load_liquid(\n enzyme_listeria_2_liq,\n volume=500/num_additional_listeria_buffers)\n for well in enzyme_listeria_2[\n num_partial_listeria_buffers:\n num_partial_listeria_buffers+num_additional_listeria_buffers]]\n except AttributeError:\n pass\n\n # listeria\n for enzyme1, enzyme2, lysis_buff in zip(\n enzyme_listeria_1_creation,\n enzyme_listeria_2_creation,\n lysis_buffer_listeria_creation):\n # enzyme 1\n pick_up_single(m300)\n for _ in range(num_trans):\n m300.aspirate(\n vol_per_trans, enzyme1.bottom().move(\n Point(x=OFFSET_X_TUBERACK, z=1)))\n slow_withdraw(m300, enzyme1)\n m300.move_to(\n lysis_buff.top().move(\n Point(x=OFFSET_X_TUBERACK,\n y=OFFSET_Y_LYSIS_BUFFER_LISTERIA)))\n m300.dispense(\n vol_per_trans,\n lysis_buff.bottom().move(\n Point(x=OFFSET_X_TUBERACK,\n y=OFFSET_Y_LYSIS_BUFFER_LISTERIA,\n z=3)))\n m300.blow_out()\n slow_withdraw(\n m300, lysis_buff, y_offset=OFFSET_Y_LYSIS_BUFFER_LISTERIA)\n drop(m300)\n\n # enzyme 2\n pick_up_single(m300)\n for i in range(num_trans):\n m300.aspirate(\n vol_per_trans, enzyme2.bottom().move(\n Point(x=OFFSET_X_TUBERACK, z=1)))\n slow_withdraw(m300, enzyme2)\n m300.move_to(\n lysis_buff.top().move(Point(\n x=OFFSET_X_TUBERACK,\n y=OFFSET_Y_LYSIS_BUFFER_LISTERIA)))\n m300.dispense(\n vol_per_trans,\n lysis_buff.bottom().move(\n Point(x=OFFSET_X_TUBERACK,\n y=OFFSET_Y_LYSIS_BUFFER_LISTERIA,\n z=3)))\n if i == num_trans - 1:\n if DO_MIX:\n m300.flow_rate.aspirate *= 2\n m300.flow_rate.dispense *= 2\n m300.mix(\n 10, 200,\n lysis_buff.bottom().move(Point(\n x=OFFSET_X_TUBERACK,\n z=3, y=OFFSET_Y_LYSIS_BUFFER_LISTERIA)))\n m300.flow_rate.aspirate /= 2\n m300.flow_rate.dispense /= 2\n m300.blow_out(\n lysis_buff.bottom().move(Point(\n x=OFFSET_X_TUBERACK,\n y=OFFSET_Y_LYSIS_BUFFER_LISTERIA, z=3)))\n slow_withdraw(\n m300, lysis_buff, y_offset=OFFSET_Y_LYSIS_BUFFER_LISTERIA)\n drop(m300)\n\n # salmonella\n if num_samples_salmonella_remaining % 48 == 0 or \\\n num_samples_salmonella_remaining == 47:\n num_partial_salmonella_buffers = 0\n num_bvs_effective = 0\n else:\n num_partial_salmonella_buffers = 1\n if 2*math.ceil(num_samples_salmonella_remaining/2) % 48 == 0:\n num_bvs_effective = 48\n else:\n num_bvs_effective = 2*math.ceil(\n num_samples_salmonella_remaining/2) % 48\n\n num_additional_salmonella_buffers = math.ceil(\n ((num_samples_salmonella-1) - num_bvs_effective)/48)\n\n enzyme_salmonella_creation = enzyme_salmonella[\n num_partial_salmonella_buffers:\n num_partial_salmonella_buffers+num_additional_salmonella_buffers]\n lysis_buffer_salmonella_creation = lysis_buffer_salmonella[\n num_partial_salmonella_buffers:\n num_partial_salmonella_buffers+num_additional_salmonella_buffers]\n\n # load partial liq\n try:\n [well.load_liquid(\n lysis_buffer_s_prepared_liq,\n volume=11000/num_partial_salmonella_buffers)\n for well in lysis_buffer_salmonella[\n :num_partial_salmonella_buffers]]\n\n # load full liq\n [well.load_liquid(\n lysis_buffer_s_fresh_liq,\n volume=11000/num_additional_salmonella_buffers)\n for well in lysis_buffer_salmonella[\n num_partial_salmonella_buffers:\n num_partial_salmonella_buffers +\n num_additional_salmonella_buffers]]\n [well.load_liquid(\n enzyme_salmonella_liq,\n volume=500/num_additional_salmonella_buffers)\n for well in enzyme_salmonella[\n num_partial_salmonella_buffers:\n num_partial_salmonella_buffers +\n num_additional_salmonella_buffers]]\n except AttributeError:\n pass\n\n for enzyme, lysis_buff in zip(enzyme_salmonella_creation,\n lysis_buffer_salmonella_creation):\n # enzyme\n pick_up_single(m300)\n for i in range(num_trans):\n m300.aspirate(vol_per_trans, enzyme.bottom().move(\n Point(x=OFFSET_X_TUBERACK, z=1)))\n slow_withdraw(m300, enzyme)\n m300.move_to(\n lysis_buff.top().move(\n Point(x=OFFSET_X_TUBERACK,\n y=-OFFSET_Y_LYSIS_BUFFER_SALMONELLA)))\n m300.dispense(\n vol_per_trans,\n lysis_buff.bottom().move(\n Point(x=OFFSET_X_TUBERACK,\n y=-OFFSET_Y_LYSIS_BUFFER_SALMONELLA,\n z=3)))\n if i == num_trans - 1:\n if DO_MIX:\n m300.flow_rate.aspirate *= 2\n m300.flow_rate.dispense *= 2\n m300.mix(\n 10, 200,\n lysis_buff.bottom().move(Point(\n x=OFFSET_X_TUBERACK,\n z=3, y=-OFFSET_Y_LYSIS_BUFFER_SALMONELLA)))\n m300.flow_rate.aspirate /= 2\n m300.flow_rate.dispense /= 2\n m300.blow_out(\n lysis_buff.bottom().move(\n Point(x=OFFSET_X_TUBERACK,\n y=-OFFSET_Y_LYSIS_BUFFER_SALMONELLA,\n z=3)))\n slow_withdraw(\n m300, lysis_buff,\n y_offset=-OFFSET_Y_LYSIS_BUFFER_SALMONELLA)\n drop(m300)\n\n \"\"\" transfer lysis buffer to lysis plate \"\"\"\n vol_overage = 20\n\n if num_samples_listeria > 0:\n if DO_DISTRIBUTE_LYSIS_BUFFER:\n lysis_buffer_listeria_dests = lysis_plate.wells()[\n :num_samples_listeria-2] + [\n lysis_plate.wells()[num_samples_listeria-1]]\n vol_lysis_buffer_listeria = 70.0\n num_dests_per_asp = int(\n (tip_ref.max_volume-vol_overage)//vol_lysis_buffer_listeria)\n num_asp = math.ceil(\n len(lysis_buffer_listeria_dests)/num_dests_per_asp)\n lysis_buffer_listeria_dest_sets = [\n lysis_buffer_listeria_dests[i*num_dests_per_asp:\n (i+1)*num_dests_per_asp]\n if i < num_asp - 1\n else lysis_buffer_listeria_dests[i*num_dests_per_asp:]\n for i in range(num_asp)]\n pick_up_single(m300)\n m300.aspirate(\n vol_overage,\n lysis_buffer_listeria[0].bottom().move(Point(\n y=OFFSET_Y_LYSIS_BUFFER_LISTERIA,\n z=OFFSET_Z_LYSIS_BUFFER_LISTERIA)))\n num_asp_listeria_remaining = math.ceil(\n (num_samples_listeria_remaining % 48) / 2)\n bump = 24 - num_asp_listeria_remaining \\\n if 24 - num_asp_listeria_remaining != 24 else 0\n for i, d_set in enumerate(lysis_buffer_listeria_dest_sets):\n set_ind = i + bump\n lysis_buff = lysis_buffer_listeria[set_ind//24]\n # m300.blow_out(lysis_buff.top(-1))\n m300.aspirate(\n len(d_set)*vol_lysis_buffer_listeria,\n lysis_buff.bottom().move(Point(\n y=OFFSET_Y_LYSIS_BUFFER_LISTERIA,\n z=OFFSET_Z_LYSIS_BUFFER_LISTERIA)))\n slow_withdraw(\n m300, lysis_buff, y_offset=OFFSET_Y_LYSIS_BUFFER_LISTERIA)\n for d in d_set:\n m300.dispense(vol_lysis_buffer_listeria, d.bottom(2))\n slow_withdraw(m300, d)\n drop(m300)\n\n if num_samples_salmonella > 0:\n if DO_DISTRIBUTE_LYSIS_BUFFER:\n available_wells = [\n well for col in lysis_plate.columns()[num_cols_listeria:]\n for well in col]\n lysis_buffer_salmonella_dests = available_wells[\n :num_samples_salmonella-2] + [\n available_wells[num_samples_salmonella-1]]\n vol_lysis_buffer_salmonella = 90.0 if not salmonella_meat else 50.0\n num_dests_per_asp = 2 # hard-set for now\n num_asp = math.ceil(\n len(lysis_buffer_salmonella_dests)/num_dests_per_asp)\n lysis_buffer_salmonella_dest_sets = [\n lysis_buffer_salmonella_dests[i*num_dests_per_asp:\n (i+1)*num_dests_per_asp]\n if i < num_asp - 1\n else lysis_buffer_salmonella_dests[i*num_dests_per_asp:]\n for i in range(num_asp)]\n pick_up_single(m300)\n m300.aspirate(\n vol_overage,\n lysis_buffer_salmonella[0].bottom().move(\n Point(y=-OFFSET_Y_LYSIS_BUFFER_SALMONELLA,\n z=OFFSET_Z_LYSIS_BUFFER_SALMONELLA)))\n num_asp_salmonella_remaining = math.ceil(\n (num_samples_salmonella_remaining % 48) / 2)\n bump_check = int(48/num_dests_per_asp)\n bump = bump_check - num_asp_salmonella_remaining \\\n if bump_check - num_asp_salmonella_remaining != bump_check \\\n else 0\n for i, d_set in enumerate(lysis_buffer_salmonella_dest_sets):\n set_ind = i + bump\n lysis_buff = lysis_buffer_salmonella[set_ind//bump_check]\n # m300.blow_out(lysis_buff.top(-1))\n # print('salmonella', i, set_ind, lysis_buff, len(d_set))\n # m300.blow_out(lysis_buff.top(-1))\n m300.aspirate(\n len(d_set)*vol_lysis_buffer_salmonella,\n lysis_buff.bottom().move(Point(\n y=-OFFSET_Y_LYSIS_BUFFER_SALMONELLA,\n z=OFFSET_Z_LYSIS_BUFFER_SALMONELLA)))\n slow_withdraw(m300, lysis_buff,\n y_offset=-OFFSET_Y_LYSIS_BUFFER_SALMONELLA)\n for d in d_set:\n m300.dispense(vol_lysis_buffer_salmonella, d.bottom(2))\n slow_withdraw(m300, d)\n drop(m300)\n\n if DO_TRANSFER_SAMPLE_TO_LYSIS:\n \"\"\" transfer listeria \"\"\"\n vol_listeria = 30.0\n num_sample_cols_listeria = math.ceil((num_samples_listeria-2)/8)\n for s, d in zip(sample_plate.rows()[0][:num_sample_cols_listeria],\n lysis_plate.rows()[0][:num_sample_cols_listeria]):\n if sample_rack_type == 'bioplastics':\n asp_loc = s.bottom(2)\n else:\n asp_loc = s.top(-17.36)\n m300.pick_up_tip()\n m300.aspirate(vol_listeria, asp_loc)\n slow_withdraw(m300, s)\n m300.dispense(vol_listeria, d.bottom(2))\n if DO_MIX:\n m300.mix(3, 50, d.bottom(2))\n m300.blow_out(d.bottom(2))\n slow_withdraw(m300, d)\n drop(m300)\n\n \"\"\" transfer salmonella \"\"\"\n [pip, vol_salmonella] = [m20, 10.0] \\\n if not salmonella_meat else [m300, 50.0]\n num_cols_samples_salmonella = math.ceil((num_samples_salmonella-2)/8)\n for s, d in zip(\n sample_plate.rows()[0][\n num_cols_listeria:\n num_cols_listeria+num_cols_samples_salmonella],\n lysis_plate.rows()[0][\n num_cols_listeria:\n num_cols_listeria+num_cols_samples_salmonella]):\n pip.pick_up_tip()\n if sample_rack_type == 'bioplastics':\n asp_loc = s.bottom(2)\n else:\n asp_loc = s.top(-17.36)\n pip.aspirate(vol_salmonella, asp_loc)\n slow_withdraw(pip, s)\n pip.dispense(vol_salmonella, d.bottom(2))\n if DO_MIX:\n pip.mix(3, 18, d.bottom(2))\n pip.blow_out(d.bottom(2))\n slow_withdraw(pip, d)\n drop(pip)\n\n if DO_SET_TEMP:\n ctx.delay(minutes=20, msg='Incubating for 20 minutes @ 37C.')\n tempdeck.set_temperature(95)\n ctx.delay(minutes=10, msg='Incubating for 10 minutes @ 95C.')\n tempdeck.set_temperature(37)\n\n vol_sample = 5.0\n\n if DO_TRANSFER_SAMPLE_TO_PCR:\n \"\"\" transfer samples to PCR plate \"\"\"\n\n # listeria\n if num_samples_listeria > 0:\n for s, d in zip(lysis_plate.rows()[0][:num_cols_listeria],\n pcr_plate.rows()[0][:num_cols_listeria]):\n m20.pick_up_tip()\n m20.aspirate(5, s.top()) # pre air gap\n m20.aspirate(vol_sample, s)\n slow_withdraw(m20, s)\n m20.dispense(vol_sample, d.bottom(1))\n # if DO_MIX:\n # m20.mix(3, vol_sample*0.8, d.bottom(1))\n m20.dispense(m20.current_volume, d.bottom(1))\n slow_withdraw(m20, d)\n # wick(m20, d)\n drop(m20)\n\n # salmonella\n if num_samples_salmonella > 0:\n for s, d in zip(\n lysis_plate.rows()[0][\n num_cols_listeria:\n num_cols_listeria+num_cols_salmonella],\n pcr_plate.rows()[0][\n num_cols_listeria:\n num_cols_listeria+num_cols_salmonella]):\n m20.pick_up_tip()\n m20.aspirate(5, s.top()) # pre air gap\n m20.aspirate(vol_sample, s)\n slow_withdraw(m20, s)\n m20.dispense(vol_sample, d.bottom(1))\n # if DO_MIX:\n # m20.mix(3, vol_sample*0.8, d.bottom(1))\n m20.dispense(m20.current_volume, d.bottom(1))\n slow_withdraw(m20, d)\n m20.air_gap(5)\n # wick(m20, d)\n drop(m20)\n\n if DO_TRANSFER_POSITIVE_CONTROL:\n \"\"\" transfer positive controls \"\"\"\n vol_positive_control = vol_sample\n if num_samples_listeria > 0:\n positive_control_l_dest = pcr_plate.wells()[num_samples_listeria-2]\n pick_up_single(m20)\n m20.aspirate(5, positive_control_l_dest.top()) # pre air gap\n m20.aspirate(vol_positive_control, positive_control_l)\n slow_withdraw(m20, positive_control_l)\n m20.dispense(m20.current_volume, positive_control_l_dest.bottom(1))\n slow_withdraw(m20, positive_control_l_dest)\n # if DO_MIX:\n # m20.mix(3, vol_positive_control*0.8,\n # positive_control_l_dest.bottom(1))\n # wick(m20, positive_control_l_dest)\n drop(m20)\n\n if num_samples_salmonella > 0:\n available_wells = [\n well for col in pcr_plate.columns()[num_cols_listeria:]\n for well in col]\n positive_control_s_dest = available_wells[num_samples_salmonella-2]\n pick_up_single(m20)\n m20.aspirate(5, positive_control_s.top()) # pre air gap\n m20.aspirate(vol_positive_control, positive_control_s)\n slow_withdraw(m20, positive_control_s)\n m20.dispense(m20.current_volume, positive_control_s_dest.bottom(1))\n slow_withdraw(m20, positive_control_s_dest)\n # if DO_MIX:\n # m20.mix(3, vol_positive_control*0.8,\n # positive_control_s_dest.bottom(1))\n # wick(m20, positive_control_s_dest)\n drop(m20)\n\n tempdeck.deactivate()\n", + "content": "import math\nfrom opentrons.types import Point, Mount\n\n\nmetadata = {\n 'protocolName': 'BACGene',\n 'author': 'Nick Diehl 12:\n raise Exception('Combination of listeria and salmonella samples \\\nexceeds plate capacity')\n\n # define locations of lysis buffer reagents\n lysis_buffer_listeria = lysis_rack.rows_by_name()['B'][\n 1::2]\n lysis_buffer_salmonella = lysis_rack.rows_by_name()['D'][\n 1::2]\n enzyme_listeria_1 = lysis_rack.rows_by_name()['B'][\n ::2]\n enzyme_listeria_2 = lysis_rack.rows_by_name()['C']\n enzyme_salmonella = lysis_rack.rows_by_name()['D'][\n ::2]\n positive_control_l = lysis_rack.wells_by_name()['A1']\n positive_control_s = lysis_rack.wells_by_name()['E1']\n\n # define liquids\n try:\n lysis_buffer_l_prepared_liq = ctx.define_liquid(\n name=\"listeria lysis buffer (prepared)\",\n description=\"\",\n display_color=\"#B925FF\",\n )\n lysis_buffer_l_fresh_liq = ctx.define_liquid(\n name=\"listeria lysis buffer (fresh)\",\n description=\"\",\n display_color=\"#E4ABFF\",\n )\n lysis_buffer_s_prepared_liq = ctx.define_liquid(\n name=\"salmonella lysis buffer (prepared)\",\n description=\"\",\n display_color=\"#FFD600\",\n )\n lysis_buffer_s_fresh_liq = ctx.define_liquid(\n name=\"salmonella lysis buffer (fresh)\",\n description=\"\",\n display_color=\"#FFF2AD\",\n )\n enzyme_listeria_1_liq = ctx.define_liquid(\n name=\"listeria enzyme 1\",\n description=\"\",\n display_color=\"#FF9900\",\n )\n enzyme_listeria_2_liq = ctx.define_liquid(\n name=\"listeria enzyme 2\",\n description=\"\",\n display_color=\"#9DFFD8\",\n )\n enzyme_salmonella_liq = ctx.define_liquid(\n name=\"salmonella enzyme\",\n description=\"\",\n display_color=\"#50D5FF\",\n )\n positive_control_l_liq = ctx.define_liquid(\n name=\"listeria postive control\",\n description=\"\",\n display_color=\"#FF80F5\",\n )\n positive_control_s_liq = ctx.define_liquid(\n name=\"salmonella positive control\",\n description=\"\",\n display_color=\"#7EFF42\",\n )\n samples_listeria_liq_sample = ctx.define_liquid(\n name=\"listeria samples\",\n description=\"\",\n display_color=\"#0EFFFB\",\n )\n samples_listeria_liq_lysis = ctx.define_liquid(\n name=\"listeria samples\",\n description=\"\",\n display_color=\"#0756EA\",\n )\n samples_listeria_liq_pcr = ctx.define_liquid(\n name=\"listeria samples\",\n description=\"\",\n display_color=\"#130183\",\n )\n samples_salmonella_liq_sample = ctx.define_liquid(\n name=\"salmonella samples\",\n description=\"\",\n display_color=\"#F6096D\",\n )\n samples_salmonella_liq_lysis = ctx.define_liquid(\n name=\"salmonella samples\",\n description=\"\",\n display_color=\"#FF0000\",\n )\n samples_salmonella_liq_pcr = ctx.define_liquid(\n name=\"salmonella samples\",\n description=\"\",\n display_color=\"#A92F00\",\n )\n except AttributeError:\n pass\n\n samples_single_listeria = sample_plate.wells()[:num_samples_listeria]\n num_cols_offset_samples_listeria = math.ceil(num_samples_listeria/8)\n samples_single_salmonella = sample_plate.wells()[\n num_cols_offset_samples_listeria*8:\n num_cols_offset_samples_listeria*8+num_samples_salmonella]\n lysis_single_listeria = lysis_plate.wells()[:num_samples_listeria]\n lysis_single_salmonella = lysis_plate.wells()[\n num_cols_offset_samples_listeria*8:\n num_cols_offset_samples_listeria*8+num_samples_salmonella]\n pcr_single_listeria = pcr_plate.wells()[:num_samples_listeria]\n pcr_single_salmonella = pcr_plate.wells()[\n num_cols_offset_samples_listeria*8:\n num_cols_offset_samples_listeria*8+num_samples_salmonella]\n\n # load liquids\n try:\n if num_samples_listeria > 0:\n positive_control_l.load_liquid(positive_control_l_liq, volume=10)\n if num_samples_salmonella > 0:\n positive_control_s.load_liquid(positive_control_s_liq, volume=10)\n [well.load_liquid(samples_listeria_liq_sample,\n volume=30/len(samples_single_listeria))\n for well in samples_single_listeria]\n [well.load_liquid(samples_salmonella_liq_sample,\n volume=10/len(samples_single_salmonella))\n for well in samples_single_salmonella]\n [well.load_liquid(samples_listeria_liq_lysis,\n volume=30/len(lysis_single_listeria))\n for well in lysis_single_listeria]\n [well.load_liquid(samples_salmonella_liq_lysis,\n volume=10/len(lysis_single_salmonella))\n for well in lysis_single_salmonella]\n [well.load_liquid(samples_listeria_liq_pcr,\n volume=30/len(pcr_single_listeria))\n for well in pcr_single_listeria]\n [well.load_liquid(samples_salmonella_liq_pcr,\n volume=10/len(pcr_single_salmonella))\n for well in pcr_single_salmonella]\n except AttributeError:\n pass\n\n single_tip_count_map = {m300: 0, m20: 0}\n tip_ref = m300.tip_racks[0].wells()[0]\n default_current = 1\n\n right = True\n\n def drop(pip):\n nonlocal right\n offset = 30 if right else -15\n drop_loc = ctx.loaded_labwares[12].wells()[0].top().move(\n Point(x=offset))\n pip.drop_tip(drop_loc)\n right = not right\n\n def pick_up_single(pip=m300):\n mount = Mount.LEFT if pip.mount == 'left' else Mount.RIGHT\n current_single = 1/8*default_current\n if not ctx.is_simulating():\n # attenuate pickup current\n ctx._hw_manager.hardware._attached_instruments[\n mount].update_config_item(\n 'pick_up_current', current_single)\n pip.pick_up_tip(\n [well\n for col in pip.tip_racks[-1].columns()\n for well in col[::-1]][single_tip_count_map[pip]])\n single_tip_count_map[pip] += 1\n if not ctx.is_simulating():\n # reset pickup current\n ctx._hw_manager.hardware._attached_instruments[\n mount].update_config_item('pick_up_current', default_current)\n\n def slow_withdraw(pip, well, delay_seconds=2.0, y_offset=0):\n pip.default_speed /= 10\n if delay_seconds > 0:\n ctx.delay(delay_seconds)\n pip.move_to(well.top().move(Point(y=y_offset)))\n pip.default_speed *= 10\n\n def wick(pip, well, x_magnitude=0.5, z_offset=3.0):\n radius = well.diameter/2 if well.diameter else well.width/2\n pip.default_speed /= 2\n pip.move_to(well.bottom().move(Point(x=x_magnitude*radius,\n z=z_offset)))\n pip.default_speed *= 2\n\n \"\"\" create lysis buffer with enzyme \"\"\"\n if DO_CREATE_LYSIS_BUFFER:\n\n vol_enzyme = 500.0\n num_trans = math.ceil(vol_enzyme/tip_ref.max_volume)\n vol_per_trans = round(vol_enzyme/num_trans, 1)\n\n if num_samples_listeria_remaining % 48 == 0 or \\\n num_samples_listeria_remaining % 48 == 47:\n num_partial_listeria_buffers = 0\n num_bvs_effective = 0\n else:\n num_partial_listeria_buffers = 1\n if 2*math.ceil(num_samples_listeria_remaining/2) % 48 == 0:\n num_bvs_effective = 48\n else:\n num_bvs_effective = 2*math.ceil(\n num_samples_listeria_remaining/2) % 48\n\n num_additional_listeria_buffers = math.ceil(\n ((num_samples_listeria-1) - num_bvs_effective)/48)\n\n # print(f'partial: {num_partial_listeria_buffers}')\n # print(f'additional: {num_additional_listeria_buffers}')\n\n enzyme_listeria_1_creation = enzyme_listeria_1[\n num_partial_listeria_buffers:\n num_partial_listeria_buffers+num_additional_listeria_buffers]\n enzyme_listeria_2_creation = enzyme_listeria_2[\n num_partial_listeria_buffers:\n num_partial_listeria_buffers+num_additional_listeria_buffers]\n lysis_buffer_listeria_creation = lysis_buffer_listeria[\n num_partial_listeria_buffers:\n num_partial_listeria_buffers+num_additional_listeria_buffers]\n # print(lysis_buffer_listeria_creation)\n\n # load partial liq\n if num_samples_listeria > 0:\n try:\n [\n well.load_liquid(\n lysis_buffer_l_prepared_liq,\n volume=11000/num_partial_listeria_buffers)\n for well in lysis_buffer_listeria[\n :num_partial_listeria_buffers]]\n\n # load full liq\n [\n well.load_liquid(\n lysis_buffer_l_fresh_liq,\n volume=11000/num_additional_listeria_buffers)\n for well in lysis_buffer_listeria[\n num_partial_listeria_buffers:\n num_partial_listeria_buffers +\n num_additional_listeria_buffers]]\n [\n well.load_liquid(\n enzyme_listeria_1_liq,\n volume=500/num_additional_listeria_buffers)\n for well in enzyme_listeria_1[\n num_partial_listeria_buffers:\n num_partial_listeria_buffers +\n num_additional_listeria_buffers]]\n [\n well.load_liquid(\n enzyme_listeria_2_liq,\n volume=500/num_additional_listeria_buffers)\n for well in enzyme_listeria_2[\n num_partial_listeria_buffers:\n num_partial_listeria_buffers +\n num_additional_listeria_buffers]]\n except AttributeError:\n pass\n\n # listeria\n for enzyme1, enzyme2, lysis_buff in zip(\n enzyme_listeria_1_creation,\n enzyme_listeria_2_creation,\n lysis_buffer_listeria_creation):\n # enzyme 1\n pick_up_single(m300)\n for _ in range(num_trans):\n m300.aspirate(\n vol_per_trans, enzyme1.bottom().move(\n Point(x=OFFSET_X_TUBERACK, z=1)))\n slow_withdraw(m300, enzyme1)\n m300.move_to(\n lysis_buff.top().move(\n Point(x=OFFSET_X_TUBERACK,\n y=OFFSET_Y_LYSIS_BUFFER_LISTERIA)))\n m300.dispense(\n vol_per_trans,\n lysis_buff.bottom().move(\n Point(x=OFFSET_X_TUBERACK,\n y=OFFSET_Y_LYSIS_BUFFER_LISTERIA,\n z=3)))\n m300.blow_out()\n slow_withdraw(\n m300, lysis_buff, y_offset=OFFSET_Y_LYSIS_BUFFER_LISTERIA)\n drop(m300)\n\n # enzyme 2\n pick_up_single(m300)\n for i in range(num_trans):\n m300.aspirate(\n vol_per_trans, enzyme2.bottom().move(\n Point(x=OFFSET_X_TUBERACK, z=1)))\n slow_withdraw(m300, enzyme2)\n m300.move_to(\n lysis_buff.top().move(Point(\n x=OFFSET_X_TUBERACK,\n y=OFFSET_Y_LYSIS_BUFFER_LISTERIA)))\n m300.dispense(\n vol_per_trans,\n lysis_buff.bottom().move(\n Point(x=OFFSET_X_TUBERACK,\n y=OFFSET_Y_LYSIS_BUFFER_LISTERIA,\n z=3)))\n if i == num_trans - 1:\n if DO_MIX:\n m300.flow_rate.aspirate *= 2\n m300.flow_rate.dispense *= 2\n m300.mix(\n 10, 200,\n lysis_buff.bottom().move(Point(\n x=OFFSET_X_TUBERACK,\n z=3, y=OFFSET_Y_LYSIS_BUFFER_LISTERIA)))\n m300.flow_rate.aspirate /= 2\n m300.flow_rate.dispense /= 2\n m300.blow_out(\n lysis_buff.bottom().move(Point(\n x=OFFSET_X_TUBERACK,\n y=OFFSET_Y_LYSIS_BUFFER_LISTERIA, z=3)))\n slow_withdraw(\n m300, lysis_buff, y_offset=OFFSET_Y_LYSIS_BUFFER_LISTERIA)\n drop(m300)\n\n # salmonella\n if num_samples_salmonella_remaining % 48 == 0 or \\\n num_samples_salmonella_remaining == 47:\n num_partial_salmonella_buffers = 0\n num_bvs_effective = 0\n else:\n num_partial_salmonella_buffers = 1\n if 2*math.ceil(num_samples_salmonella_remaining/2) % 48 == 0:\n num_bvs_effective = 48\n else:\n num_bvs_effective = 2*math.ceil(\n num_samples_salmonella_remaining/2) % 48\n\n num_additional_salmonella_buffers = math.ceil(\n ((num_samples_salmonella-1) - num_bvs_effective)/48)\n\n enzyme_salmonella_creation = enzyme_salmonella[\n num_partial_salmonella_buffers:\n num_partial_salmonella_buffers+num_additional_salmonella_buffers]\n lysis_buffer_salmonella_creation = lysis_buffer_salmonella[\n num_partial_salmonella_buffers:\n num_partial_salmonella_buffers+num_additional_salmonella_buffers]\n\n # load partial liq\n if num_samples_listeria > 0:\n try:\n [\n well.load_liquid(\n lysis_buffer_s_prepared_liq,\n volume=11000/num_partial_salmonella_buffers)\n for well in lysis_buffer_salmonella[\n :num_partial_salmonella_buffers]]\n\n # load full liq\n [\n well.load_liquid(\n lysis_buffer_s_fresh_liq,\n volume=11000/num_additional_salmonella_buffers)\n for well in lysis_buffer_salmonella[\n num_partial_salmonella_buffers:\n num_partial_salmonella_buffers +\n num_additional_salmonella_buffers]]\n [\n well.load_liquid(\n enzyme_salmonella_liq,\n volume=500/num_additional_salmonella_buffers)\n for well in enzyme_salmonella[\n num_partial_salmonella_buffers:\n num_partial_salmonella_buffers +\n num_additional_salmonella_buffers]]\n except AttributeError:\n pass\n\n for enzyme, lysis_buff in zip(enzyme_salmonella_creation,\n lysis_buffer_salmonella_creation):\n # enzyme\n pick_up_single(m300)\n for i in range(num_trans):\n m300.aspirate(vol_per_trans, enzyme.bottom().move(\n Point(x=OFFSET_X_TUBERACK, z=1)))\n slow_withdraw(m300, enzyme)\n m300.move_to(\n lysis_buff.top().move(\n Point(x=OFFSET_X_TUBERACK,\n y=-OFFSET_Y_LYSIS_BUFFER_SALMONELLA)))\n m300.dispense(\n vol_per_trans,\n lysis_buff.bottom().move(\n Point(x=OFFSET_X_TUBERACK,\n y=-OFFSET_Y_LYSIS_BUFFER_SALMONELLA,\n z=3)))\n if i == num_trans - 1:\n if DO_MIX:\n m300.flow_rate.aspirate *= 2\n m300.flow_rate.dispense *= 2\n m300.mix(\n 10, 200,\n lysis_buff.bottom().move(Point(\n x=OFFSET_X_TUBERACK,\n z=3, y=-OFFSET_Y_LYSIS_BUFFER_SALMONELLA)))\n m300.flow_rate.aspirate /= 2\n m300.flow_rate.dispense /= 2\n m300.blow_out(\n lysis_buff.bottom().move(\n Point(x=OFFSET_X_TUBERACK,\n y=-OFFSET_Y_LYSIS_BUFFER_SALMONELLA,\n z=3)))\n slow_withdraw(\n m300, lysis_buff,\n y_offset=-OFFSET_Y_LYSIS_BUFFER_SALMONELLA)\n drop(m300)\n\n \"\"\" transfer lysis buffer to lysis plate \"\"\"\n vol_overage = 20\n\n if num_samples_listeria > 0:\n if DO_DISTRIBUTE_LYSIS_BUFFER:\n lysis_buffer_listeria_dests = lysis_plate.wells()[\n :num_samples_listeria-2] + [\n lysis_plate.wells()[num_samples_listeria-1]]\n vol_lysis_buffer_listeria = 70.0\n num_dests_per_asp = int(\n (tip_ref.max_volume-vol_overage)//vol_lysis_buffer_listeria)\n num_asp = math.ceil(\n len(lysis_buffer_listeria_dests)/num_dests_per_asp)\n lysis_buffer_listeria_dest_sets = [\n lysis_buffer_listeria_dests[i*num_dests_per_asp:\n (i+1)*num_dests_per_asp]\n if i < num_asp - 1\n else lysis_buffer_listeria_dests[i*num_dests_per_asp:]\n for i in range(num_asp)]\n pick_up_single(m300)\n m300.aspirate(\n vol_overage,\n lysis_buffer_listeria[0].bottom().move(Point(\n y=OFFSET_Y_LYSIS_BUFFER_LISTERIA,\n z=OFFSET_Z_LYSIS_BUFFER_LISTERIA)))\n num_asp_listeria_remaining = math.ceil(\n (num_samples_listeria_remaining % 48) / 2)\n bump = 24 - num_asp_listeria_remaining \\\n if 24 - num_asp_listeria_remaining != 24 else 0\n for i, d_set in enumerate(lysis_buffer_listeria_dest_sets):\n set_ind = i + bump\n lysis_buff = lysis_buffer_listeria[set_ind//24]\n # m300.blow_out(lysis_buff.top(-1))\n m300.aspirate(\n len(d_set)*vol_lysis_buffer_listeria,\n lysis_buff.bottom().move(Point(\n y=OFFSET_Y_LYSIS_BUFFER_LISTERIA,\n z=OFFSET_Z_LYSIS_BUFFER_LISTERIA)))\n slow_withdraw(\n m300, lysis_buff, y_offset=OFFSET_Y_LYSIS_BUFFER_LISTERIA)\n for d in d_set:\n m300.dispense(vol_lysis_buffer_listeria, d.bottom(2))\n slow_withdraw(m300, d)\n drop(m300)\n\n if num_samples_salmonella > 0:\n if DO_DISTRIBUTE_LYSIS_BUFFER:\n available_wells = [\n well for col in lysis_plate.columns()[num_cols_listeria:]\n for well in col]\n lysis_buffer_salmonella_dests = available_wells[\n :num_samples_salmonella-2] + [\n available_wells[num_samples_salmonella-1]]\n vol_lysis_buffer_salmonella = 90.0 if not salmonella_meat else 50.0\n num_dests_per_asp = 2 # hard-set for now\n num_asp = math.ceil(\n len(lysis_buffer_salmonella_dests)/num_dests_per_asp)\n lysis_buffer_salmonella_dest_sets = [\n lysis_buffer_salmonella_dests[i*num_dests_per_asp:\n (i+1)*num_dests_per_asp]\n if i < num_asp - 1\n else lysis_buffer_salmonella_dests[i*num_dests_per_asp:]\n for i in range(num_asp)]\n pick_up_single(m300)\n m300.aspirate(\n vol_overage,\n lysis_buffer_salmonella[0].bottom().move(\n Point(y=-OFFSET_Y_LYSIS_BUFFER_SALMONELLA,\n z=OFFSET_Z_LYSIS_BUFFER_SALMONELLA)))\n num_asp_salmonella_remaining = math.ceil(\n (num_samples_salmonella_remaining % 48) / 2)\n bump_check = int(48/num_dests_per_asp)\n bump = bump_check - num_asp_salmonella_remaining \\\n if bump_check - num_asp_salmonella_remaining != bump_check \\\n else 0\n for i, d_set in enumerate(lysis_buffer_salmonella_dest_sets):\n set_ind = i + bump\n lysis_buff = lysis_buffer_salmonella[set_ind//bump_check]\n # m300.blow_out(lysis_buff.top(-1))\n # print('salmonella', i, set_ind, lysis_buff, len(d_set))\n # m300.blow_out(lysis_buff.top(-1))\n m300.aspirate(\n len(d_set)*vol_lysis_buffer_salmonella,\n lysis_buff.bottom().move(Point(\n y=-OFFSET_Y_LYSIS_BUFFER_SALMONELLA,\n z=OFFSET_Z_LYSIS_BUFFER_SALMONELLA)))\n slow_withdraw(m300, lysis_buff,\n y_offset=-OFFSET_Y_LYSIS_BUFFER_SALMONELLA)\n for d in d_set:\n m300.dispense(vol_lysis_buffer_salmonella, d.bottom(2))\n slow_withdraw(m300, d)\n drop(m300)\n\n if DO_TRANSFER_SAMPLE_TO_LYSIS:\n \"\"\" transfer listeria \"\"\"\n vol_listeria = 30.0\n num_sample_cols_listeria = math.ceil((num_samples_listeria-2)/8)\n for s, d in zip(sample_plate.rows()[0][:num_sample_cols_listeria],\n lysis_plate.rows()[0][:num_sample_cols_listeria]):\n if sample_rack_type == 'bioplastics':\n asp_loc = s.bottom(2)\n else:\n asp_loc = s.top(-17.36)\n m300.pick_up_tip()\n m300.aspirate(vol_listeria, asp_loc)\n slow_withdraw(m300, s)\n m300.dispense(vol_listeria, d.bottom(2))\n if DO_MIX:\n m300.mix(3, 50, d.bottom(2))\n m300.blow_out(d.bottom(2))\n slow_withdraw(m300, d)\n drop(m300)\n\n \"\"\" transfer salmonella \"\"\"\n [pip, vol_salmonella] = [m20, 10.0] \\\n if not salmonella_meat else [m300, 50.0]\n num_cols_samples_salmonella = math.ceil((num_samples_salmonella-2)/8)\n for s, d in zip(\n sample_plate.rows()[0][\n num_cols_listeria:\n num_cols_listeria+num_cols_samples_salmonella],\n lysis_plate.rows()[0][\n num_cols_listeria:\n num_cols_listeria+num_cols_samples_salmonella]):\n pip.pick_up_tip()\n if sample_rack_type == 'bioplastics':\n asp_loc = s.bottom(2)\n else:\n asp_loc = s.top(-17.36)\n pip.aspirate(vol_salmonella, asp_loc)\n slow_withdraw(pip, s)\n pip.dispense(vol_salmonella, d.bottom(2))\n if DO_MIX:\n pip.mix(3, 18, d.bottom(2))\n pip.blow_out(d.bottom(2))\n slow_withdraw(pip, d)\n drop(pip)\n\n if DO_SET_TEMP:\n ctx.delay(minutes=20, msg='Incubating for 20 minutes @ 37C.')\n tempdeck.set_temperature(95)\n ctx.delay(minutes=10, msg='Incubating for 10 minutes @ 95C.')\n tempdeck.set_temperature(37)\n\n vol_sample = 5.0\n\n if DO_TRANSFER_SAMPLE_TO_PCR:\n \"\"\" transfer samples to PCR plate \"\"\"\n\n # listeria\n if num_samples_listeria > 0:\n for s, d in zip(lysis_plate.rows()[0][:num_cols_listeria],\n pcr_plate.rows()[0][:num_cols_listeria]):\n m20.pick_up_tip()\n m20.aspirate(5, s.top()) # pre air gap\n m20.aspirate(vol_sample, s)\n slow_withdraw(m20, s)\n m20.dispense(vol_sample, d.bottom(1))\n # if DO_MIX:\n # m20.mix(3, vol_sample*0.8, d.bottom(1))\n m20.dispense(m20.current_volume, d.bottom(1))\n slow_withdraw(m20, d)\n # wick(m20, d)\n drop(m20)\n\n # salmonella\n if num_samples_salmonella > 0:\n for s, d in zip(\n lysis_plate.rows()[0][\n num_cols_listeria:\n num_cols_listeria+num_cols_salmonella],\n pcr_plate.rows()[0][\n num_cols_listeria:\n num_cols_listeria+num_cols_salmonella]):\n m20.pick_up_tip()\n m20.aspirate(5, s.top()) # pre air gap\n m20.aspirate(vol_sample, s)\n slow_withdraw(m20, s)\n m20.dispense(vol_sample, d.bottom(1))\n # if DO_MIX:\n # m20.mix(3, vol_sample*0.8, d.bottom(1))\n m20.dispense(m20.current_volume, d.bottom(1))\n slow_withdraw(m20, d)\n m20.air_gap(5)\n # wick(m20, d)\n drop(m20)\n\n if DO_TRANSFER_POSITIVE_CONTROL:\n \"\"\" transfer positive controls \"\"\"\n vol_positive_control = vol_sample\n if num_samples_listeria > 0:\n positive_control_l_dest = pcr_plate.wells()[num_samples_listeria-2]\n pick_up_single(m20)\n m20.aspirate(5, positive_control_l_dest.top()) # pre air gap\n m20.aspirate(vol_positive_control, positive_control_l)\n slow_withdraw(m20, positive_control_l)\n m20.dispense(m20.current_volume, positive_control_l_dest.bottom(1))\n slow_withdraw(m20, positive_control_l_dest)\n # if DO_MIX:\n # m20.mix(3, vol_positive_control*0.8,\n # positive_control_l_dest.bottom(1))\n # wick(m20, positive_control_l_dest)\n drop(m20)\n\n if num_samples_salmonella > 0:\n available_wells = [\n well for col in pcr_plate.columns()[num_cols_listeria:]\n for well in col]\n positive_control_s_dest = available_wells[num_samples_salmonella-2]\n pick_up_single(m20)\n m20.aspirate(5, positive_control_s.top()) # pre air gap\n m20.aspirate(vol_positive_control, positive_control_s)\n slow_withdraw(m20, positive_control_s)\n m20.dispense(m20.current_volume, positive_control_s_dest.bottom(1))\n slow_withdraw(m20, positive_control_s_dest)\n # if DO_MIX:\n # m20.mix(3, vol_positive_control*0.8,\n # positive_control_s_dest.bottom(1))\n # wick(m20, positive_control_s_dest)\n drop(m20)\n\n tempdeck.deactivate()\n", "custom_labware_defs": [ { "brand": { diff --git a/protocols/gsdx/bacgene.ot2.apiv2.py b/protocols/gsdx/bacgene.ot2.apiv2.py index 343fe5987..aa27099a6 100644 --- a/protocols/gsdx/bacgene.ot2.apiv2.py +++ b/protocols/gsdx/bacgene.ot2.apiv2.py @@ -299,33 +299,42 @@ def wick(pip, well, x_magnitude=0.5, z_offset=3.0): # print(lysis_buffer_listeria_creation) # load partial liq - try: - [well.load_liquid( - lysis_buffer_l_prepared_liq, - volume=11000/num_partial_listeria_buffers) - for well in lysis_buffer_listeria[:num_partial_listeria_buffers]] - - # load full liq - [well.load_liquid( - lysis_buffer_l_fresh_liq, - volume=11000/num_additional_listeria_buffers) - for well in lysis_buffer_listeria[ - num_partial_listeria_buffers: - num_partial_listeria_buffers+num_additional_listeria_buffers]] - [well.load_liquid( - enzyme_listeria_1_liq, - volume=500/num_additional_listeria_buffers) - for well in enzyme_listeria_1[ - num_partial_listeria_buffers: - num_partial_listeria_buffers+num_additional_listeria_buffers]] - [well.load_liquid( - enzyme_listeria_2_liq, - volume=500/num_additional_listeria_buffers) - for well in enzyme_listeria_2[ - num_partial_listeria_buffers: - num_partial_listeria_buffers+num_additional_listeria_buffers]] - except AttributeError: - pass + if num_samples_listeria > 0: + try: + [ + well.load_liquid( + lysis_buffer_l_prepared_liq, + volume=11000/num_partial_listeria_buffers) + for well in lysis_buffer_listeria[ + :num_partial_listeria_buffers]] + + # load full liq + [ + well.load_liquid( + lysis_buffer_l_fresh_liq, + volume=11000/num_additional_listeria_buffers) + for well in lysis_buffer_listeria[ + num_partial_listeria_buffers: + num_partial_listeria_buffers + + num_additional_listeria_buffers]] + [ + well.load_liquid( + enzyme_listeria_1_liq, + volume=500/num_additional_listeria_buffers) + for well in enzyme_listeria_1[ + num_partial_listeria_buffers: + num_partial_listeria_buffers + + num_additional_listeria_buffers]] + [ + well.load_liquid( + enzyme_listeria_2_liq, + volume=500/num_additional_listeria_buffers) + for well in enzyme_listeria_2[ + num_partial_listeria_buffers: + num_partial_listeria_buffers + + num_additional_listeria_buffers]] + except AttributeError: + pass # listeria for enzyme1, enzyme2, lysis_buff in zip( @@ -414,30 +423,34 @@ def wick(pip, well, x_magnitude=0.5, z_offset=3.0): num_partial_salmonella_buffers+num_additional_salmonella_buffers] # load partial liq - try: - [well.load_liquid( - lysis_buffer_s_prepared_liq, - volume=11000/num_partial_salmonella_buffers) - for well in lysis_buffer_salmonella[ - :num_partial_salmonella_buffers]] - - # load full liq - [well.load_liquid( - lysis_buffer_s_fresh_liq, - volume=11000/num_additional_salmonella_buffers) - for well in lysis_buffer_salmonella[ - num_partial_salmonella_buffers: - num_partial_salmonella_buffers + - num_additional_salmonella_buffers]] - [well.load_liquid( - enzyme_salmonella_liq, - volume=500/num_additional_salmonella_buffers) - for well in enzyme_salmonella[ - num_partial_salmonella_buffers: - num_partial_salmonella_buffers + - num_additional_salmonella_buffers]] - except AttributeError: - pass + if num_samples_listeria > 0: + try: + [ + well.load_liquid( + lysis_buffer_s_prepared_liq, + volume=11000/num_partial_salmonella_buffers) + for well in lysis_buffer_salmonella[ + :num_partial_salmonella_buffers]] + + # load full liq + [ + well.load_liquid( + lysis_buffer_s_fresh_liq, + volume=11000/num_additional_salmonella_buffers) + for well in lysis_buffer_salmonella[ + num_partial_salmonella_buffers: + num_partial_salmonella_buffers + + num_additional_salmonella_buffers]] + [ + well.load_liquid( + enzyme_salmonella_liq, + volume=500/num_additional_salmonella_buffers) + for well in enzyme_salmonella[ + num_partial_salmonella_buffers: + num_partial_salmonella_buffers + + num_additional_salmonella_buffers]] + except AttributeError: + pass for enzyme, lysis_buff in zip(enzyme_salmonella_creation, lysis_buffer_salmonella_creation):