Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update 4e4c0c.ot2.apiv2.py.json #4940

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions protoBuilds/4e4c0c/4e4c0c.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': 'KingFisher Flex Plate Set Up',\n 'author': 'Steve Plonk <[email protected]>',\n 'apiLevel': '2.11'\n}\n\n\ndef run(ctx):\n\n # get parameter values from json\n [num_cols, labware_processing_plate, labware_reservoir_12well,\n labware_reservoir_1well,\n m300_mount, m20_mount] = get_values( # noqa: F821\n \"num_cols\", \"labware_processing_plate\", \"labware_reservoir_12well\",\n \"labware_reservoir_1well\", \"m300_mount\", \"m20_mount\")\n\n ctx.set_rail_lights(True)\n ctx.delay(seconds=5)\n if not 1 <= num_cols <= 12:\n raise Exception('Invalid number of columns (must be 1-12).')\n\n # tips, p300 and p20 multi\n tips300 = [ctx.load_labware(\n \"opentrons_96_filtertiprack_200ul\", str(slot)) for slot in [11]]\n p300m = ctx.load_instrument(\n \"p300_multi_gen2\", m300_mount, tip_racks=tips300)\n\n tips20 = [ctx.load_labware(\n \"opentrons_96_filtertiprack_20ul\", str(slot)) for slot in [10]]\n p20m = ctx.load_instrument(\n \"p20_multi_gen2\", m20_mount, tip_racks=tips20)\n\n # yield list chunks of size n\n def create_chunks(list_name, n):\n for i in range(0, len(list_name), n):\n yield list_name[i:i+n]\n\n # return liquid height in a well\n def liq_height(well, effective_diameter=None):\n if well.diameter:\n if effective_diameter:\n radius = effective_diameter / 2\n else:\n radius = well.diameter / 2\n csa = math.pi*(radius**2)\n else:\n csa = well.length*well.width\n return well.liq_vol / csa\n\n def slow_tip_withdrawal(pipette, well_location, to_center=False):\n if pipette.mount == 'right':\n axis = 'A'\n else:\n axis = 'Z'\n\n ctx.max_speeds[axis] = 10\n if to_center is False:\n pipette.move_to(well_location.top())\n else:\n pipette.move_to(well_location.center())\n ctx.max_speeds[axis] = None\n\n # to extend aspirate\n def extended1(func):\n \"\"\"\n Extend aspirate method.\n\n For viscous liquids.\n Half default flow rate.\n Delay after aspiration.\n Slow departure of tip.\n \"\"\"\n def wrapper(*args, **kwargs):\n func(*args, **kwargs, rate=0.5)\n ctx.delay(seconds=1)\n slow_tip_withdrawal(func.__self__, [*args][1].labware.object)\n return wrapper\n\n # to extend aspirate\n def extended2(func):\n \"\"\"\n Extend aspirate method.\n\n For volatile liquids.\n Post-aspirate air gap.\n \"\"\"\n def wrapper(*args, **kwargs):\n func(*args, **kwargs)\n func.__self__.air_gap(20)\n return wrapper\n\n # to extend dispense\n def extended3(func):\n \"\"\"\n Extend dispense method.\n\n For viscous liquids.\n Half default flow rate.\n Delay after dispense.\n Blow out at top of well.\n Touch tip.\n \"\"\"\n def wrapper(*args, **kwargs):\n func(*args, **kwargs, rate=0.5)\n ctx.delay(seconds=1)\n func.__self__.blow_out([*args][1].labware.object.top())\n func.__self__.touch_tip()\n return wrapper\n\n # to extend dispense\n def extended4(func):\n \"\"\"\n Extend dispense method.\n\n For volatile liquids.\n Delayed blow out at top of well.\n Touch tip.\n \"\"\"\n def wrapper(*args, **kwargs):\n func(*args, **kwargs)\n func.__self__.move_to([*args][1].labware.object.top())\n ctx.delay(seconds=0.5)\n func.__self__.blow_out([*args][1].labware.object.top())\n func.__self__.touch_tip()\n return wrapper\n\n # to extend dispense\n def extended5(func):\n \"\"\"\n Extend dispense method.\n\n For aqueous liquids.\n Blow out at top of well.\n Touch tip.\n \"\"\"\n def wrapper(*args, **kwargs):\n func(*args, **kwargs)\n func.__self__.blow_out([*args][1].labware.object.top())\n func.__self__.touch_tip()\n return wrapper\n\n washreservoir = ctx.load_labware(\n labware_reservoir_1well, '8', 'Wash Buffer')\n\n etohreservoir = ctx.load_labware(\n labware_reservoir_1well, '9', '80 Percent EtOH')\n\n twelvewellreservoir = ctx.load_labware(\n labware_reservoir_12well, '7', '12-Well Reservoir')\n\n source_dict = {\n 'Proteinase K Solution': twelvewellreservoir.wells_by_name()['A1'],\n 'Wash Buffer': washreservoir.wells()[0],\n '80 Percent EtOH': etohreservoir.wells()[0],\n 'Elution Solution': twelvewellreservoir.wells_by_name()['A12']}\n\n processingplates = [\n ctx.load_labware(\n labware_processing_plate, str(slot+1), name) for name, slot in zip(\n ['Sample Plate',\n 'Wash Plate 1',\n 'Wash Plate 2',\n 'Wash Plate 3',\n 'Elution Plate 4'],\n [*range(5)])]\n\n for source, lc, tfervol in zip(\n [value for value in source_dict.values()],\n ['aqueous', 'viscous', 'volatile', 'aqueous'],\n [10, 1000, 1500, 100]):\n\n source.liq_class = lc\n source.liq_vol = 1.1*(tfervol*8*num_cols)\n\n for source, transfervolume, plate in zip(\n [source_dict[reagent] for reagent in [\n 'Proteinase K Solution',\n 'Wash Buffer',\n '80 Percent EtOH',\n '80 Percent EtOH',\n 'Elution Solution']],\n [10, 1000, 1000, 500, 100],\n processingplates):\n\n pip = p20m if transfervolume <= 20 else p300m\n\n # python dict to store and dispatch extended aspirate\n pip_aspirate = {'viscous': extended1(pip.aspirate),\n 'volatile': extended2(pip.aspirate),\n 'aqueous': pip.aspirate}\n\n # python dict to store and dispatch extended dispense\n pip_dispense = {'viscous': extended3(pip.dispense),\n 'volatile': extended4(pip.dispense),\n 'aqueous': extended5(pip.dispense)}\n\n vol_airgap = 20 if source.liq_class == 'volatile' else 0\n\n reps = math.ceil(\n transfervolume / (\n pip.tip_racks[0].wells()[0].max_volume - vol_airgap))\n\n v = transfervolume / reps\n\n pip.pick_up_tip()\n\n for column in plate.columns()[:num_cols]:\n\n dest = column[0].top(\n ) if v > 50 else column[0].bottom(1)\n\n for rep in range(reps):\n\n source.liq_vol -= v*pip.channels\n\n tipheight = liq_height(\n source) - 3 if liq_height(source) - 3 > 1 else 1\n\n pip_aspirate[source.liq_class](v, source.bottom(tipheight))\n\n pip_dispense[source.liq_class](v+vol_airgap, dest)\n\n pip.drop_tip()\n\n ctx.comment(\"Finished set up of five processing plates\")\n",
"content": "import math\n\nmetadata = {\n 'protocolName': 'KingFisher Flex Plate Set Up',\n 'author': 'Steve Plonk <[email protected]>',\n 'apiLevel': '2.11'\n}\n\n\ndef run(ctx):\n\n # get parameter values from json\n [num_cols, labware_processing_plate, labware_reservoir_12well,\n labware_reservoir_1well,\n m300_mount, m20_mount] = get_values( # noqa: F821\n \"num_cols\", \"labware_processing_plate\", \"labware_reservoir_12well\",\n \"labware_reservoir_1well\", \"m300_mount\", \"m20_mount\")\n\n ctx.set_rail_lights(True)\n ctx.delay(seconds=5)\n if not 1 <= num_cols <= 12:\n raise Exception('Invalid number of columns (must be 1-12).')\n\n # tips, p300 and p20 multi\n tips300 = [ctx.load_labware(\n \"opentrons_96_filtertiprack_200ul\", str(slot)) for slot in [11]]\n p300m = ctx.load_instrument(\n \"p300_multi_gen2\", m300_mount, tip_racks=tips300)\n\n tips20 = [ctx.load_labware(\n \"opentrons_96_filtertiprack_20ul\", str(slot)) for slot in [10]]\n p20m = ctx.load_instrument(\n \"p20_multi_gen2\", m20_mount, tip_racks=tips20)\n\n # yield list chunks of size n\n def create_chunks(list_name, n):\n for i in range(0, len(list_name), n):\n yield list_name[i:i+n]\n\n # return liquid height in a well\n def liq_height(well, effective_diameter=None):\n if well.diameter:\n if effective_diameter:\n radius = effective_diameter / 2\n else:\n radius = well.diameter / 2\n csa = math.pi*(radius**2)\n else:\n csa = well.length*well.width\n return well.liq_vol / csa\n\n def slow_tip_withdrawal(pipette, well_location, to_center=False):\n if pipette.mount == 'right':\n axis = 'A'\n else:\n axis = 'Z'\n\n ctx.max_speeds[axis] = 10\n if to_center is False:\n pipette.move_to(well_location.top())\n else:\n pipette.move_to(well_location.center())\n ctx.max_speeds[axis] = None\n\n # to extend aspirate\n def extended1(func):\n \"\"\"\n Extend aspirate method.\n\n For viscous liquids.\n Half default flow rate.\n Delay after aspiration.\n Slow departure of tip.\n \"\"\"\n def wrapper(*args, **kwargs):\n func(*args, **kwargs, rate=0.5)\n ctx.delay(seconds=1)\n slow_tip_withdrawal(func.__self__, [*args][1].labware.object)\n return wrapper\n\n # to extend aspirate\n def extended2(func):\n \"\"\"\n Extend aspirate method.\n\n For volatile liquids.\n Post-aspirate air gap.\n \"\"\"\n def wrapper(*args, **kwargs):\n func(*args, **kwargs)\n func.__self__.air_gap(20)\n return wrapper\n\n # to extend dispense\n def extended3(func):\n \"\"\"\n Extend dispense method.\n\n For viscous liquids.\n Half default flow rate.\n Delay after dispense.\n Blow out at top of well.\n Touch tip.\n \"\"\"\n def wrapper(*args, **kwargs):\n func(*args, **kwargs, rate=0.5)\n ctx.delay(seconds=1)\n # func.__self__.blow_out([*args][1].labware.object.top())\n func.__self__.touch_tip()\n return wrapper\n\n # to extend dispense\n def extended4(func):\n \"\"\"\n Extend dispense method.\n\n For volatile liquids.\n Delayed blow out at top of well.\n Touch tip.\n \"\"\"\n def wrapper(*args, **kwargs):\n func(*args, **kwargs)\n func.__self__.move_to([*args][1].labware.object.top())\n ctx.delay(seconds=0.5)\n # func.__self__.blow_out([*args][1].labware.object.top())\n func.__self__.touch_tip()\n return wrapper\n\n # to extend dispense\n def extended5(func):\n \"\"\"\n Extend dispense method.\n\n For aqueous liquids.\n Blow out at top of well.\n Touch tip.\n \"\"\"\n def wrapper(*args, **kwargs):\n func(*args, **kwargs)\n func.__self__.blow_out([*args][1].labware.object.top())\n func.__self__.touch_tip()\n return wrapper\n\n washreservoir = ctx.load_labware(\n labware_reservoir_1well, '8', 'Wash Buffer')\n\n etohreservoir = ctx.load_labware(\n labware_reservoir_1well, '9', '80 Percent EtOH')\n\n twelvewellreservoir = ctx.load_labware(\n labware_reservoir_12well, '7', '12-Well Reservoir')\n\n source_dict = {\n 'Proteinase K Solution': twelvewellreservoir.wells_by_name()['A1'],\n 'Wash Buffer': washreservoir.wells()[0],\n '80 Percent EtOH': etohreservoir.wells()[0],\n 'Elution Solution': twelvewellreservoir.wells_by_name()['A12']}\n\n processingplates = [\n ctx.load_labware(\n labware_processing_plate, str(slot+1), name) for name, slot in zip(\n ['Sample Plate',\n 'Wash Plate 1',\n 'Wash Plate 2',\n 'Wash Plate 3',\n 'Elution Plate 4'],\n [*range(5)])]\n\n for source, lc, tfervol in zip(\n [value for value in source_dict.values()],\n ['aqueous', 'viscous', 'volatile', 'aqueous'],\n [10, 1000, 1500, 100]):\n\n source.liq_class = lc\n source.liq_vol = 1.1*(tfervol*8*num_cols)\n\n for source, transfervolume, plate in zip(\n [source_dict[reagent] for reagent in [\n 'Proteinase K Solution',\n 'Wash Buffer',\n '80 Percent EtOH',\n '80 Percent EtOH',\n 'Elution Solution']],\n [10, 1000, 1000, 500, 100],\n processingplates):\n\n pip = p20m if transfervolume <= 20 else p300m\n\n # python dict to store and dispatch extended aspirate\n pip_aspirate = {'viscous': extended1(pip.aspirate),\n 'volatile': extended2(pip.aspirate),\n 'aqueous': pip.aspirate}\n\n # python dict to store and dispatch extended dispense\n pip_dispense = {'viscous': extended3(pip.dispense),\n 'volatile': extended4(pip.dispense),\n 'aqueous': extended5(pip.dispense)}\n\n vol_airgap = 20 if source.liq_class == 'volatile' else 0\n\n reps = math.ceil(\n transfervolume / (\n pip.tip_racks[0].wells()[0].max_volume - vol_airgap))\n\n v = transfervolume / reps\n\n pip.pick_up_tip()\n\n for column in plate.columns()[:num_cols]:\n\n dest = column[0].top(\n ) if v > 50 else column[0].bottom(1)\n\n for rep in range(reps):\n\n source.liq_vol -= v*pip.channels\n\n tipheight = liq_height(\n source) - 3 if liq_height(source) - 3 > 1 else 1\n\n pip_aspirate[source.liq_class](v, source.bottom(tipheight))\n\n pip_dispense[source.liq_class](v+vol_airgap, dest)\n\n pip.drop_tip()\n\n ctx.comment(\"Finished set up of five processing plates\")\n",
"custom_labware_defs": [
{
"brand": {
Expand Down Expand Up @@ -1396,4 +1396,4 @@
"protocolName": "KingFisher Flex Plate Set Up"
},
"modules": []
}
}
Loading