From af1a747c8bbb18c8f6461b3333a9772cf4325725 Mon Sep 17 00:00:00 2001 From: m-kasprzyk Date: Tue, 13 Aug 2024 11:40:57 +0100 Subject: [PATCH] add agar jupyter notebook --- assets/check-agar-height.ipynb | 285 +++++++++++++++++++++++++++++++++ 1 file changed, 285 insertions(+) create mode 100644 assets/check-agar-height.ipynb diff --git a/assets/check-agar-height.ipynb b/assets/check-agar-height.ipynb new file mode 100644 index 0000000..a0b7dcd --- /dev/null +++ b/assets/check-agar-height.ipynb @@ -0,0 +1,285 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 1, + "metadata": {}, + "outputs": [], + "source": [ + "import opentrons.execute\n", + "import opentrons.simulate\n", + "from opentrons import types\n", + "import json\n", + "import math" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": {}, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "/data/robot_settings.json not found. Loading defaults\n", + "Failed to initialize character device, will not be able to control gpios (lights, button, smoothiekill, smoothie reset). Only one connection can be made to the gpios at a time. If you need to control gpios, first stop the robot server with systemctl stop opentrons-robot-server. Until you restart the server with systemctl start opentrons-robot-server, you will be unable to control the robot using the Opentrons app.\n", + "/data/deck_calibration.json not found. Loading defaults\n" + ] + } + ], + "source": [ + "protocol = opentrons.execute.get_protocol_api(\"2.15\")\n", + "protocol.home()" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": {}, + "outputs": [], + "source": [ + "pipette = \"p20_multi_gen2\"\n", + "pipette_mount = \"right\"\n", + "pipette_tiprack = \"opentrons_96_tiprack_20ul\"\n", + "pipette_tiprack_slot = 6\n", + "\n", + "pipette_tipracks = [protocol.load_labware(load_name=pipette_tiprack, location=pipette_tiprack_slot)]\n", + "pipette = protocol.load_instrument(instrument_name=pipette, mount=pipette_mount, tip_racks=pipette_tipracks)" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "" + ] + }, + "execution_count": 4, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "pipette.pick_up_tip()" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": {}, + "outputs": [], + "source": [ + "\"\"\"Omni Nunc Tray rectangular plate\"\"\"\n", + "LABWARE_DEF_JSON = \"\"\"{\"ordering\":[[\"A1\",\"B1\",\"C1\",\"D1\",\"E1\",\"F1\",\"G1\",\"H1\"],[\"A2\",\"B2\",\"C2\",\"D2\",\"E2\",\"F2\",\"G2\",\"H2\"],[\"A3\",\"B3\",\"C3\",\"D3\",\"E3\",\"F3\",\"G3\",\"H3\"],[\"A4\",\"B4\",\"C4\",\"D4\",\"E4\",\"F4\",\"G4\",\"H4\"],[\"A5\",\"B5\",\"C5\",\"D5\",\"E5\",\"F5\",\"G5\",\"H5\"],[\"A6\",\"B6\",\"C6\",\"D6\",\"E6\",\"F6\",\"G6\",\"H6\"],[\"A7\",\"B7\",\"C7\",\"D7\",\"E7\",\"F7\",\"G7\",\"H7\"],[\"A8\",\"B8\",\"C8\",\"D8\",\"E8\",\"F8\",\"G8\",\"H8\"],[\"A9\",\"B9\",\"C9\",\"D9\",\"E9\",\"F9\",\"G9\",\"H9\"],[\"A10\",\"B10\",\"C10\",\"D10\",\"E10\",\"F10\",\"G10\",\"H10\"],[\"A11\",\"B11\",\"C11\",\"D11\",\"E11\",\"F11\",\"G11\",\"H11\"],[\"A12\",\"B12\",\"C12\",\"D12\",\"E12\",\"F12\",\"G12\",\"H12\"]],\"brand\":{\"brand\":\"Nunc 96 grid\",\"brandId\":[]},\"metadata\":{\"displayName\":\"Nunc 96 Grid 96 Well Plate 10 µL\",\"displayCategory\":\"wellPlate\",\"displayVolumeUnits\":\"µL\",\"tags\":[]},\"dimensions\":{\"xDimension\":127.8,\"yDimension\":85.5,\"zDimension\":14.5},\"wells\":{\"A1\":{\"depth\":11.6,\"totalLiquidVolume\":10,\"shape\":\"rectangular\",\"xDimension\":9.25,\"yDimension\":9.25,\"x\":11,\"y\":74.5,\"z\":2.9},\"B1\":{\"depth\":11.6,\"totalLiquidVolume\":10,\"shape\":\"rectangular\",\"xDimension\":9.25,\"yDimension\":9.25,\"x\":11,\"y\":65.5,\"z\":2.9},\"C1\":{\"depth\":11.6,\"totalLiquidVolume\":10,\"shape\":\"rectangular\",\"xDimension\":9.25,\"yDimension\":9.25,\"x\":11,\"y\":56.5,\"z\":2.9},\"D1\":{\"depth\":11.6,\"totalLiquidVolume\":10,\"shape\":\"rectangular\",\"xDimension\":9.25,\"yDimension\":9.25,\"x\":11,\"y\":47.5,\"z\":2.9},\"E1\":{\"depth\":11.6,\"totalLiquidVolume\":10,\"shape\":\"rectangular\",\"xDimension\":9.25,\"yDimension\":9.25,\"x\":11,\"y\":38.5,\"z\":2.9},\"F1\":{\"depth\":11.6,\"totalLiquidVolume\":10,\"shape\":\"rectangular\",\"xDimension\":9.25,\"yDimension\":9.25,\"x\":11,\"y\":29.5,\"z\":2.9},\"G1\":{\"depth\":11.6,\"totalLiquidVolume\":10,\"shape\":\"rectangular\",\"xDimension\":9.25,\"yDimension\":9.25,\"x\":11,\"y\":20.5,\"z\":2.9},\"H1\":{\"depth\":11.6,\"totalLiquidVolume\":10,\"shape\":\"rectangular\",\"xDimension\":9.25,\"yDimension\":9.25,\"x\":11,\"y\":11.5,\"z\":2.9},\"A2\":{\"depth\":11.6,\"totalLiquidVolume\":10,\"shape\":\"rectangular\",\"xDimension\":9.25,\"yDimension\":9.25,\"x\":20.6,\"y\":74.5,\"z\":2.9},\"B2\":{\"depth\":11.6,\"totalLiquidVolume\":10,\"shape\":\"rectangular\",\"xDimension\":9.25,\"yDimension\":9.25,\"x\":20.6,\"y\":65.5,\"z\":2.9},\"C2\":{\"depth\":11.6,\"totalLiquidVolume\":10,\"shape\":\"rectangular\",\"xDimension\":9.25,\"yDimension\":9.25,\"x\":20.6,\"y\":56.5,\"z\":2.9},\"D2\":{\"depth\":11.6,\"totalLiquidVolume\":10,\"shape\":\"rectangular\",\"xDimension\":9.25,\"yDimension\":9.25,\"x\":20.6,\"y\":47.5,\"z\":2.9},\"E2\":{\"depth\":11.6,\"totalLiquidVolume\":10,\"shape\":\"rectangular\",\"xDimension\":9.25,\"yDimension\":9.25,\"x\":20.6,\"y\":38.5,\"z\":2.9},\"F2\":{\"depth\":11.6,\"totalLiquidVolume\":10,\"shape\":\"rectangular\",\"xDimension\":9.25,\"yDimension\":9.25,\"x\":20.6,\"y\":29.5,\"z\":2.9},\"G2\":{\"depth\":11.6,\"totalLiquidVolume\":10,\"shape\":\"rectangular\",\"xDimension\":9.25,\"yDimension\":9.25,\"x\":20.6,\"y\":20.5,\"z\":2.9},\"H2\":{\"depth\":11.6,\"totalLiquidVolume\":10,\"shape\":\"rectangular\",\"xDimension\":9.25,\"yDimension\":9.25,\"x\":20.6,\"y\":11.5,\"z\":2.9},\"A3\":{\"depth\":11.6,\"totalLiquidVolume\":10,\"shape\":\"rectangular\",\"xDimension\":9.25,\"yDimension\":9.25,\"x\":30.2,\"y\":74.5,\"z\":2.9},\"B3\":{\"depth\":11.6,\"totalLiquidVolume\":10,\"shape\":\"rectangular\",\"xDimension\":9.25,\"yDimension\":9.25,\"x\":30.2,\"y\":65.5,\"z\":2.9},\"C3\":{\"depth\":11.6,\"totalLiquidVolume\":10,\"shape\":\"rectangular\",\"xDimension\":9.25,\"yDimension\":9.25,\"x\":30.2,\"y\":56.5,\"z\":2.9},\"D3\":{\"depth\":11.6,\"totalLiquidVolume\":10,\"shape\":\"rectangular\",\"xDimension\":9.25,\"yDimension\":9.25,\"x\":30.2,\"y\":47.5,\"z\":2.9},\"E3\":{\"depth\":11.6,\"totalLiquidVolume\":10,\"shape\":\"rectangular\",\"xDimension\":9.25,\"yDimension\":9.25,\"x\":30.2,\"y\":38.5,\"z\":2.9},\"F3\":{\"depth\":11.6,\"totalLiquidVolume\":10,\"shape\":\"rectangular\",\"xDimension\":9.25,\"yDimension\":9.25,\"x\":30.2,\"y\":29.5,\"z\":2.9},\"G3\":{\"depth\":11.6,\"totalLiquidVolume\":10,\"shape\":\"rectangular\",\"xDimension\":9.25,\"yDimension\":9.25,\"x\":30.2,\"y\":20.5,\"z\":2.9},\"H3\":{\"depth\":11.6,\"totalLiquidVolume\":10,\"shape\":\"rectangular\",\"xDimension\":9.25,\"yDimension\":9.25,\"x\":30.2,\"y\":11.5,\"z\":2.9},\"A4\":{\"depth\":11.6,\"totalLiquidVolume\":10,\"shape\":\"rectangular\",\"xDimension\":9.25,\"yDimension\":9.25,\"x\":39.8,\"y\":74.5,\"z\":2.9},\"B4\":{\"depth\":11.6,\"totalLiquidVolume\":10,\"shape\":\"rectangular\",\"xDimension\":9.25,\"yDimension\":9.25,\"x\":39.8,\"y\":65.5,\"z\":2.9},\"C4\":{\"depth\":11.6,\"totalLiquidVolume\":10,\"shape\":\"rectangular\",\"xDimension\":9.25,\"yDimension\":9.25,\"x\":39.8,\"y\":56.5,\"z\":2.9},\"D4\":{\"depth\":11.6,\"totalLiquidVolume\":10,\"shape\":\"rectangular\",\"xDimension\":9.25,\"yDimension\":9.25,\"x\":39.8,\"y\":47.5,\"z\":2.9},\"E4\":{\"depth\":11.6,\"totalLiquidVolume\":10,\"shape\":\"rectangular\",\"xDimension\":9.25,\"yDimension\":9.25,\"x\":39.8,\"y\":38.5,\"z\":2.9},\"F4\":{\"depth\":11.6,\"totalLiquidVolume\":10,\"shape\":\"rectangular\",\"xDimension\":9.25,\"yDimension\":9.25,\"x\":39.8,\"y\":29.5,\"z\":2.9},\"G4\":{\"depth\":11.6,\"totalLiquidVolume\":10,\"shape\":\"rectangular\",\"xDimension\":9.25,\"yDimension\":9.25,\"x\":39.8,\"y\":20.5,\"z\":2.9},\"H4\":{\"depth\":11.6,\"totalLiquidVolume\":10,\"shape\":\"rectangular\",\"xDimension\":9.25,\"yDimension\":9.25,\"x\":39.8,\"y\":11.5,\"z\":2.9},\"A5\":{\"depth\":11.6,\"totalLiquidVolume\":10,\"shape\":\"rectangular\",\"xDimension\":9.25,\"yDimension\":9.25,\"x\":49.4,\"y\":74.5,\"z\":2.9},\"B5\":{\"depth\":11.6,\"totalLiquidVolume\":10,\"shape\":\"rectangular\",\"xDimension\":9.25,\"yDimension\":9.25,\"x\":49.4,\"y\":65.5,\"z\":2.9},\"C5\":{\"depth\":11.6,\"totalLiquidVolume\":10,\"shape\":\"rectangular\",\"xDimension\":9.25,\"yDimension\":9.25,\"x\":49.4,\"y\":56.5,\"z\":2.9},\"D5\":{\"depth\":11.6,\"totalLiquidVolume\":10,\"shape\":\"rectangular\",\"xDimension\":9.25,\"yDimension\":9.25,\"x\":49.4,\"y\":47.5,\"z\":2.9},\"E5\":{\"depth\":11.6,\"totalLiquidVolume\":10,\"shape\":\"rectangular\",\"xDimension\":9.25,\"yDimension\":9.25,\"x\":49.4,\"y\":38.5,\"z\":2.9},\"F5\":{\"depth\":11.6,\"totalLiquidVolume\":10,\"shape\":\"rectangular\",\"xDimension\":9.25,\"yDimension\":9.25,\"x\":49.4,\"y\":29.5,\"z\":2.9},\"G5\":{\"depth\":11.6,\"totalLiquidVolume\":10,\"shape\":\"rectangular\",\"xDimension\":9.25,\"yDimension\":9.25,\"x\":49.4,\"y\":20.5,\"z\":2.9},\"H5\":{\"depth\":11.6,\"totalLiquidVolume\":10,\"shape\":\"rectangular\",\"xDimension\":9.25,\"yDimension\":9.25,\"x\":49.4,\"y\":11.5,\"z\":2.9},\"A6\":{\"depth\":11.6,\"totalLiquidVolume\":10,\"shape\":\"rectangular\",\"xDimension\":9.25,\"yDimension\":9.25,\"x\":59,\"y\":74.5,\"z\":2.9},\"B6\":{\"depth\":11.6,\"totalLiquidVolume\":10,\"shape\":\"rectangular\",\"xDimension\":9.25,\"yDimension\":9.25,\"x\":59,\"y\":65.5,\"z\":2.9},\"C6\":{\"depth\":11.6,\"totalLiquidVolume\":10,\"shape\":\"rectangular\",\"xDimension\":9.25,\"yDimension\":9.25,\"x\":59,\"y\":56.5,\"z\":2.9},\"D6\":{\"depth\":11.6,\"totalLiquidVolume\":10,\"shape\":\"rectangular\",\"xDimension\":9.25,\"yDimension\":9.25,\"x\":59,\"y\":47.5,\"z\":2.9},\"E6\":{\"depth\":11.6,\"totalLiquidVolume\":10,\"shape\":\"rectangular\",\"xDimension\":9.25,\"yDimension\":9.25,\"x\":59,\"y\":38.5,\"z\":2.9},\"F6\":{\"depth\":11.6,\"totalLiquidVolume\":10,\"shape\":\"rectangular\",\"xDimension\":9.25,\"yDimension\":9.25,\"x\":59,\"y\":29.5,\"z\":2.9},\"G6\":{\"depth\":11.6,\"totalLiquidVolume\":10,\"shape\":\"rectangular\",\"xDimension\":9.25,\"yDimension\":9.25,\"x\":59,\"y\":20.5,\"z\":2.9},\"H6\":{\"depth\":11.6,\"totalLiquidVolume\":10,\"shape\":\"rectangular\",\"xDimension\":9.25,\"yDimension\":9.25,\"x\":59,\"y\":11.5,\"z\":2.9},\"A7\":{\"depth\":11.6,\"totalLiquidVolume\":10,\"shape\":\"rectangular\",\"xDimension\":9.25,\"yDimension\":9.25,\"x\":68.6,\"y\":74.5,\"z\":2.9},\"B7\":{\"depth\":11.6,\"totalLiquidVolume\":10,\"shape\":\"rectangular\",\"xDimension\":9.25,\"yDimension\":9.25,\"x\":68.6,\"y\":65.5,\"z\":2.9},\"C7\":{\"depth\":11.6,\"totalLiquidVolume\":10,\"shape\":\"rectangular\",\"xDimension\":9.25,\"yDimension\":9.25,\"x\":68.6,\"y\":56.5,\"z\":2.9},\"D7\":{\"depth\":11.6,\"totalLiquidVolume\":10,\"shape\":\"rectangular\",\"xDimension\":9.25,\"yDimension\":9.25,\"x\":68.6,\"y\":47.5,\"z\":2.9},\"E7\":{\"depth\":11.6,\"totalLiquidVolume\":10,\"shape\":\"rectangular\",\"xDimension\":9.25,\"yDimension\":9.25,\"x\":68.6,\"y\":38.5,\"z\":2.9},\"F7\":{\"depth\":11.6,\"totalLiquidVolume\":10,\"shape\":\"rectangular\",\"xDimension\":9.25,\"yDimension\":9.25,\"x\":68.6,\"y\":29.5,\"z\":2.9},\"G7\":{\"depth\":11.6,\"totalLiquidVolume\":10,\"shape\":\"rectangular\",\"xDimension\":9.25,\"yDimension\":9.25,\"x\":68.6,\"y\":20.5,\"z\":2.9},\"H7\":{\"depth\":11.6,\"totalLiquidVolume\":10,\"shape\":\"rectangular\",\"xDimension\":9.25,\"yDimension\":9.25,\"x\":68.6,\"y\":11.5,\"z\":2.9},\"A8\":{\"depth\":11.6,\"totalLiquidVolume\":10,\"shape\":\"rectangular\",\"xDimension\":9.25,\"yDimension\":9.25,\"x\":78.2,\"y\":74.5,\"z\":2.9},\"B8\":{\"depth\":11.6,\"totalLiquidVolume\":10,\"shape\":\"rectangular\",\"xDimension\":9.25,\"yDimension\":9.25,\"x\":78.2,\"y\":65.5,\"z\":2.9},\"C8\":{\"depth\":11.6,\"totalLiquidVolume\":10,\"shape\":\"rectangular\",\"xDimension\":9.25,\"yDimension\":9.25,\"x\":78.2,\"y\":56.5,\"z\":2.9},\"D8\":{\"depth\":11.6,\"totalLiquidVolume\":10,\"shape\":\"rectangular\",\"xDimension\":9.25,\"yDimension\":9.25,\"x\":78.2,\"y\":47.5,\"z\":2.9},\"E8\":{\"depth\":11.6,\"totalLiquidVolume\":10,\"shape\":\"rectangular\",\"xDimension\":9.25,\"yDimension\":9.25,\"x\":78.2,\"y\":38.5,\"z\":2.9},\"F8\":{\"depth\":11.6,\"totalLiquidVolume\":10,\"shape\":\"rectangular\",\"xDimension\":9.25,\"yDimension\":9.25,\"x\":78.2,\"y\":29.5,\"z\":2.9},\"G8\":{\"depth\":11.6,\"totalLiquidVolume\":10,\"shape\":\"rectangular\",\"xDimension\":9.25,\"yDimension\":9.25,\"x\":78.2,\"y\":20.5,\"z\":2.9},\"H8\":{\"depth\":11.6,\"totalLiquidVolume\":10,\"shape\":\"rectangular\",\"xDimension\":9.25,\"yDimension\":9.25,\"x\":78.2,\"y\":11.5,\"z\":2.9},\"A9\":{\"depth\":11.6,\"totalLiquidVolume\":10,\"shape\":\"rectangular\",\"xDimension\":9.25,\"yDimension\":9.25,\"x\":87.8,\"y\":74.5,\"z\":2.9},\"B9\":{\"depth\":11.6,\"totalLiquidVolume\":10,\"shape\":\"rectangular\",\"xDimension\":9.25,\"yDimension\":9.25,\"x\":87.8,\"y\":65.5,\"z\":2.9},\"C9\":{\"depth\":11.6,\"totalLiquidVolume\":10,\"shape\":\"rectangular\",\"xDimension\":9.25,\"yDimension\":9.25,\"x\":87.8,\"y\":56.5,\"z\":2.9},\"D9\":{\"depth\":11.6,\"totalLiquidVolume\":10,\"shape\":\"rectangular\",\"xDimension\":9.25,\"yDimension\":9.25,\"x\":87.8,\"y\":47.5,\"z\":2.9},\"E9\":{\"depth\":11.6,\"totalLiquidVolume\":10,\"shape\":\"rectangular\",\"xDimension\":9.25,\"yDimension\":9.25,\"x\":87.8,\"y\":38.5,\"z\":2.9},\"F9\":{\"depth\":11.6,\"totalLiquidVolume\":10,\"shape\":\"rectangular\",\"xDimension\":9.25,\"yDimension\":9.25,\"x\":87.8,\"y\":29.5,\"z\":2.9},\"G9\":{\"depth\":11.6,\"totalLiquidVolume\":10,\"shape\":\"rectangular\",\"xDimension\":9.25,\"yDimension\":9.25,\"x\":87.8,\"y\":20.5,\"z\":2.9},\"H9\":{\"depth\":11.6,\"totalLiquidVolume\":10,\"shape\":\"rectangular\",\"xDimension\":9.25,\"yDimension\":9.25,\"x\":87.8,\"y\":11.5,\"z\":2.9},\"A10\":{\"depth\":11.6,\"totalLiquidVolume\":10,\"shape\":\"rectangular\",\"xDimension\":9.25,\"yDimension\":9.25,\"x\":97.4,\"y\":74.5,\"z\":2.9},\"B10\":{\"depth\":11.6,\"totalLiquidVolume\":10,\"shape\":\"rectangular\",\"xDimension\":9.25,\"yDimension\":9.25,\"x\":97.4,\"y\":65.5,\"z\":2.9},\"C10\":{\"depth\":11.6,\"totalLiquidVolume\":10,\"shape\":\"rectangular\",\"xDimension\":9.25,\"yDimension\":9.25,\"x\":97.4,\"y\":56.5,\"z\":2.9},\"D10\":{\"depth\":11.6,\"totalLiquidVolume\":10,\"shape\":\"rectangular\",\"xDimension\":9.25,\"yDimension\":9.25,\"x\":97.4,\"y\":47.5,\"z\":2.9},\"E10\":{\"depth\":11.6,\"totalLiquidVolume\":10,\"shape\":\"rectangular\",\"xDimension\":9.25,\"yDimension\":9.25,\"x\":97.4,\"y\":38.5,\"z\":2.9},\"F10\":{\"depth\":11.6,\"totalLiquidVolume\":10,\"shape\":\"rectangular\",\"xDimension\":9.25,\"yDimension\":9.25,\"x\":97.4,\"y\":29.5,\"z\":2.9},\"G10\":{\"depth\":11.6,\"totalLiquidVolume\":10,\"shape\":\"rectangular\",\"xDimension\":9.25,\"yDimension\":9.25,\"x\":97.4,\"y\":20.5,\"z\":2.9},\"H10\":{\"depth\":11.6,\"totalLiquidVolume\":10,\"shape\":\"rectangular\",\"xDimension\":9.25,\"yDimension\":9.25,\"x\":97.4,\"y\":11.5,\"z\":2.9},\"A11\":{\"depth\":11.6,\"totalLiquidVolume\":10,\"shape\":\"rectangular\",\"xDimension\":9.25,\"yDimension\":9.25,\"x\":107,\"y\":74.5,\"z\":2.9},\"B11\":{\"depth\":11.6,\"totalLiquidVolume\":10,\"shape\":\"rectangular\",\"xDimension\":9.25,\"yDimension\":9.25,\"x\":107,\"y\":65.5,\"z\":2.9},\"C11\":{\"depth\":11.6,\"totalLiquidVolume\":10,\"shape\":\"rectangular\",\"xDimension\":9.25,\"yDimension\":9.25,\"x\":107,\"y\":56.5,\"z\":2.9},\"D11\":{\"depth\":11.6,\"totalLiquidVolume\":10,\"shape\":\"rectangular\",\"xDimension\":9.25,\"yDimension\":9.25,\"x\":107,\"y\":47.5,\"z\":2.9},\"E11\":{\"depth\":11.6,\"totalLiquidVolume\":10,\"shape\":\"rectangular\",\"xDimension\":9.25,\"yDimension\":9.25,\"x\":107,\"y\":38.5,\"z\":2.9},\"F11\":{\"depth\":11.6,\"totalLiquidVolume\":10,\"shape\":\"rectangular\",\"xDimension\":9.25,\"yDimension\":9.25,\"x\":107,\"y\":29.5,\"z\":2.9},\"G11\":{\"depth\":11.6,\"totalLiquidVolume\":10,\"shape\":\"rectangular\",\"xDimension\":9.25,\"yDimension\":9.25,\"x\":107,\"y\":20.5,\"z\":2.9},\"H11\":{\"depth\":11.6,\"totalLiquidVolume\":10,\"shape\":\"rectangular\",\"xDimension\":9.25,\"yDimension\":9.25,\"x\":107,\"y\":11.5,\"z\":2.9},\"A12\":{\"depth\":11.6,\"totalLiquidVolume\":10,\"shape\":\"rectangular\",\"xDimension\":9.25,\"yDimension\":9.25,\"x\":116.6,\"y\":74.5,\"z\":2.9},\"B12\":{\"depth\":11.6,\"totalLiquidVolume\":10,\"shape\":\"rectangular\",\"xDimension\":9.25,\"yDimension\":9.25,\"x\":116.6,\"y\":65.5,\"z\":2.9},\"C12\":{\"depth\":11.6,\"totalLiquidVolume\":10,\"shape\":\"rectangular\",\"xDimension\":9.25,\"yDimension\":9.25,\"x\":116.6,\"y\":56.5,\"z\":2.9},\"D12\":{\"depth\":11.6,\"totalLiquidVolume\":10,\"shape\":\"rectangular\",\"xDimension\":9.25,\"yDimension\":9.25,\"x\":116.6,\"y\":47.5,\"z\":2.9},\"E12\":{\"depth\":11.6,\"totalLiquidVolume\":10,\"shape\":\"rectangular\",\"xDimension\":9.25,\"yDimension\":9.25,\"x\":116.6,\"y\":38.5,\"z\":2.9},\"F12\":{\"depth\":11.6,\"totalLiquidVolume\":10,\"shape\":\"rectangular\",\"xDimension\":9.25,\"yDimension\":9.25,\"x\":116.6,\"y\":29.5,\"z\":2.9},\"G12\":{\"depth\":11.6,\"totalLiquidVolume\":10,\"shape\":\"rectangular\",\"xDimension\":9.25,\"yDimension\":9.25,\"x\":116.6,\"y\":20.5,\"z\":2.9},\"H12\":{\"depth\":11.6,\"totalLiquidVolume\":10,\"shape\":\"rectangular\",\"xDimension\":9.25,\"yDimension\":9.25,\"x\":116.6,\"y\":11.5,\"z\":2.9}},\"groups\":[{\"metadata\":{\"wellBottomShape\":\"flat\"},\"wells\":[\"A1\",\"B1\",\"C1\",\"D1\",\"E1\",\"F1\",\"G1\",\"H1\",\"A2\",\"B2\",\"C2\",\"D2\",\"E2\",\"F2\",\"G2\",\"H2\",\"A3\",\"B3\",\"C3\",\"D3\",\"E3\",\"F3\",\"G3\",\"H3\",\"A4\",\"B4\",\"C4\",\"D4\",\"E4\",\"F4\",\"G4\",\"H4\",\"A5\",\"B5\",\"C5\",\"D5\",\"E5\",\"F5\",\"G5\",\"H5\",\"A6\",\"B6\",\"C6\",\"D6\",\"E6\",\"F6\",\"G6\",\"H6\",\"A7\",\"B7\",\"C7\",\"D7\",\"E7\",\"F7\",\"G7\",\"H7\",\"A8\",\"B8\",\"C8\",\"D8\",\"E8\",\"F8\",\"G8\",\"H8\",\"A9\",\"B9\",\"C9\",\"D9\",\"E9\",\"F9\",\"G9\",\"H9\",\"A10\",\"B10\",\"C10\",\"D10\",\"E10\",\"F10\",\"G10\",\"H10\",\"A11\",\"B11\",\"C11\",\"D11\",\"E11\",\"F11\",\"G11\",\"H11\",\"A12\",\"B12\",\"C12\",\"D12\",\"E12\",\"F12\",\"G12\",\"H12\"]}],\"parameters\":{\"format\":\"irregular\",\"quirks\":[],\"isTiprack\":false,\"isMagneticModuleCompatible\":false,\"loadName\":\"nunc96grid_96_wellplate_10ul\"},\"namespace\":\"custom_beta\",\"version\":1,\"schemaVersion\":2,\"cornerOffsetFromSlot\":{\"x\":0,\"y\":0,\"z\":0}}\"\"\"" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": {}, + "outputs": [], + "source": [ + "\"\"\"90 mm round petri dish\"\"\"\n", + "\n", + "LABWARE_DEF_JSON = \"\"\"{\"ordering\":[[\"A1\",\"B1\",\"C1\",\"D1\",\"E1\",\"F1\",\"G1\",\"H1\"],[\"A2\",\"B2\",\"C2\",\"D2\",\"E2\",\"F2\",\"G2\",\"H2\"],[\"A3\",\"B3\",\"C3\",\"D3\",\"E3\",\"F3\",\"G3\",\"H3\"],[\"A4\",\"B4\",\"C4\",\"D4\",\"E4\",\"F4\",\"G4\",\"H4\"]],\"brand\":{\"brand\":\"Fisherbrand™\",\"brandId\":[\"12654785\"]},\"metadata\":{\"displayName\":\"Fisherbrand™ Petri Dish 90x16.2 8x4\",\"displayCategory\":\"wellPlate\",\"displayVolumeUnits\":\"µL\",\"tags\":[]},\"dimensions\":{\"xDimension\":128,\"yDimension\":86,\"zDimension\":17.5},\"wells\":{\"A1\":{\"depth\":11,\"totalLiquidVolume\":100,\"shape\":\"rectangular\",\"xDimension\":10.11,\"yDimension\":9.75,\"x\":49.33,\"y\":77.19,\"z\":6.5},\"B1\":{\"depth\":11,\"totalLiquidVolume\":100,\"shape\":\"rectangular\",\"xDimension\":10.11,\"yDimension\":9.75,\"x\":49.33,\"y\":67.44,\"z\":6.5},\"C1\":{\"depth\":11,\"totalLiquidVolume\":100,\"shape\":\"rectangular\",\"xDimension\":10.11,\"yDimension\":9.75,\"x\":49.33,\"y\":57.69,\"z\":6.5},\"D1\":{\"depth\":11,\"totalLiquidVolume\":100,\"shape\":\"rectangular\",\"xDimension\":10.11,\"yDimension\":9.75,\"x\":49.33,\"y\":47.94,\"z\":6.5},\"E1\":{\"depth\":11,\"totalLiquidVolume\":100,\"shape\":\"rectangular\",\"xDimension\":10.11,\"yDimension\":9.75,\"x\":49.33,\"y\":38.19,\"z\":6.5},\"F1\":{\"depth\":11,\"totalLiquidVolume\":100,\"shape\":\"rectangular\",\"xDimension\":10.11,\"yDimension\":9.75,\"x\":49.33,\"y\":28.44,\"z\":6.5},\"G1\":{\"depth\":11,\"totalLiquidVolume\":100,\"shape\":\"rectangular\",\"xDimension\":10.11,\"yDimension\":9.75,\"x\":49.33,\"y\":18.69,\"z\":6.5},\"H1\":{\"depth\":11,\"totalLiquidVolume\":100,\"shape\":\"rectangular\",\"xDimension\":10.11,\"yDimension\":9.75,\"x\":49.33,\"y\":8.94,\"z\":6.5},\"A2\":{\"depth\":11,\"totalLiquidVolume\":100,\"shape\":\"rectangular\",\"xDimension\":10.11,\"yDimension\":9.75,\"x\":59.44,\"y\":77.19,\"z\":6.5},\"B2\":{\"depth\":11,\"totalLiquidVolume\":100,\"shape\":\"rectangular\",\"xDimension\":10.11,\"yDimension\":9.75,\"x\":59.44,\"y\":67.44,\"z\":6.5},\"C2\":{\"depth\":11,\"totalLiquidVolume\":100,\"shape\":\"rectangular\",\"xDimension\":10.11,\"yDimension\":9.75,\"x\":59.44,\"y\":57.69,\"z\":6.5},\"D2\":{\"depth\":11,\"totalLiquidVolume\":100,\"shape\":\"rectangular\",\"xDimension\":10.11,\"yDimension\":9.75,\"x\":59.44,\"y\":47.94,\"z\":6.5},\"E2\":{\"depth\":11,\"totalLiquidVolume\":100,\"shape\":\"rectangular\",\"xDimension\":10.11,\"yDimension\":9.75,\"x\":59.44,\"y\":38.19,\"z\":6.5},\"F2\":{\"depth\":11,\"totalLiquidVolume\":100,\"shape\":\"rectangular\",\"xDimension\":10.11,\"yDimension\":9.75,\"x\":59.44,\"y\":28.44,\"z\":6.5},\"G2\":{\"depth\":11,\"totalLiquidVolume\":100,\"shape\":\"rectangular\",\"xDimension\":10.11,\"yDimension\":9.75,\"x\":59.44,\"y\":18.69,\"z\":6.5},\"H2\":{\"depth\":11,\"totalLiquidVolume\":100,\"shape\":\"rectangular\",\"xDimension\":10.11,\"yDimension\":9.75,\"x\":59.44,\"y\":8.94,\"z\":6.5},\"A3\":{\"depth\":11,\"totalLiquidVolume\":100,\"shape\":\"rectangular\",\"xDimension\":10.11,\"yDimension\":9.75,\"x\":69.55,\"y\":77.19,\"z\":6.5},\"B3\":{\"depth\":11,\"totalLiquidVolume\":100,\"shape\":\"rectangular\",\"xDimension\":10.11,\"yDimension\":9.75,\"x\":69.55,\"y\":67.44,\"z\":6.5},\"C3\":{\"depth\":11,\"totalLiquidVolume\":100,\"shape\":\"rectangular\",\"xDimension\":10.11,\"yDimension\":9.75,\"x\":69.55,\"y\":57.69,\"z\":6.5},\"D3\":{\"depth\":11,\"totalLiquidVolume\":100,\"shape\":\"rectangular\",\"xDimension\":10.11,\"yDimension\":9.75,\"x\":69.55,\"y\":47.94,\"z\":6.5},\"E3\":{\"depth\":11,\"totalLiquidVolume\":100,\"shape\":\"rectangular\",\"xDimension\":10.11,\"yDimension\":9.75,\"x\":69.55,\"y\":38.19,\"z\":6.5},\"F3\":{\"depth\":11,\"totalLiquidVolume\":100,\"shape\":\"rectangular\",\"xDimension\":10.11,\"yDimension\":9.75,\"x\":69.55,\"y\":28.44,\"z\":6.5},\"G3\":{\"depth\":11,\"totalLiquidVolume\":100,\"shape\":\"rectangular\",\"xDimension\":10.11,\"yDimension\":9.75,\"x\":69.55,\"y\":18.69,\"z\":6.5},\"H3\":{\"depth\":11,\"totalLiquidVolume\":100,\"shape\":\"rectangular\",\"xDimension\":10.11,\"yDimension\":9.75,\"x\":69.55,\"y\":8.94,\"z\":6.5},\"A4\":{\"depth\":11,\"totalLiquidVolume\":100,\"shape\":\"rectangular\",\"xDimension\":10.11,\"yDimension\":9.75,\"x\":79.66,\"y\":77.19,\"z\":6.5},\"B4\":{\"depth\":11,\"totalLiquidVolume\":100,\"shape\":\"rectangular\",\"xDimension\":10.11,\"yDimension\":9.75,\"x\":79.66,\"y\":67.44,\"z\":6.5},\"C4\":{\"depth\":11,\"totalLiquidVolume\":100,\"shape\":\"rectangular\",\"xDimension\":10.11,\"yDimension\":9.75,\"x\":79.66,\"y\":57.69,\"z\":6.5},\"D4\":{\"depth\":11,\"totalLiquidVolume\":100,\"shape\":\"rectangular\",\"xDimension\":10.11,\"yDimension\":9.75,\"x\":79.66,\"y\":47.94,\"z\":6.5},\"E4\":{\"depth\":11,\"totalLiquidVolume\":100,\"shape\":\"rectangular\",\"xDimension\":10.11,\"yDimension\":9.75,\"x\":79.66,\"y\":38.19,\"z\":6.5},\"F4\":{\"depth\":11,\"totalLiquidVolume\":100,\"shape\":\"rectangular\",\"xDimension\":10.11,\"yDimension\":9.75,\"x\":79.66,\"y\":28.44,\"z\":6.5},\"G4\":{\"depth\":11,\"totalLiquidVolume\":100,\"shape\":\"rectangular\",\"xDimension\":10.11,\"yDimension\":9.75,\"x\":79.66,\"y\":18.69,\"z\":6.5},\"H4\":{\"depth\":11,\"totalLiquidVolume\":100,\"shape\":\"rectangular\",\"xDimension\":10.11,\"yDimension\":9.75,\"x\":79.66,\"y\":8.94,\"z\":6.5}},\"groups\":[{\"metadata\":{\"wellBottomShape\":\"flat\"},\"wells\":[\"A1\",\"B1\",\"C1\",\"D1\",\"E1\",\"F1\",\"G1\",\"H1\",\"A2\",\"B2\",\"C2\",\"D2\",\"E2\",\"F2\",\"G2\",\"H2\",\"A3\",\"B3\",\"C3\",\"D3\",\"E3\",\"F3\",\"G3\",\"H3\",\"A4\",\"B4\",\"C4\",\"D4\",\"E4\",\"F4\",\"G4\",\"H4\"]}],\"parameters\":{\"format\":\"irregular\",\"quirks\":[],\"isTiprack\":false,\"isMagneticModuleCompatible\":false,\"loadName\":\"fisherbrand_petridish_8x4\"},\"namespace\":\"custom_beta\",\"version\":1,\"schemaVersion\":2,\"cornerOffsetFromSlot\":{\"x\":0,\"y\":0,\"z\":0}}\"\"\"" + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "metadata": {}, + "outputs": [], + "source": [ + "LABWARE_DEF = json.loads(LABWARE_DEF_JSON)\n", + "plate_slot = 1\n", + "plate = protocol.load_labware_from_definition(LABWARE_DEF,location=plate_slot)" + ] + }, + { + "cell_type": "code", + "execution_count": 16, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "" + ] + }, + "execution_count": 16, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Select the well and set the testing height\n", + "well = \"A1\"\n", + "z_bottom_height = -0.5 # Set height for well bottom (in mm) to check contact\n", + "\n", + "# Move the pipette to the position below the well's bottom to verify contact\n", + "pipette.move_to(plate[well].bottom(z=z_bottom_height))\n", + "\n", + "# Note: The pipette checks for contact with the bottom of the plates well at z=0.\n", + "# Adjustments:\n", + "# - If contact occurs at z < 0 (e.g., -1 mm), add the absolute value to correct the agar height.\n", + "# - If contact occurs at z > 0 (e.g., +1 mm), subtract the absolute value for accurate height adjustment.\n", + "# Correct height adjustment is crucial for precise sample handling." + ] + }, + { + "cell_type": "code", + "execution_count": 19, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Agar Density: 0.09236864179203552 g/cm^3\n" + ] + } + ], + "source": [ + "# Measure agar density using pipette positioning and mass calculations\n", + "\n", + "# Define the well and set agar height for measurement\n", + "well_density_check = \"A1\"\n", + "z_agar_height = 2.6 # height of the agar surface from the bottom of the well in mm\n", + "pipette.move_to(plate[well_density_check].bottom(z=z_agar_height))\n", + "\n", + "# Combine base height adjustment with measured agar height\n", + "adjusted_agar_height = z_agar_height + z_bottom_height # Adjusted for any offset from the true bottom\n", + "\n", + "# Record the mass data\n", + "mass_plate = 38.9518 # Mass of the empty plate in grams\n", + "mass_plate_agar = 57.3196 # Mass of the plate with agar in grams\n", + "\n", + "# Calculate the mass of the agar by subtracting the empty plate mass from the filled plate mass\n", + "mass_agar = mass_plate_agar - mass_plate\n", + "\n", + "# Define the base area of the well\n", + "area_base = 9469.2 # in square millimeters (mm^2)\n", + "\n", + "# Calculate the density of the agar using the formula: Density = Mass / (Area * Height)\n", + "agar_density = mass_agar / ((area_base * adjusted_agar_height)/100) # Density in g/cm^3\n", + "\n", + "# Output the calculated agar density\n", + "print(f\"Agar Density: {agar_density} g/cm^3\")" + ] + }, + { + "cell_type": "code", + "execution_count": 23, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Calculated Agar Height: 2.63 mm\n" + ] + } + ], + "source": [ + "# Shows how APEX will calulate agar height\n", + "\n", + "def calculate_agar_height(plate_with_agar: float, empty_plate: float, plate_area: float, density: float, height_offset: float) -> float:\n", + " \"\"\"\n", + " Calculate the height of the agar in a plate.\n", + " \n", + " Parameters:\n", + " - plate_with_agar (float): Weight of the plate with agar in grams.\n", + " - empty_plate (float): Weight of the empty plate in grams.\n", + " - plate_area (float): Area of the plate in square millimeters.\n", + " - density (float): Density of the agar in grams per cubic centimeter.\n", + " - height_offset (float): Additional height to adjust for in millimeters.\n", + " \n", + " Returns:\n", + " - float: Calculated height of the agar in millimeters.\n", + " \"\"\"\n", + " # Calculate the weight of the agar by subtracting the weight of the empty plate from the weight with agar\n", + " agar_weight = plate_with_agar - empty_plate\n", + " \n", + " # Convert density from g/cm^3 to g/mm^3 for calculation\n", + " density_mm3 = density / 1000\n", + " \n", + " # Calculate the height of the agar by dividing the weight by the product of the area and the density\n", + " height = agar_weight / (plate_area * density_mm3)\n", + " \n", + " # Add any additional height offsets\n", + " total_height = height + height_offset\n", + " \n", + " return total_height\n", + "\n", + "# Example\n", + "empty_plate_weight = 38.9518 # in grams\n", + "plate_with_agar_weight = 57.3196 # in grams\n", + "plate_area = 9469.2 # in square millimeters\n", + "density = 0.911 # Density in grams per cubic centimeter\n", + "height_offset = 0.5 # Additional height in millimeters\n", + "\n", + "# Calculate the agar height\n", + "agar_height = calculate_agar_height(plate_with_agar_weight, empty_plate_weight, plate_area, density, height_offset)\n", + "print(f\"Calculated Agar Height: {agar_height:.2f} mm\")" + ] + }, + { + "cell_type": "code", + "execution_count": 24, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "" + ] + }, + "execution_count": 24, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# Move the tip to the agar height calculated by APEX\n", + "well_height_check = \"A1\"\n", + "z_agar_height = agar_height # height of the agar surface from the bottom of the well in mm\n", + "pipette.move_to(plate[well_density_check].bottom(z=z_agar_height))\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "pipette.return_tip()" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.10.8" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +}