Python library for generating Autoprotocol
Project description
Autoprotocol is the standard way to express experiments in life science. This repository contains a python library for generating Autoprotocol.
Installation
To work from the latest stable release:
pip install autoprotocol
check the the releases for more information about the changes that will be downloaded.
Alternatively to get more up-to-date features:
git clone https://github.com/autoprotocol/autoprotocol-python
cd autoprotocol-python
python setup.py install
check the changelog for information about features included on master but not yet released.
Building a Protocol
A basic protocol is written by declaring Protocol.ref
objects and acting on them with Protocol.instruction
methods.
import json
from autoprotocol.protocol import Protocol
# instantiate a protocol object
p = Protocol()
# generate a ref
# specify where it comes from and how it should be handled when the Protocol is done
plate = p.ref("test pcr plate", id=None, cont_type="96-pcr", discard=True)
# generate seal and spin instructions that act on the ref
# some parameters are explicitly specified and others are left to vendor defaults
p.seal(
ref=plate,
type="foil",
mode="thermal",
temperature="165:celsius",
duration="1.5:seconds"
)
p.spin(
ref=plate,
acceleration="1000:g",
duration="1:minute"
)
# serialize the protocol as Autoprotocol JSON
print(json.dumps(p.as_dict(), indent=2))
which prints
{
"instructions": [
{
"op": "seal",
"object": "test pcr plate",
"type": "foil",
"mode": "thermal",
"mode_params": {
"temperature": "165:celsius",
"duration": "1.5:second"
}
},
{
"op": "spin",
"object": "test pcr plate",
"acceleration": "1000:g",
"duration": "1:minute"
}
],
"refs": {
"test pcr plate": {
"new": "96-pcr",
"discard": true
}
}
}
Extras
Select SublimeText snippets are included with this repository.
To use them copy the autoprotocol-python SublimeText Snippet
folder to your local Sublime /Packages/User
directory.
Documentation
For more information, see the documentation.
Contributing
For more information, see CONTRIBUTING.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for autoprotocol-7.11.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f267e9349a91e49954e899ccb0a20d778c60e17302a91053af764c633de0361c |
|
MD5 | 8d271a4ea078d70d18f459f9b10980e8 |
|
BLAKE2b-256 | 415c1b65023ec181ca219ff131f89acb84fed8a70eae63b1d20e38c5ce4b27a7 |