Skip to content

Commit 216ed9e

Browse files
committed
fix cytomat notebook
1 parent 623edcc commit 216ed9e

File tree

1 file changed

+183
-1
lines changed

1 file changed

+183
-1
lines changed
Lines changed: 183 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,183 @@
1-
{"cells": [{"cell_type": "markdown", "id": "abb22091", "metadata": {}, "source": ["# Hello World, \"Cytomat Incubator\"!\n", "\n", "The Cytomat series of incubators is used for storing microplates under\n", "controlled environmental conditions. PyLabRobot implements the\n", "{class}`~pylabrobot.incubators.cytomat.cytomat.CytomatBackend` which\n", "supports several models such as `C6000`, `C6002`, `C2C_50`, `C2C_425`,\n", "`C2C_450_SHAKE` and `C5C`.\n", "\n", "In this tutorial we show how to:\n", "- connect to the incubator\n", "- configure racks\n", "- move plates in and out\n", "- monitor temperature and humidity\n", "\n", "```{note}\n", "This notebook uses `await` statements which must be run inside an\n", "asynchronous environment such as `asyncio`.\n", "```"]}, {"cell_type": "code", "execution_count": null, "id": "b6b9218a", "metadata": {}, "outputs": [], "source": ["from pylabrobot.incubators import CytomatBackend, CytomatType\n", "from pylabrobot.incubators.cytomat.racks import cytomat_rack_9mm_51\n", "from pylabrobot.incubators.incubator import Incubator\n", "from pylabrobot.resources.corning.plates import Cor_96_wellplate_360ul_Fb\n", "from pylabrobot.resources import Coordinate\n", "\n", "# Connect to the incubator via a serial port\n", "backend = CytomatBackend(model=CytomatType.C6000, port=\"/dev/ttyUSB0\")\n", "\n", "# Create a rack and assemble an `Incubator` resource\n", "rack = cytomat_rack_9mm_51(\"rack_A\")\n", "incubator = Incubator(\n", " backend=backend,\n", " name=\"cyto\",\n", " size_x=860,\n", " size_y=550,\n", " size_z=900,\n", " racks=[rack],\n", " loading_tray_location=Coordinate(0, 0, 0),\n", ")"]}, {"cell_type": "markdown", "id": "de3fe5c6", "metadata": {}, "source": ["## Setup\n", "\n", "Setting up the incubator opens the serial connection and initializes the\n", "device."]}, {"cell_type": "code", "execution_count": null, "id": "cee39594", "metadata": {}, "outputs": [], "source": ["await incubator.setup()"]}, {"cell_type": "markdown", "id": "8f379ea7", "metadata": {}, "source": ["## Storing a plate\n", "\n", "To store a plate we first place it on the loading tray and then call\n", "{meth}`~pylabrobot.incubators.incubator.Incubator.take_in_plate`.\n", "You can choose a site automatically or specify one explicitly.\n"]}, {"cell_type": "code", "execution_count": null, "id": "25169f81", "metadata": {}, "outputs": [], "source": ["plate = Cor_96_wellplate_360ul_Fb(\"my_plate\")\n", "incubator.loading_tray.assign_child_resource(plate)\n", "await incubator.take_in_plate(\"smallest\") # choose the smallest free site\n", "\n", "# other options:\n", "# await incubator.take_in_plate(\"random\") # random free site\n", "# await incubator.take_in_plate(rack[3]) # store at rack position 3\n"]}, {"cell_type": "markdown", "id": "31f1c241", "metadata": {}, "source": ["## Retrieving a plate\n", "\n", "Use {meth}`~pylabrobot.incubators.incubator.Incubator.fetch_plate_to_loading_tray`\n", "to move a plate from storage to the loading tray."]}, {"cell_type": "code", "execution_count": null, "id": "632ec3f7", "metadata": {}, "outputs": [], "source": ["await incubator.fetch_plate_to_loading_tray(\"my_plate\")\n", "retrieved = incubator.loading_tray.resource"]}, {"cell_type": "markdown", "id": "7dc4dfb9", "metadata": {}, "source": ["## Monitoring conditions\n", "\n", "The Cytomat provides queries for temperature and humidity."]}, {"cell_type": "code", "execution_count": null, "id": "0d768495", "metadata": {}, "outputs": [], "source": ["current_temp = await incubator.get_temperature()\n", "current_humidity = await incubator.backend.get_humidity()\n", "print(current_temp, current_humidity)"]}, {"cell_type": "markdown", "id": "7c27b01e", "metadata": {}, "source": ["## Shutdown\n", "\n", "Always close the connection when finished."]}, {"cell_type": "code", "execution_count": null, "id": "28b68d42", "metadata": {}, "outputs": [], "source": ["await incubator.stop()"]}], "metadata": {"jupytext": {"cell_metadata_filter": "-all", "main_language": "python", "notebook_metadata_filter": "-all"}}, "nbformat": 4, "nbformat_minor": 5}
1+
{
2+
"cells": [
3+
{
4+
"cell_type": "markdown",
5+
"id": "abb22091",
6+
"metadata": {},
7+
"source": [
8+
"# Hello World, \"Cytomat Incubator\"!\n",
9+
"\n",
10+
"The Cytomat series of incubators is used for storing microplates under\n",
11+
"controlled environmental conditions. PyLabRobot implements the\n",
12+
"{class}`~pylabrobot.incubators.cytomat.cytomat.CytomatBackend` which\n",
13+
"supports several models such as `C6000`, `C6002`, `C2C_50`, `C2C_425`,\n",
14+
"`C2C_450_SHAKE` and `C5C`.\n",
15+
"\n",
16+
"In this tutorial we show how to:\n",
17+
"- connect to the incubator\n",
18+
"- configure racks\n",
19+
"- move plates in and out\n",
20+
"- monitor temperature and humidity\n",
21+
"\n",
22+
"```{note}\n",
23+
"This notebook uses `await` statements which must be run inside an\n",
24+
"asynchronous environment such as `asyncio`.\n",
25+
"```"
26+
]
27+
},
28+
{
29+
"cell_type": "code",
30+
"execution_count": null,
31+
"id": "b6b9218a",
32+
"metadata": {},
33+
"outputs": [],
34+
"source": [
35+
"from pylabrobot.incubators import CytomatBackend, CytomatType\n",
36+
"from pylabrobot.incubators.cytomat.racks import cytomat_rack_9mm_51\n",
37+
"from pylabrobot.incubators.incubator import Incubator\n",
38+
"from pylabrobot.resources.corning.plates import Cor_96_wellplate_360ul_Fb\n",
39+
"from pylabrobot.resources import Coordinate\n",
40+
"\n",
41+
"# Connect to the incubator via a serial port\n",
42+
"backend = CytomatBackend(model=CytomatType.C6000, port=\"/dev/ttyUSB0\")\n",
43+
"\n",
44+
"# Create a rack and assemble an `Incubator` resource\n",
45+
"rack = cytomat_rack_9mm_51(\"rack_A\")\n",
46+
"incubator = Incubator(\n",
47+
" backend=backend,\n",
48+
" name=\"cyto\",\n",
49+
" size_x=860,\n",
50+
" size_y=550,\n",
51+
" size_z=900,\n",
52+
" racks=[rack],\n",
53+
" loading_tray_location=Coordinate(0, 0, 0),\n",
54+
")"
55+
]
56+
},
57+
{
58+
"cell_type": "markdown",
59+
"id": "de3fe5c6",
60+
"metadata": {},
61+
"source": [
62+
"## Setup\n",
63+
"\n",
64+
"Setting up the incubator opens the serial connection and initializes the\n",
65+
"device."
66+
]
67+
},
68+
{
69+
"cell_type": "code",
70+
"execution_count": null,
71+
"id": "cee39594",
72+
"metadata": {},
73+
"outputs": [],
74+
"source": [
75+
"await incubator.setup()"
76+
]
77+
},
78+
{
79+
"cell_type": "markdown",
80+
"id": "8f379ea7",
81+
"metadata": {},
82+
"source": [
83+
"## Storing a plate\n",
84+
"\n",
85+
"To store a plate we first place it on the loading tray and then call\n",
86+
"{meth}`~pylabrobot.incubators.incubator.Incubator.take_in_plate`.\n",
87+
"You can choose a site automatically or specify one explicitly.\n"
88+
]
89+
},
90+
{
91+
"cell_type": "code",
92+
"execution_count": null,
93+
"id": "25169f81",
94+
"metadata": {},
95+
"outputs": [],
96+
"source": [
97+
"plate = Cor_96_wellplate_360ul_Fb(\"my_plate\")\n",
98+
"incubator.loading_tray.assign_child_resource(plate)\n",
99+
"await incubator.take_in_plate(\"smallest\") # choose the smallest free site\n",
100+
"\n",
101+
"# other options:\n",
102+
"# await incubator.take_in_plate(\"random\") # random free site\n",
103+
"# await incubator.take_in_plate(rack[3]) # store at rack position 3\n"
104+
]
105+
},
106+
{
107+
"cell_type": "markdown",
108+
"id": "31f1c241",
109+
"metadata": {},
110+
"source": [
111+
"## Retrieving a plate\n",
112+
"\n",
113+
"Use {meth}`~pylabrobot.incubators.incubator.Incubator.fetch_plate_to_loading_tray`\n",
114+
"to move a plate from storage to the loading tray."
115+
]
116+
},
117+
{
118+
"cell_type": "code",
119+
"execution_count": null,
120+
"id": "632ec3f7",
121+
"metadata": {},
122+
"outputs": [],
123+
"source": [
124+
"await incubator.fetch_plate_to_loading_tray(\"my_plate\")\n",
125+
"retrieved = incubator.loading_tray.resource"
126+
]
127+
},
128+
{
129+
"cell_type": "markdown",
130+
"id": "7dc4dfb9",
131+
"metadata": {},
132+
"source": [
133+
"## Monitoring conditions\n",
134+
"\n",
135+
"The Cytomat provides queries for temperature and humidity."
136+
]
137+
},
138+
{
139+
"cell_type": "code",
140+
"execution_count": null,
141+
"id": "0d768495",
142+
"metadata": {},
143+
"outputs": [],
144+
"source": [
145+
"current_temp = await incubator.get_temperature()\n",
146+
"current_humidity = await incubator.backend.get_humidity()\n",
147+
"print(current_temp, current_humidity)"
148+
]
149+
},
150+
{
151+
"cell_type": "markdown",
152+
"id": "7c27b01e",
153+
"metadata": {},
154+
"source": [
155+
"## Shutdown\n",
156+
"\n",
157+
"Always close the connection when finished."
158+
]
159+
},
160+
{
161+
"cell_type": "code",
162+
"execution_count": null,
163+
"id": "28b68d42",
164+
"metadata": {},
165+
"outputs": [],
166+
"source": [
167+
"await incubator.stop()"
168+
]
169+
}
170+
],
171+
"metadata": {
172+
"jupytext": {
173+
"cell_metadata_filter": "-all",
174+
"main_language": "python",
175+
"notebook_metadata_filter": "-all"
176+
},
177+
"language_info": {
178+
"name": "python"
179+
}
180+
},
181+
"nbformat": 4,
182+
"nbformat_minor": 5
183+
}

0 commit comments

Comments
 (0)