From 1b6b1ff04be6dc7c76fd0beb23e5f58f5fb03642 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cramifarawi=E2=80=9D?= <“rami.farawi@opentrons.com”> Date: Fri, 8 Dec 2023 12:20:57 -0500 Subject: [PATCH] fix --- protoBuilds/normalization/normalization.ot2.apiv2.py.json | 4 ++-- protocols/normalization/normalization.ot2.apiv2.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/protoBuilds/normalization/normalization.ot2.apiv2.py.json b/protoBuilds/normalization/normalization.ot2.apiv2.py.json index 2fc04d85d5..fa8ea8a414 100644 --- a/protoBuilds/normalization/normalization.ot2.apiv2.py.json +++ b/protoBuilds/normalization/normalization.ot2.apiv2.py.json @@ -1,5 +1,5 @@ { - "content": "metadata = {\n 'protocolName': 'Normalization',\n 'author': 'Opentrons ',\n 'source': 'Protocol Library',\n 'apiLevel': '2.2'\n }\n\ntiprack_slots = ['1', '4', '7', '10']\n\n\ndef transpose_matrix(m):\n return [[r[i] for r in reversed(m)] for i in range(len(m[0]))]\n\n\ndef flatten_matrix(m):\n return [cell for row in m for cell in row]\n\n\ndef well_csv_to_list(csv_string):\n \"\"\"\n Takes a csv string and flattens it to a list, re-ordering to match\n Opentrons well order convention (A1, B1, C1, ..., A2, B2, B2, ...)\n \"\"\"\n data = [\n line.split(',')\n for line in reversed(csv_string.split('\\n')) if line.strip()\n if line\n ]\n if len(data[0]) > len(data):\n # row length > column length ==> \"landscape\", so transpose\n return flatten_matrix(transpose_matrix(data))\n # \"portrait\"\n return flatten_matrix(data)\n\n\ndef run(protocol):\n [volumes_csv, pip_model, pip_mount, plate_type,\n res_type, filter_tip, tip_reuse] = get_values( # noqa: F821\n 'volumes_csv', 'pip_model', 'pip_mount', 'plate_type',\n 'res_type', 'filter_tip', 'tip_reuse')\n\n # create labware\n plate = protocol.load_labware(plate_type, '3')\n\n reservoir = protocol.load_labware(res_type, '2')\n source = reservoir.wells()[0]\n\n pip_size = pip_model.split('_')[0][1:]\n\n pip_size = '300' if pip_size == '50' else pip_size\n tip_name = 'opentrons_96_tiprack_'+pip_size+'ul'\n if filter_tip == 'yes':\n pip_size = '200' if pip_size == '300' else pip_size\n tip_name = 'opentrons_96_filtertiprack_'+pip_size+'ul'\n\n tipracks = [protocol.load_labware(tip_name, slot)\n for slot in tiprack_slots]\n\n pipette = protocol.load_instrument(pip_model, pip_mount,\n tip_racks=tipracks)\n\n # create volumes list\n volumes = [float(cell) for cell in well_csv_to_list(volumes_csv)]\n\n for vol in volumes:\n if vol < pipette.min_volume:\n protocol.comment(\n 'WARNING: volume {} is below pipette\\'s minimum volume.'\n .format(vol))\n\n if tip_reuse == 'never':\n pipette.pick_up_tip()\n\n for vol, dest in zip(volumes, plate.wells()):\n if vol > 0:\n pipette.transfer(vol, source, dest, new_tip=tip_reuse)\n\n if pipette.has_tip:\n pipette.drop_tip()\n", + "content": "metadata = {\n 'protocolName': 'Normalization',\n 'author': 'Opentrons ',\n 'source': 'Protocol Library',\n 'apiLevel': '2.12'\n }\n\ntiprack_slots = ['1', '4', '7', '10']\n\n\ndef transpose_matrix(m):\n return [[r[i] for r in reversed(m)] for i in range(len(m[0]))]\n\n\ndef flatten_matrix(m):\n return [cell for row in m for cell in row]\n\n\ndef well_csv_to_list(csv_string):\n \"\"\"\n Takes a csv string and flattens it to a list, re-ordering to match\n Opentrons well order convention (A1, B1, C1, ..., A2, B2, B2, ...)\n \"\"\"\n data = [\n line.split(',')\n for line in reversed(csv_string.split('\\n')) if line.strip()\n if line\n ]\n if len(data[0]) > len(data):\n # row length > column length ==> \"landscape\", so transpose\n return flatten_matrix(transpose_matrix(data))\n # \"portrait\"\n return flatten_matrix(data)\n\n\ndef run(protocol):\n [volumes_csv, pip_model, pip_mount, plate_type,\n res_type, filter_tip, tip_reuse] = get_values( # noqa: F821\n 'volumes_csv', 'pip_model', 'pip_mount', 'plate_type',\n 'res_type', 'filter_tip', 'tip_reuse')\n\n # create labware\n plate = protocol.load_labware(plate_type, '3')\n\n reservoir = protocol.load_labware(res_type, '2')\n source = reservoir.wells()[0]\n\n pip_size = pip_model.split('_')[0][1:]\n\n pip_size = '300' if pip_size == '50' else pip_size\n tip_name = 'opentrons_96_tiprack_'+pip_size+'ul'\n if filter_tip == 'yes':\n pip_size = '200' if pip_size == '300' else pip_size\n tip_name = 'opentrons_96_filtertiprack_'+pip_size+'ul'\n\n tipracks = [protocol.load_labware(tip_name, slot)\n for slot in tiprack_slots]\n\n pipette = protocol.load_instrument(pip_model, pip_mount,\n tip_racks=tipracks)\n\n # create volumes list\n volumes = [float(cell) for cell in well_csv_to_list(volumes_csv)]\n\n for vol in volumes:\n if vol < pipette.min_volume:\n protocol.comment(\n 'WARNING: volume {} is below pipette\\'s minimum volume.'\n .format(vol))\n\n if tip_reuse == 'never':\n pipette.pick_up_tip()\n\n for vol, dest in zip(volumes, plate.wells()):\n if vol > 0:\n pipette.transfer(vol, source, dest, new_tip=tip_reuse)\n\n if pipette.has_tip:\n pipette.drop_tip()\n", "custom_labware_defs": [], "fields": [ { @@ -198,7 +198,7 @@ } ], "metadata": { - "apiLevel": "2.2", + "apiLevel": "2.12", "author": "Opentrons ", "protocolName": "Normalization", "source": "Protocol Library" diff --git a/protocols/normalization/normalization.ot2.apiv2.py b/protocols/normalization/normalization.ot2.apiv2.py index 30d692cf9c..6a4954bfb6 100644 --- a/protocols/normalization/normalization.ot2.apiv2.py +++ b/protocols/normalization/normalization.ot2.apiv2.py @@ -2,7 +2,7 @@ 'protocolName': 'Normalization', 'author': 'Opentrons ', 'source': 'Protocol Library', - 'apiLevel': '2.2' + 'apiLevel': '2.12' } tiprack_slots = ['1', '4', '7', '10']