Skip to content

Provides a variety of functionalities for writing JSON OpenTron protocols in Ruby.

License

Notifications You must be signed in to change notification settings

emernic/opentrons_gem

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OpenTrons Gem

This Ruby gem provides basic functionality for creating and manipulating OpenTron JSON protocols. This gem is not a product of OpenTrons. The API is designed to mirror the official OpenTrons Python API for ease of use.

Examples

Import the gem:

require 'opentrons'

Create a protocol:

p = OpenTrons::OTProtocol.new

Create a labware item:

block = p.labware.load('96-deep-well', '2', 'culture_block')

Create a tiprack:

tip_rack_1 = p.labware.load('tiprack-10ul', '3', 'tiprack-10ul')

Create a pipette:

p10 = p.instruments.P10_Single(mount='left', tip_racks=[tip_rack_1])

Create a pipette and generate tip_racks of model "tiprack-10ul" as needed:

# This is a new feature! Racks will be generated in the highest-numbered available slot.
p10 = p.instruments.P10_Single(mount='left', tip_model="tiprack-10ul")

Pick up a tip:

p10.pick_up_tip()

Add an aspirate command:

p10.aspirate(10, block.wells(0))

Add a dispense command:

p10.dispense(10, block.wells(1).top(2))

Discard tip:

p10.drop_tip()

Examples, saving protocols

Generate a hash of the protocol:

p.to_hash

Generate a JSON string of the protocol:

p.to_json

Save a protocol as a JSON file:

File.open("protocol.json", 'w') {|f| f.write(p.to_json)}

Limitations of current version

Installation

This gem requires Ruby. The gem can be installed via:

gem install opentrons

At the time of writing, support for JSON protocols in the OT2 app is still under development. If you would like to try out or contribute to this gem before JSON protocol support is added to the app, you may find these json-to-python protocol converters useful. https://github.com/emernic/OT2_json_workarounds

Contributing

If you would like to contribute, submit issues on github, submit a pull request, or email emernic at bu dot edu. You can also feel free to fork it and make your own version. The gem is distributed under the MIT license and is free to use.

About

Provides a variety of functionalities for writing JSON OpenTron protocols in Ruby.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages