Giter VIP home page Giter VIP logo

trident-demo's Introduction

Aquarium Python Scripting Demo

This is a demo for Python scripting to accessing Aquarium using Trident.

This demo uses pydent 0.0.35. Version 0.1.5a6 is also available.

Note: The use of Docker is technically not necessary, but it is used here to manage the Python environment.

Getting started

The example scripts assume a file resources.py that defines the values login, password and url. This file can be constructed by first running the command

cp resources.py-temp resources.py

and then changing the values to match your Aquarium account.

The import

from resources import resources

should be included at the top of each script.

The command

session = AqSession(
        resources['aquarium']['login'],
        resources['aquarium']['password'],
        resources['aquarium']['aquarium_url']
    )

creates the session object to make queries to Aquarium.

Note that resources.py contains secrets that should not be checked into your version control.

Samples

To get a sample, the best strategy is to query by the sample name. For instance, using the BIOFAB production system, the query

sample = session.Sample.find_by_name('IAA1-Nat-F')

returns the sample with the name IAA1-Nat-F. We can inspect the type of the sample with

print(sample.sample_type.name)

which shows this sample is a primer. Running

print(sample.properties)

will show the properties that define this sample as a case of the sample type (a primer should have an overhang and anneal sequence, and an annealing temperature).

Each sample has a name, project, description, properties and sample_type properties.

To create a sample linked to the database, use the Sample.new function:

primer_type = session.SampleType.find_by_name('Primer')
sample = session.Sample.new(
    name="Example Primer",
    project="trident-demo",
    description="primer created with trident",
    sample_type_id=primer_type.id,
    properties={
        'Overhang Sequence': 'AAAAA',
        'Anneal Sequence': 'GGGGGGGG',
        'T Anneal': 70
    }
)

To save this sample object to Aquarium, it is necessary to run the command

sample.save()

(Don't do save this demo object to a production system!)

Plans

Using Trident makes it possible to create complex plans that are tedious to create with the graphical planner in Aquarium.

This section shows creating plans in pydent 0.0.35 The next release includes simplified planning.

Provenance

For getting information about previous runs, we are going to demo the aquarium-provenance package based on Trident.

trident-demo's People

Contributors

bjkeller avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.