Skip to main content

Python library for generating Autoprotocol

Project description

PyPI Version Build Status Code Coverage PyPI - Downloads Gitter Chat

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

autoprotocol-7.14.2.tar.gz (124.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

autoprotocol-7.14.2-py3-none-any.whl (136.3 kB view details)

Uploaded Python 3

File details

Details for the file autoprotocol-7.14.2.tar.gz.

File metadata

  • Download URL: autoprotocol-7.14.2.tar.gz
  • Upload date:
  • Size: 124.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9

File hashes

Hashes for autoprotocol-7.14.2.tar.gz
Algorithm Hash digest
SHA256 3c89f758046c3fc72f56651b00b1d7fe3c088ec10c87787934f2d423e1d04b74
MD5 98ecd40e015438868808dd362210b8f4
BLAKE2b-256 695b03534e795ba4f99b049c5db4a34eb986a0c1fc25fc288bdf5cb559593203

See more details on using hashes here.

File details

Details for the file autoprotocol-7.14.2-py3-none-any.whl.

File metadata

  • Download URL: autoprotocol-7.14.2-py3-none-any.whl
  • Upload date:
  • Size: 136.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9

File hashes

Hashes for autoprotocol-7.14.2-py3-none-any.whl
Algorithm Hash digest
SHA256 afb86b5dca4abca9b5111f9d3fd133a16746b936d15f8312959999335846ee43
MD5 39cb4cdb98137fd10fef5ba490286ae5
BLAKE2b-256 96e11302d9ccea82ca90ea4bfa73c8e0a2fcf526fbbccca8ec2142c57042ee81

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page