This article was created from a community discussion.
OT Protocol Datastructure Guidelines
Protocol Datastructure Guidelines A guide to writing your own JSON protocols for the OT-One liquid handling robot. OK, so you have your OT-One pipetting robot, you've visited our protocol library, and you've run your first 'hello world' protocol. Now, you're ready to make your own protocol. To do that, you
WILL CANINE | 12 AUG 2016
Protocol Datastructure Guidelines
A GUIDE TO WRITING YOUR OWN JSON PROTOCOLS FOR THE OT-ONE LIQUID HANDLING ROBOT.
OK, so you have your OT-One pipetting robot, you've visited our protocol library, and you've run your first 'hello world' protocol. Now, you're ready to make your own protocol.
To do that, you can work with our graphical protocol editor. It is the simplest way to edit and customize a protocol. Here is a good blogpost about using it.
But sometimes, that is not the right tool. Sometimes its easier to copy and paste a chunk of one protocol and paste it into another. And to that you have to dive into the actual code. So, lets dive!
What is JSON?
JSON stands for JavaScript Object Notation. It is a web-native, text-only, data-object format. But you dont have to know all of that.
The main thing to know about JSON is that it is 'nested.' That means that attributes exist inside of each other.
{"people":
"person1":
{
"firstName":"Jane",
"lastName":"Doe"
}
}
The above example shows how you could represent information about people. The larger object, 'people,' is an array that contains multiple nested objects, 'person1' enclosed by{}
, which in turn contains two of its own nested objects inside them, in this case 'firstName' and 'lastName.'
{
"people":[
"person1":
{
"firstName": "Jane",
"lastName": "Doe"
},
"person2":
{
"firstName": "Sally",
"lastName": "Smith",
"favoriteColor": "green"
}
]
}
Now we've added a second person to our list of people. And this person has one more attribute, favorite color.
Its simple! The only tricky thing can be getting all your ,
's and {}
's in the right place. For that JSON Lint is a very helpful tool.
OK, now you know the basics of JSON!
Anatomy of OT JSON
OpenTrons JSON format has three major sections:
- Head
"head": {
- Deck
"deck": {
- Ingredients
"ingredients": {
- Instructions
"instructions": [
Deck
The Deck section defines which locations and labware will be used in the protocol. This is where you tell the robot you are using a standard 96 well plate, 200 μl tip rack, and whatever else you need for your protocol.
Each element follows the same rules:
"useful-name" : {
"labware": "exact-labware-definition",
"slot" : "Slot-on-deck"
}