Installation
Install stepwise_mol_bio using pip:
$ pip install stepwise_mol_bio
Writing a protocol
While there are a lot of tools to help make writing protocols easier, it’s not necessarily easy to see how they all fit together. Below are a set of guidelines to help get you on the right track:
The protocols in this repository are much more sophisticated than the usual protocols you’d write. That’s because these protocols represent very common techniques, and are meant to be very reuseable.
Every protocol should:
Read options from the command-line. Many protocols support the following options:
-p, –preset
-v, –volume
-c, –conc
-n, –num-reactions
-u, –product
Read options from any stepwise configuration file.
Read options from the FreezerBox database, if available.
Be completely configurable from python
The typical architecture for a script:
Use appcli to read attributes from the various data sources mentioned above.
Typical classes:
App:
Inherit from Main or Cleanup.
Represents the complete protocol, which is usually a single master mix and some follow-up steps.
The command-line and FreezerBox interfaces will be derived from this object.
Reaction:
Inherit from Argument.
Represents a single reaction. The app will hold a list of reactions.
There’s a bit of an art to deciding which attributes go in the app vs the reaction. In general, anything that could vary between reactions (e.g. stock concentrations) should go in the reaction. Anything that can’t vary without it becoming impossible to make a master mix (e.g. final concentrations, volumes) should go in the app.
Reagent:
Inherit from Argument.
Represents the individual reagents that make up the reaction, e.g. template and primers for PCR, DNA and enzyme for restriction digests, backbone and fragments for assemblies, etc.
The reaction and reagent classes sometimes have different names, if there’s a term that makes more sense for the specific protocol at hand.
For example, the PCR protocol uses the term “amplicon” instead of “reaction”, and has reagents named “template” and “primer”.
Sometimes it makes sense to combine the reaction and reagent classes:
For example, the digest protocol would naturally have a reaction class with enzyme and template attributes. But the enzymes are intrinsic to the master mix (e.g. two digestions with different enzymes would just be done by invoking the digest command twice), and therefore are stored in the app itself. That leaves only the template, which on its own is more like a reagent.
The reactions/reagents must be bound to the app. This is how the reagents access the FreezerBox database. Typically this is done by calling bind_arguments on the reactions whenever they’re accessed by the app.
It is often useful for reactions/reagents to have access to the appcli configs used by the app. This can be done by calling appcli.share_configs(app, self) in the on_bind() method of argument subclasses.
It’s important for the structure of the classes to match the structure of the protocol, e.g. a class for each noun. Because there are so many different interfaces to the app with so much orthogonal functionality, it’s really hard to get away with any attempts to fudge this structure.
The following tests should be included for each protocol:
Python API: vary each attribute one at a time, and make sure it has the intended effect.
Command-line interface: Provide each command-line argument, and make sure it has the expected effect. These checks can be much more cursory than for the python API, because we’re just making sure that the command-line interface is attached to the protocol correctly; we’re already assuming that the protocol itself works.
FreezerBox protocol: Check that attributes are correctly inferred from the database, and that multiple FreezerBox reagents can be combined correctly.
These test cases are often used twice: once to check that sw make works, and once to check that the protocol can be configured from its products.
For example, see the PCR and restriction digest tests.
FreezerBox attributes: Check that any attributes calculated for the FreezerBox database (e.g. product concentration, product volume, etc.) are correct.
Note that not all of the scripts in this repository embody all of these recommendations yet. That’s just because it took me a while to settle on the best way to write these scripts, and it takes a lot of work to rewrite all of these scripts. Any new scripts should adhere to these recommendations, though.
Metadata
Release files for stepwise-mol-bio 1.23.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| stepwise_mol_bio-1.23.1.tar.gz | 1.4 MB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| stepwise_mol_bio-1.23.1-py2.py3-none-any.whl | Python 2, Python 3 | none | any | Details |
Total release size: 2.9 MB
Release files / stepwise_mol_bio-1.23.1.tar.gz
| Download URL | stepwise_mol_bio-1.23.1.tar.gz |
|---|---|
| Size | 1.4 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
165451ac0e73abfa80db0442110967af44608daf0e2642d8caee47094a3928c3
|
|
BLAKE2b-256 checksum How to use checksums |
769caeddd763514143567c8c1fd42ff7cbbfac0f94f135e024385c776daefb58
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.1 importlib_metadata/4.6.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.7.10
|
Release files / stepwise_mol_bio-1.23.1-py2.py3-none-any.whl
| Download URL | stepwise_mol_bio-1.23.1-py2.py3-none-any.whl |
|---|---|
| Size | 1.4 MB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
6b14b26fa580259d5f245168322e617596a627c6b20883843832964503644d16
|
|
BLAKE2b-256 checksum How to use checksums |
861c51209ebf0a09e4a91e553d761ddf3dc164a2fe7a7de647a6d4631ad42d0d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.1 importlib_metadata/4.6.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.7.10
|