Skip to content

Commit 0be966a

Browse files
authored
Merge pull request #127 from OpenTrons/document-custom-containers
add custom containers
2 parents 57357c2 + e3d77d4 commit 0be966a

File tree

3 files changed

+131
-15
lines changed

3 files changed

+131
-15
lines changed

docs/source/custom_containers.rst

Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
.. _custom_containers:
2+
3+
Custom Containers
4+
=================
5+
6+
To create a custom container, you need to create a JSON file that defines the shape of the container.
7+
Here is an example of a custom container that represents a plate with only 3 circular wells.
8+
9+
.. code-block:: javascript
10+
11+
{
12+
"containers" : {
13+
"tuberack-custom": {
14+
"locations": {
15+
"A1": {
16+
"x": 0,
17+
"y": 0,
18+
"z": 0,
19+
"depth": 30,
20+
"diameter": 6,
21+
"total-liquid-volume": 500
22+
},
23+
"B1": {
24+
"x": 20,
25+
"y": 0,
26+
"z": 0,
27+
"depth": 30,
28+
"diameter": 6,
29+
"total-liquid-volume": 500
30+
},
31+
"C1": {
32+
"x": 40,
33+
"y": 0,
34+
"z": 0,
35+
"depth": 30,
36+
"diameter": 6,
37+
"total-liquid-volume": 500
38+
}
39+
}
40+
}
41+
}
42+
}
43+
44+
The first key, "containers", is required in every container file. The next key, "tuberack-custom", is the name of your custom container.
45+
Inside "locations" you can define the x, y, z, depth, diameter, and total-liquid-volume (a volume tracking feature is coming soon).
46+
47+
If you would like to create a container with rectangular wells, simple replace the "diameter" attribute with a "length" and "width" attribute, like so:
48+
49+
.. code-block:: javascript
50+
51+
{
52+
"containers" : {
53+
"trash-square": {
54+
"locations": {
55+
"A1": {
56+
"x": 0,
57+
"y": 0,
58+
"z": 0,
59+
"depth": 35,
60+
"diameter": 6,
61+
"total-liquid-volume": 500
62+
},
63+
}
64+
}
65+
}
66+
}
67+
68+
69+
In addition, you can include any number of custom containers in a container file - simply add more containers as values of the "containers" key. For example:
70+
71+
.. code-block:: javascript
72+
73+
{
74+
"containers" : {
75+
"trash-square": {
76+
"locations": {
77+
"A1": {
78+
"x": 0,
79+
"y": 0,
80+
"z": 0,
81+
"depth": 35,
82+
"diameter": 6,
83+
"total-liquid-volume": 500
84+
},
85+
}
86+
},
87+
"trash-square": {
88+
"locations": {
89+
"A1": {
90+
"x": 5,
91+
"y": 10,
92+
"z": 15,
93+
"depth": 40,
94+
"length": 5,
95+
"width": 10,
96+
"total-liquid-volume": 538
97+
}
98+
}
99+
}
100+
}
101+
}
102+
103+
104+
Lastly, to load a custom container into your app, click "File" and then "Open Containers Folder". Then, drag or copy and paste in the custom container file you wrote in order to access it through a Python or JSON protocol.
105+
106+
Here is an example of loading into a Python protocol the custom trash container that I defined above.
107+
108+
.. code-block:: python
109+
110+
from opentrons import containers
111+
112+
custom_trash = containers.load(
113+
'trash-square',
114+
'B2'
115+
)

docs/source/index.rst

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
well_2 = plate[1]
2525
well_3 = plate[2]
2626
well_4 = plate[3]
27-
27+
2828
p200 = instruments.Pipette(
2929
axis="b",
3030
max_volume = 1000
@@ -33,7 +33,7 @@
3333
pipette = p200
3434

3535
.. testsetup:: index_long
36-
36+
3737
from opentrons import robot
3838
robot.reset()
3939

@@ -43,20 +43,20 @@ Opentrons API:|br| Simple Biology Lab Protocol Coding
4343
Introduction
4444
------------
4545

46-
The Opentrons API is a simple framework designed to make writing automated biology lab protocols easy.
46+
The Opentrons API is a simple framework designed to make writing automated biology lab protocols easy.
4747

48-
We've designed it in a way we hope is accessible to anyone with basic computer and wetlab skills. As a bench scientist, you should be able to code your automated protocols in a way that reads like a lab notebook.
48+
We've designed it in a way we hope is accessible to anyone with basic computer and wetlab skills. As a bench scientist, you should be able to code your automated protocols in a way that reads like a lab notebook.
4949

5050
.. testcode:: index_main
51-
51+
5252
pipette.aspirate(tube_1).dispense(tube_2)
5353

54-
That is how you tell the Opentrons robot to aspirate its the maximum volume of the current pipette from one tube and dispense it into another one.
54+
That is how you tell the Opentrons robot to aspirate its the maximum volume of the current pipette from one tube and dispense it into another one.
5555

5656
You string these commands into full protocols that anyone with Opentrons can run. This one way to program the robot to use a p200 pipette to pick up 200ul (its full volume) and dispense 50ul into the first four wells in a 96 well plate called 'plate.'
5757

5858
.. testcode:: index_main
59-
59+
6060
p200.aspirate(trough[1])
6161
p200.dispense(50, plate[0])
6262
p200.dispense(50, plate[1])
@@ -66,7 +66,7 @@ You string these commands into full protocols that anyone with Opentrons can run
6666
If you wanted to do this 96 times, you could write it like this:
6767

6868
.. testcode:: index_main
69-
69+
7070
for i in range(96):
7171
if p200.current_volume < 50:
7272
p200.aspirate(trough[1])
@@ -82,12 +82,12 @@ Basic Principles
8282

8383
p200.aspirate(100, plate['A1']).dispense(plate['A2'])
8484

85-
Is exactly what you think it would do:
85+
Is exactly what you think it would do:
8686
* Take p200 pipette
8787
* Aspirate 100 uL from well A1 on your plate
8888
* Dispense everything into well A2 on the same plate
8989

90-
**Permissive**: everyone's process is different and we are not trying to impose our way of thinking on you. Instead, our API allows for different ways of expressing your protocol and adding fine details as you need them.
90+
**Permissive**: everyone's process is different and we are not trying to impose our way of thinking on you. Instead, our API allows for different ways of expressing your protocol and adding fine details as you need them.
9191
For example:
9292

9393
.. testcode:: index_main
@@ -122,7 +122,7 @@ Below is a short protocol that will pick up a tip and use it to move 100ul volum
122122
)
123123

124124
plate = containers.load('96-flat', 'B1', 'plate')
125-
125+
126126
p200 = instruments.Pipette(
127127
axis="b",
128128
max_volume=200
@@ -150,6 +150,7 @@ Table of Contents
150150
well_access
151151
running_app
152152
tips_and_tricks
153+
custom_containers
153154
module
154155
api
155156

@@ -164,4 +165,4 @@ Indices and tables
164165

165166
.. |br| raw:: html
166167

167-
<br />
168+
<br />

docs/source/setup.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
.. _setup:
22

3-
================================
4-
Setting Up Code Environment
5-
================================
3+
================
4+
Code Environment
5+
================
66

77
Jupyter Code Environment
88
-----------------------------

0 commit comments

Comments
 (0)