diff --git a/protoBuilds/4a0be6/4a0be6.ot2.apiv2.py.json b/protoBuilds/4a0be6/4a0be6.ot2.apiv2.py.json index 75b029501..3406f035e 100644 --- a/protoBuilds/4a0be6/4a0be6.ot2.apiv2.py.json +++ b/protoBuilds/4a0be6/4a0be6.ot2.apiv2.py.json @@ -1,5 +1,5 @@ { - "content": "import math\nfrom opentrons.protocol_api.labware import Well\n\nmetadata = {\n 'protocolName': 'Tube Filling',\n 'author': 'Opentrons ',\n 'source': 'Custom Protocol Request',\n 'apiLevel': '2.11'\n}\n\n\ndef run(protocol):\n [transferVol, tubeRacks, tubeType, numRacks, srcType, srcVol,\n pipType, pipMnt, startTip, dispMode, touchTip] = get_values( # noqa: F821\n 'transferVol', 'tubeRacks', 'tubeType', 'numRacks', 'srcType', 'srcVol',\n 'pipType', 'pipMnt', 'startTip', 'dispMode', 'touchTip')\n\n # Load labware and pipettes\n\n tipNum = pipType.split('_')[0][1:]\n tipNum = '300' if tipNum == '50' else tipNum\n tipType = f'opentrons_96_tiprack_{tipNum}ul'\n tips = [protocol.load_labware(tipType, '11')]\n pip = protocol.load_instrument(pipType, pipMnt, tip_racks=tips)\n\n firstTip = startTip[0].upper()+str(int(startTip[1:]))\n pip.starting_tip = tips[0][firstTip]\n\n srcLabware = protocol.load_labware(srcType, '1')\n\n destRacks = [\n protocol.load_labware(tubeRacks+tubeType, slot) for slot in range(\n 2, 2+numRacks)]\n\n # Functions and Class creation\n if not protocol.is_simulating:\n class WellH(Well):\n def __init__(self, well, min_height=5, comp_coeff=1.15,\n current_volume=0):\n super().__init__(well._impl)\n self.well = well\n self.min_height = min_height\n self.comp_coeff = comp_coeff\n self.current_volume = current_volume\n if self.diameter is not None:\n self.radius = self.diameter/2\n cse = math.pi*(self.radius**2)\n elif self.length is not None:\n cse = self.length*self.width\n self.height = (\n current_volume/cse) - (0.2*pip._tip_racks[0].wells()[0].depth)\n if self.height < min_height:\n self.height = min_height\n elif self.height > well.parent.highest_z:\n raise Exception(\"\"\"Specified liquid volume\n can not exceed the height of the labware.\"\"\")\n\n def height_dec(self, vol):\n if self.diameter is not None:\n cse = math.pi*(self.radius**2)\n elif self.length is not None:\n cse = self.length*self.width\n dh = (vol/cse)*self.comp_coeff\n if self.height - dh > self.min_height:\n self.height = self.height - dh\n else:\n self.height = self.min_height\n if self.current_volume - vol > 0:\n self.current_volume = self.current_volume - vol\n else:\n self.current_volume = 0\n return(self.well.bottom(self.height))\n\n def height_inc(self, vol, top=False):\n if self.diameter is not None:\n cse = math.pi*(self.radius**2)\n elif self.length is not None:\n cse = self.length*self.width\n ih = (vol/cse)*self.comp_coeff\n if self.height < self.min_height:\n self.height = self.min_height\n if self.height + ih < self.depth:\n self.height = self.height + ih\n else:\n self.height = self.depth\n self.current_volume += vol\n if top is False:\n return(self.well.bottom(self.height))\n else:\n return(self.well.top())\n\n def yield_groups(list, num):\n \"\"\"\n yield lists based on number of items\n \"\"\"\n for i in range(0, len(list), num):\n yield list[i:i+num]\n\n # get number of distributes pipette can handle\n distribute_num = pip.max_volume // transferVol\n if distribute_num < 1:\n # if transfer volume is greater than pipette max volume,\n # use Transfer mode\n dispMode = 'Transfer'\n\n # create source location with WellH\n source = WellH(\n srcLabware.wells()[0], min_height=3, current_volume=srcVol*1000)\n\n # Protocol: Tube filling\n pip.pick_up_tip()\n all_wells = [well for tuberack in destRacks for well in tuberack.wells()]\n if dispMode == 'Transfer':\n for dest in all_wells:\n pip.transfer(\n transferVol, source.height_dec(transferVol), dest,\n touch_tip=touchTip, new_tip='never')\n else:\n well_groups = list(yield_groups(all_wells, int(distribute_num)))\n for wells in well_groups:\n pip.distribute(\n transferVol, source.height_dec(transferVol), wells,\n blow_out=source, touch_tip=touchTip, new_tip='never')\n pip.drop_tip()\n", + "content": "import math\nfrom opentrons.protocol_api.labware import Well\n\nmetadata = {\n 'protocolName': 'Tube Filling',\n 'author': 'Opentrons ',\n 'source': 'Custom Protocol Request',\n 'apiLevel': '2.11'\n}\n\n\ndef run(protocol):\n [transferVol, tubeRacks, tubeType, numRacks, srcType, srcVol,\n pipType, pipMnt, startTip, dispMode, touchTip] = get_values( # noqa: F821\n 'transferVol', 'tubeRacks', 'tubeType', 'numRacks', 'srcType', 'srcVol',\n 'pipType', 'pipMnt', 'startTip', 'dispMode', 'touchTip')\n\n # Load labware and pipettes\n\n tipNum = pipType.split('_')[0][1:]\n tipNum = '300' if tipNum == '50' else tipNum\n tipType = f'opentrons_96_tiprack_{tipNum}ul'\n tips = [protocol.load_labware(tipType, '11')]\n pip = protocol.load_instrument(pipType, pipMnt, tip_racks=tips)\n\n firstTip = startTip[0].upper()+str(int(startTip[1:]))\n pip.starting_tip = tips[0][firstTip]\n\n srcLabware = protocol.load_labware(srcType, '1')\n\n destRacks = [\n protocol.load_labware(tubeRacks+tubeType, slot) for slot in range(\n 2, 2+numRacks)]\n\n # Functions and Class creation\n if not protocol.is_simulating:\n class WellH(Well):\n def __init__(self, well, min_height=5, comp_coeff=1.15,\n current_volume=0):\n super().__init__(well._impl)\n self.well = well\n self.min_height = min_height\n self.comp_coeff = comp_coeff\n self.current_volume = current_volume\n if self.diameter is not None:\n self.radius = self.diameter/2\n cse = math.pi*(self.radius**2)\n elif self.length is not None:\n cse = self.length*self.width\n self.height = (\n current_volume/cse) - (0.2*pip._tip_racks[0].wells()[0].depth)\n if self.height < min_height:\n self.height = min_height\n elif self.height > well.parent.highest_z:\n raise Exception(\"\"\"Specified liquid volume\n can not exceed the height of the labware.\"\"\")\n\n def height_dec(self, vol):\n if self.diameter is not None:\n cse = math.pi*(self.radius**2)\n elif self.length is not None:\n cse = self.length*self.width\n dh = (vol/cse)*self.comp_coeff\n if self.height - dh > self.min_height:\n self.height = self.height - dh\n else:\n self.height = self.min_height\n if self.current_volume - vol > 0:\n self.current_volume = self.current_volume - vol\n else:\n self.current_volume = 0\n return(self.well.bottom(self.height))\n\n def height_inc(self, vol, top=False):\n if self.diameter is not None:\n cse = math.pi*(self.radius**2)\n elif self.length is not None:\n cse = self.length*self.width\n ih = (vol/cse)*self.comp_coeff\n if self.height < self.min_height:\n self.height = self.min_height\n if self.height + ih < self.depth:\n self.height = self.height + ih\n else:\n self.height = self.depth\n self.current_volume += vol\n if top is False:\n return(self.well.bottom(self.height))\n else:\n return(self.well.top())\n\n def yield_groups(list, num):\n \"\"\"\n yield lists based on number of items\n \"\"\"\n for i in range(0, len(list), num):\n yield list[i:i+num]\n\n # get number of distributes pipette can handle\n distribute_num = pip.max_volume // transferVol\n if distribute_num < 1:\n # if transfer volume is greater than pipette max volume,\n # use Transfer mode\n dispMode = 'Transfer'\n\n # create source location with WellH\n source = WellH(\n srcLabware.wells()[0], min_height=3, current_volume=srcVol*1000)\n\n # Protocol: Tube filling\n pip.pick_up_tip()\n all_wells = [well\n for tuberack in destRacks for well in tuberack.wells()]\n if dispMode == 'Transfer':\n for dest in all_wells:\n pip.transfer(\n transferVol, source.height_dec(transferVol), dest,\n touch_tip=touchTip, new_tip='never')\n else:\n well_groups = list(yield_groups(all_wells, int(distribute_num)))\n for wells in well_groups:\n pip.distribute(\n transferVol, source.height_dec(transferVol), wells,\n blow_out=source, touch_tip=touchTip, new_tip='never')\n pip.drop_tip()\n", "custom_labware_defs": [ { "brand": { diff --git a/protocols/4a0be6/4a0be6.ot2.apiv2.py b/protocols/4a0be6/4a0be6.ot2.apiv2.py index 2cf3d55d3..9a3fd9acd 100644 --- a/protocols/4a0be6/4a0be6.ot2.apiv2.py +++ b/protocols/4a0be6/4a0be6.ot2.apiv2.py @@ -109,7 +109,8 @@ def yield_groups(list, num): # Protocol: Tube filling pip.pick_up_tip() - all_wells = [well for tuberack in destRacks for well in tuberack.wells()] + all_wells = [well + for tuberack in destRacks for well in tuberack.wells()] if dispMode == 'Transfer': for dest in all_wells: pip.transfer(