To interactively work with protocols and data, we recommend using Jupyter Notebook, formerly known IPython. The Strateos Command Line Interface comes with a a Python library that makes working with the Strateos API very easy from the IPython environment.
from transcriptic import run from transcriptic.config import Connection Connection("[email protected]", "my_API_Key", "my-organization-id") run_data = run("my-run-id")
If you've previously logged into the Strateos CLI using the
transcriptic login command, you can create a
Connection from the cached credentials:
from transcriptic import run from transcriptic.config import Connection Connection.from_file("~/.transcriptic") run_data = run("my-run-id")
There are a variety of helper functions to make getting data easy. They work by automatically picking up on a previously-created
Connection object, so you must create a connection before using them. You don't, however, need to pass in the connection as a parameter - they pick up on it automatically.
run(id: string) project(id: string) dataset(id: string) container(id: string) aliquot(id: string) resource(id: string) analyze(protocol: dict, test_mode: bool) submit(protocol: dict, project: string, title: string, test_mode: bool)
Connection object also contains many methods for interacting with your Strateos account; it can be thought of as an "organization" class.
org = Connection("[email protected]", "my_API_key", "my-organization-id") project = org.create_project("Example Project") run_list = project.runs() # will be an empty list, since you just created this project package_list = org.packages()
Updated almost 2 years ago