Skip to content

Commit 401c0be

Browse files
authored
docs: add PlateAdapter tutorial (#569)
1 parent 216ed9e commit 401c0be

File tree

2 files changed

+117
-4
lines changed

2 files changed

+117
-4
lines changed
Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
{
2+
"cells": [
3+
{
4+
"cell_type": "markdown",
5+
"id": "211553de",
6+
"metadata": {},
7+
"source": [
8+
"# PlateAdapter\n",
9+
"\n",
10+
"`PlateAdapter` represents accessories that hold plates while providing a\n",
11+
"standardized grid of holes or wells. It is useful when a plate cannot be placed\n",
12+
"directly on a carrier site because the skirt or dimensions do not match the\n",
13+
"standard ANSI/SLAS format. Examples include magnetic racks, heater shakers or\n",
14+
"adapters for semi-skirted PCR plates.\n",
15+
"\n",
16+
"By treating adapters as resources, PyLabRobot can automatically compute the\n",
17+
"position of the plate relative to the adapter. This ensures wells line up with\n",
18+
"the adapter holes while keeping a simple API for moving plates around.\n",
19+
"\n",
20+
"In most workflows you create an adapter and then assign a plate to it."
21+
]
22+
},
23+
{
24+
"cell_type": "markdown",
25+
"id": "5ba42bf1",
26+
"metadata": {},
27+
"source": [
28+
"## Creating a PlateAdapter\n",
29+
"\n",
30+
"You can instantiate a `PlateAdapter` directly by specifying its size and the\n",
31+
"layout of its holes. The example below creates a simplified magnetic rack for a\n",
32+
"96 well plate."
33+
]
34+
},
35+
{
36+
"cell_type": "code",
37+
"execution_count": null,
38+
"id": "1d427527",
39+
"metadata": {},
40+
"outputs": [],
41+
"source": [
42+
"from pylabrobot.resources.plate_adapter import PlateAdapter\n",
43+
"\n",
44+
"magnet = PlateAdapter(\n",
45+
" name=\"magnet\",\n",
46+
" size_x=127.76,\n",
47+
" size_y=85.48,\n",
48+
" size_z=35.0,\n",
49+
" dx=9.8,\n",
50+
" dy=6.8,\n",
51+
" dz=27.5, # height of the plate above the deck\n",
52+
" adapter_hole_size_x=8.0,\n",
53+
" adapter_hole_size_y=8.0,\n",
54+
" adapter_hole_size_z=8.0,\n",
55+
" site_pedestal_z=6.2,\n",
56+
")\n",
57+
"magnet"
58+
]
59+
},
60+
{
61+
"cell_type": "markdown",
62+
"id": "abbafb2c",
63+
"metadata": {},
64+
"source": [
65+
"## Placing a plate on an adapter\n",
66+
"\n",
67+
"`PlateAdapter.assign_child_resource()` automatically aligns the plate's wells\n",
68+
"with the adapter holes. This uses `compute_plate_location()` internally.\n",
69+
"Below we place a Corning 96 well plate on our magnetic rack."
70+
]
71+
},
72+
{
73+
"cell_type": "code",
74+
"execution_count": null,
75+
"id": "88b02d82",
76+
"metadata": {},
77+
"outputs": [],
78+
"source": [
79+
"from pylabrobot.resources.corning import Cor_96_wellplate_2mL_Vb\n",
80+
"\n",
81+
"plate = Cor_96_wellplate_2mL_Vb(name=\"plate\")\n",
82+
"magnet.assign_child_resource(plate)\n",
83+
"magnet.children"
84+
]
85+
},
86+
{
87+
"cell_type": "markdown",
88+
"id": "9c1f90c1",
89+
"metadata": {},
90+
"source": [
91+
"`compute_plate_location()` can also be called directly to see where the plate\n",
92+
"will be positioned relative to the adapter."
93+
]
94+
},
95+
{
96+
"cell_type": "code",
97+
"execution_count": null,
98+
"id": "3e3cbbd0",
99+
"metadata": {
100+
"lines_to_next_cell": 2
101+
},
102+
"outputs": [],
103+
"source": [
104+
"magnet.compute_plate_location(plate)"
105+
]
106+
}
107+
],
108+
"metadata": {
109+
"jupytext": {
110+
"cell_metadata_filter": "-all",
111+
"main_language": "python",
112+
"notebook_metadata_filter": "-all"
113+
}
114+
},
115+
"nbformat": 4,
116+
"nbformat_minor": 5
117+
}

docs/resources/plate-adapter/plate-adapter.rst

Lines changed: 0 additions & 4 deletions
This file was deleted.

0 commit comments

Comments
 (0)