-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
“ramifarawi”
committed
Nov 2, 2023
1 parent
f430189
commit d5aba16
Showing
4 changed files
with
3 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,7 @@ | ||
{ | ||
"content": "import math\n\nmetadata = {\n 'protocolName': 'ELISA: Dilution',\n 'author': 'Alise <[email protected]>',\n 'source': 'Custom Protocol Request',\n 'apiLevel': '2.14'\n}\n\n\ndef run(ctx):\n [starting_buffer_volume, number_of_standards,\n concentration_csv, init_vol_buff] = get_values( # noqa: F821\n 'starting_buffer_volume', 'number_of_standards',\n 'concentration_csv', \"init_vol_buff\")\n\n # labware setup\n tuberack_1 = ctx.load_labware(\n 'opentrons_10_tuberack_falcon_4x50ml_6x15ml_conical', '1')\n tuberack_4 = ctx.load_labware(\n 'opentrons_24_tuberack_eppendorf_2ml_safelock_snapcap', '4')\n deep_plates = [ctx.load_labware('nest_96_wellplate_2ml_deep', slot)\n for slot in ['5', '6']]\n\n tiprack_1000 = ctx.load_labware('opentrons_96_tiprack_1000ul', '2')\n tipracks_300 = [ctx.load_labware('opentrons_96_tiprack_300ul', slot)\n for slot in ['3', '7']]\n\n # instrument setup\n p1000 = ctx.load_instrument(\n 'p1000_single',\n mount='left',\n tip_racks=[tiprack_1000])\n p300 = ctx.load_instrument(\n 'p300_single',\n mount='right',\n tip_racks=tipracks_300)\n\n # reagent setup\n tubes = [well for row in tuberack_4.rows() for well in row]\n samples = tubes[2 + number_of_standards:]\n dilution_buffer = tuberack_1.wells_by_name()['A3']\n\n v_naught_buff = init_vol_buff*1000\n\n radius_sds = dilution_buffer.diameter/2\n\n h_naught_buff = 0.85*v_naught_buff/(math.pi*radius_sds**2)\n\n h_buff = h_naught_buff\n\n def adjust_height(volume_from_loop):\n nonlocal h_buff\n\n radius = radius_sds\n\n dh = (volume_from_loop/(math.pi*radius**2))*1.33\n\n h_buff -= dh\n\n if h_buff < 12:\n h_buff = 1\n\n dil_dests = [row for deep_plate in deep_plates\n for row in deep_plate.rows()]\n\n conc_lists = [[int(cell) for cell in line.split(',') if cell]\n for line in concentration_csv.splitlines() if line]\n\n concs = [5, 10, 25, 50, 100, 500, 1000, 5000, 10000, 25000, 50000, 100000]\n\n diluent_vols = [320, 450, 180, 320, 450, 320, 450, 320, 450, 180, 320, 450]\n\n sample_vols = [80, 50, 120, 80, 50, 80, 50, 80, 50, 120, 80, 50]\n\n concs_init = [1, 1, 10, 10, 10, 100, 100, 1000, 1000, 1000, 10000, 10000]\n dil_formulae = {\n conc: {'diluent_vol': diluent_vol,\n 'sample_vol': sample_vol,\n 'conc_init': conc_init,\n 'col_index': index}\n for conc, diluent_vol, sample_vol, conc_init, index in zip(\n concs, diluent_vols, sample_vols, concs_init, range(12))\n }\n\n dilution_concs = []\n for sample_index, concentrations in enumerate(conc_lists):\n new_concs = []\n factors = [10, 100, 1000, 10000, 100000]\n conc_inspect = max(concentrations)\n\n for factor_index, factor in enumerate(factors):\n if (conc_inspect // factor) > 0 and (conc_inspect // factor) < 10:\n [new_concs.append(factors[:factor_index+1])]\n [concentrations.pop(concentrations.index(num))\n for num in factors[:factor_index+1] if num in concentrations]\n [new_concs.append([conc_inspect])\n if conc_inspect not in new_concs[0] else '']\n [concentrations.pop(concentrations.index(conc_inspect))\n if conc_inspect in concentrations else '']\n [new_concs.append([conc]) for conc in concentrations if concentrations]\n dilution_concs.append(new_concs)\n\n # transfer dilution buffer\n\n for sample_index, (row, concs) in enumerate(\n zip(dil_dests, dilution_concs)):\n volumes = [dil_formulae[conc]['diluent_vol']\n for c_list in concs for conc in c_list]\n dests = [row[dil_formulae[conc]['col_index']]\n for c_list in concs for conc in c_list]\n for volume, dest in zip(volumes, dests):\n p1000.pick_up_tip()\n p1000.transfer(\n volume,\n dilution_buffer.bottom(z=h_buff),\n dest.top(-20),\n new_tip='never')\n\n adjust_height(volume)\n p1000.blow_out(dest.top())\n p1000.drop_tip()\n\n # transfer samples\n for sample_index, (row, concs) in enumerate(\n zip(dil_dests, dilution_concs)):\n for c_list in concs:\n volumes = [dil_formulae[conc]['sample_vol'] for conc in c_list]\n sources = []\n for conc in c_list:\n if dil_formulae[conc]['conc_init'] == 1:\n sources.append(samples[sample_index])\n else:\n source_conc = dil_formulae[conc]['conc_init']\n sources.append(\n row[dil_formulae[source_conc]['col_index']])\n dests = [row[dil_formulae[conc]['col_index']]\n for conc in c_list]\n p300.pick_up_tip()\n for volume, source, dest in zip(volumes, sources, dests):\n p300.transfer(volume, source, dest.bottom(2), new_tip='never')\n p300.mix(3, 200, dest.bottom(2))\n p300.drop_tip()\n", | ||
"content": "import math\n\nmetadata = {\n 'protocolName': 'ELISA: Dilution',\n 'author': 'Alise <[email protected]>',\n 'source': 'Custom Protocol Request',\n 'apiLevel': '2.14'\n}\n\n\ndef run(ctx):\n [number_of_standards,\n concentration_csv, init_vol_buff] = get_values( # noqa: F821\n 'number_of_standards',\n 'concentration_csv', \"init_vol_buff\")\n\n # labware setup\n tuberack_1 = ctx.load_labware(\n 'opentrons_10_tuberack_falcon_4x50ml_6x15ml_conical', '1')\n tuberack_4 = ctx.load_labware(\n 'opentrons_24_tuberack_eppendorf_2ml_safelock_snapcap', '4')\n deep_plates = [ctx.load_labware('nest_96_wellplate_2ml_deep', slot)\n for slot in ['5', '6']]\n\n tiprack_1000 = ctx.load_labware('opentrons_96_tiprack_1000ul', '2')\n tipracks_300 = [ctx.load_labware('opentrons_96_tiprack_300ul', slot)\n for slot in ['3', '7']]\n\n # instrument setup\n p1000 = ctx.load_instrument(\n 'p1000_single',\n mount='left',\n tip_racks=[tiprack_1000])\n p300 = ctx.load_instrument(\n 'p300_single',\n mount='right',\n tip_racks=tipracks_300)\n\n # reagent setup\n tubes = [well for row in tuberack_4.rows() for well in row]\n samples = tubes[2 + number_of_standards:]\n dilution_buffer = tuberack_1.wells_by_name()['A3']\n\n v_naught_buff = init_vol_buff*1000\n\n radius_sds = dilution_buffer.diameter/2\n\n h_naught_buff = 0.85*v_naught_buff/(math.pi*radius_sds**2)\n\n h_buff = h_naught_buff\n\n def adjust_height(volume_from_loop):\n nonlocal h_buff\n\n radius = radius_sds\n\n dh = (volume_from_loop/(math.pi*radius**2))*1.33\n\n h_buff -= dh\n\n if h_buff < 12:\n h_buff = 1\n\n dil_dests = [row for deep_plate in deep_plates\n for row in deep_plate.rows()]\n\n conc_lists = [[int(cell) for cell in line.split(',') if cell]\n for line in concentration_csv.splitlines() if line]\n\n concs = [5, 10, 25, 50, 100, 500, 1000, 5000, 10000, 25000, 50000, 100000]\n\n diluent_vols = [320, 450, 180, 320, 450, 320, 450, 320, 450, 180, 320, 450]\n\n sample_vols = [80, 50, 120, 80, 50, 80, 50, 80, 50, 120, 80, 50]\n\n concs_init = [1, 1, 10, 10, 10, 100, 100, 1000, 1000, 1000, 10000, 10000]\n dil_formulae = {\n conc: {'diluent_vol': diluent_vol,\n 'sample_vol': sample_vol,\n 'conc_init': conc_init,\n 'col_index': index}\n for conc, diluent_vol, sample_vol, conc_init, index in zip(\n concs, diluent_vols, sample_vols, concs_init, range(12))\n }\n\n dilution_concs = []\n for sample_index, concentrations in enumerate(conc_lists):\n new_concs = []\n factors = [10, 100, 1000, 10000, 100000]\n conc_inspect = max(concentrations)\n\n for factor_index, factor in enumerate(factors):\n if (conc_inspect // factor) > 0 and (conc_inspect // factor) < 10:\n [new_concs.append(factors[:factor_index+1])]\n [concentrations.pop(concentrations.index(num))\n for num in factors[:factor_index+1] if num in concentrations]\n [new_concs.append([conc_inspect])\n if conc_inspect not in new_concs[0] else '']\n [concentrations.pop(concentrations.index(conc_inspect))\n if conc_inspect in concentrations else '']\n [new_concs.append([conc]) for conc in concentrations if concentrations]\n dilution_concs.append(new_concs)\n\n # transfer dilution buffer\n\n for sample_index, (row, concs) in enumerate(\n zip(dil_dests, dilution_concs)):\n volumes = [dil_formulae[conc]['diluent_vol']\n for c_list in concs for conc in c_list]\n dests = [row[dil_formulae[conc]['col_index']]\n for c_list in concs for conc in c_list]\n for volume, dest in zip(volumes, dests):\n p1000.pick_up_tip()\n p1000.transfer(\n volume,\n dilution_buffer.bottom(z=h_buff),\n dest.top(-20),\n new_tip='never')\n\n adjust_height(volume)\n p1000.blow_out(dest.top())\n p1000.drop_tip()\n\n # transfer samples\n for sample_index, (row, concs) in enumerate(\n zip(dil_dests, dilution_concs)):\n for c_list in concs:\n volumes = [dil_formulae[conc]['sample_vol'] for conc in c_list]\n sources = []\n for conc in c_list:\n if dil_formulae[conc]['conc_init'] == 1:\n sources.append(samples[sample_index])\n else:\n source_conc = dil_formulae[conc]['conc_init']\n sources.append(\n row[dil_formulae[source_conc]['col_index']])\n dests = [row[dil_formulae[conc]['col_index']]\n for conc in c_list]\n p300.pick_up_tip()\n for volume, source, dest in zip(volumes, sources, dests):\n p300.transfer(volume, source, dest.bottom(2), new_tip='never')\n p300.mix(3, 200, dest.bottom(2))\n p300.drop_tip()\n", | ||
"custom_labware_defs": [], | ||
"fields": [ | ||
{ | ||
"default": 50.0, | ||
"label": "starting buffer volume, in ul", | ||
"name": "starting_buffer_volume", | ||
"type": "float" | ||
}, | ||
{ | ||
"default": 6, | ||
"label": "number of standards", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters