A library for the analysis of toehold switch riboregulators.
Project description
ToeholdTools
A library for the analysis of toehold switch riboregulators made by the iGEM team City of London UK 2021. We provide tools for characterizing toehold switches for their specificity to the target RNA, with future plans to expand to design tools.
Installation
We distribute CPython wheels for Python 3.6-3.9 in all major operating systems. Unfortunately, there is no use distributing PyPy builds since it not supported by all dependencies.
Before installation, make sure you have downloaded the NUPACK library by following the instructions here.
You can install ToeholdTools from PyPI via pip:
python3 -m pip install thtools -U
Alternatively, you can build the project from source yourself:
python3 -m pip install git+https://github.com/lkn849/thtools.git
Analyzing toehold switches
How it works
We put each set of RNAs you are testing individually into a virtual test tube with the toehold switch. Then, we use the NUPACK amino acid analysis library to simulate the interactions. Finally, we observe the resulting toehold switch secondary structures to see the probability of your toehold switch activating when that set of RNAs is present.
For performance, the majority of the analysis sub-module is compiled via Cython, and uses the Pathos multiprocessing sub-module for distributing work across CPU cores. We are also considering GIL-free processing using OpenMP.
Quick start
If you don't care about full customizability, using the higher level wrapper is recommended:
import thtools as tt
my_test = tt.autoconfig(
ths = [ # your toehold switch
"UUAGCCGCUGUCACACGCAC"
"AGGGAUUUACAAAAAGAGGA"
"GAGUAAAAUGCUGUGCGUGC"
"ACCAUAAAACGAACAUAGAC" # NOTE: the lack of commas here is Python syntax for writing a long string across several lines.
],
rbs="AGAGGAGA", # the ribosome binding site you used
triggers=[ # the set of individual RNAs which potentially trigger the toehold switch you are testing
"CUGUGCGUGUGACAGCGGCUGA",
"CUAUACAAUCUACUGUCUUUC",
"CUGUACAGCCUCCUAGCUUUCC",
],
const_rna=[], # any other strands you want to keep constant and present in every test tube
set_size=1,
# autoconfig will generate combinatoric trigger sets of sizes up to and including set_size.
# Useful for testing logic gate toehold switches.
# But if you only want to test one a a time as standard, leave as 1.
)
my_results = my_test.run(
max_size=3, # the maximum RNA complex size to consider
n_samples=100, # the number of Boltzmann samples to take of each complex's secondary structure
)
print(my_results)
autoconfig
returns a ToeholdTest
instance which can be run as shown above. You can also construct the ToeholdTest
yourself, but the parameter requirements are quite specific and it's often easier just to use this utility function to auto-generate it for you. Concentrations of all RNA strands is assumed to be 100nM.
This results in a ToeholdResult
instance (which is also stored as the result
attribute of the ToeholdTest
).
To save the data stored in the ToeholdResult
, you can call the .to_csv()
method, which will return a csv string you can save to file.
Advanced analysis
Without using the autoconfig
function, the direct creation of a ToeholdTest
instance is:
import numpy as np
import thtools as tt
ths = { # {sequence : concentration}
"UUAGCCGCUGUCACACGCAC"
"AGGGAUUUACAAAAAGAGGA"
"GAGUAAAAUGCUGUGCGUGC"
"ACCAUAAAACGAACAUAGAC" : 1e-7
}
rbs_position = slice(34, 42) # slice of the above sequence containing the RBS
trigger_sets = np.array( # each sub-array will be individually tested with the toehold switch
[["CUGUGCGUGUGACAGCGGCUGA"],
["CUAUACAAUCUACUGUCUUUC"],
["CUGUACAGCCUCCUAGCUUUCC"]]
)
conc_sets = np.array( # maps a concentration to each sequence in the trigger_sets
[[1e-7],
[1e-7],
[1e-7]],
dtype=np.float64
)
const_rna = {} # {sequence : concentration}
my_test = tt.ToeholdTest(ths, rbs_position, trigger_sets, conc_sets, const_rna)
my_results = my_test.run(
max_size=3,
n_samples=100,
)
print(my_results)
The trigger_sets
and conc_sets
array parameters allows you to specify exactly which combinations and concentrations of RNA strands is tested with the toehold switch in each test tube. Concentrations are measured in molar (M).
You can also pass the thermodynamic model to be used using the model
argument of both constructors. Otherwise the model is 37°C with 1.0M Na+ and a stacking ensemble. For more information on specifying the model parameters see the NUPACK documentation.
Notes
If you are comparing the results of the tests with the online NUPACK website, it is common for a disparity whereby ToeholdTools suggests an RNA activates the toehold switch but the website disagrees. This is due to a difference in thermodynamic models used, since this package uses a newer, superior version of NUPACK with different default model parameters.
However, if you must emulate the website's behavior, you can specify the model parameters:
import nupack
my_model = nupack.Model(
ensemble="some-nupack3",
material="rna95-nupack3",
)
Then you can pass that model as an argument to ToeholdTools.
See also
- The full ToeholdTools documentation
License
MIT MIT License
Copyright (c) 2021 Lucas Ng
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
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 Distributions
Hashes for thtools-0.0.2-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | aab54d1f9d1db9c7e44051284695fec21f50fd708a20fe9dcdc7afa2e151870c |
|
MD5 | 608be516d4f23305959e78f7f914e73e |
|
BLAKE2b-256 | 61e820a80a15603ff643180592648e1e5e5464de3f1df3813da37cd9eeb808db |
Hashes for thtools-0.0.2-cp39-cp39-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8a20e210636333aa24e785c61fbe9f633bcec77647767f4014fa4fd8f4bbe8d7 |
|
MD5 | 6c1597224e3dbf4812cb0be9b9be4a64 |
|
BLAKE2b-256 | 4db202a278a4f39421a8fb0d786634c68bb4b81f92347fc5ebe2cb822638020c |
Hashes for thtools-0.0.2-cp39-cp39-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 716c010e18d8b7acf5c1709f876d5342072365ec8c18330a46801592352decac |
|
MD5 | eec115faf58232e34e5ac206a03b8aff |
|
BLAKE2b-256 | 5fba248d9b7406230c1cb3f82518951989fd663f9d5227effe6e51d77b079852 |
Hashes for thtools-0.0.2-cp39-cp39-manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 05ed1f5af6539eda40650b54467685215d12c1b68b7ef54c6d1fc39cc9fe305b |
|
MD5 | 2946c647981c20a79e5081b56f7ffb19 |
|
BLAKE2b-256 | f31a356cb8effb0efb5a710e48d5163380bb3c443c40913eab7a03dbcb17758c |
Hashes for thtools-0.0.2-cp39-cp39-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 63a4c228a98ae22aa9147dcc36dcba8097bd8ac2d1189b35e20c7210d16d2a42 |
|
MD5 | fefd01deb2c3b6234ce4f8c7ba07b3af |
|
BLAKE2b-256 | 53db6af0f71dd1f57b7a936f8a54cc12e85a799913aa103a376d2e8b72397abe |
Hashes for thtools-0.0.2-cp39-cp39-manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 08d21f7bf7befdc43fb15c97de8423d2731a1ee0f828890c9f1c885e44517659 |
|
MD5 | ccb949aa1d5af10b85aeb30727ba0b38 |
|
BLAKE2b-256 | f7299ae92da6f32db4651c1c04729d3afb97c7a2291bb330c849329c9a6bfeee |
Hashes for thtools-0.0.2-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3ae1d866a154e3dead437c182e07c6140831eec2d8f51d5ed4073cc6f04439e4 |
|
MD5 | 36c8da759f4e1be7f3e1cdbbfbad4856 |
|
BLAKE2b-256 | 9e83b980099fb5e2562cccb5c2c65e594d73045957c7d2f3a0455896681898f8 |
Hashes for thtools-0.0.2-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ff81df9a14b405138520d79ee76d22f81f9af2fcc3c2fe3e04c6c4cb5b034b6b |
|
MD5 | 86e603f79f39fbfb74d41cc938cfb3ca |
|
BLAKE2b-256 | afc2af39c37c2fd91f7318e97c77c5ff61bcecfbeb343fb306d2e63cd7ac548a |
Hashes for thtools-0.0.2-cp38-cp38-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d09507c289381177a11c5f34628fde9213ec1e4d63dcfe8a8f7a0802f9d84a93 |
|
MD5 | 0732855e01bd3cc3a9c8505a904b5865 |
|
BLAKE2b-256 | a5a6176fd0610f375d1cb2342664e42f0f79caf1251aeea780e31f2b1a2ce3db |
Hashes for thtools-0.0.2-cp38-cp38-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 668b28bfa1fe183353f34e2d9f25cf77ff2442046a5b9effd65cda312c42ad5b |
|
MD5 | be4e8e599a1058f7de3ba61fd21d940b |
|
BLAKE2b-256 | ebe3125060df645d731060e9770fd6b3437e2183b4e1d89c6bff54280541db2b |
Hashes for thtools-0.0.2-cp38-cp38-manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a715d10349bb4887f66ef340ddd59e8b60102116ecd5be0660ea9463a9d9df8d |
|
MD5 | fecf3fc8921ce28068a802cc91d8db73 |
|
BLAKE2b-256 | 81bbcd049cb51122438a636671b65d56b969df118a2f204aaaf41c28d979848e |
Hashes for thtools-0.0.2-cp38-cp38-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 47e01526889fe728c0c1a326ba67ec5b5d10cf6bcb2525bb3c7d5743a998950b |
|
MD5 | aa761fb72bd7693efc60462c632aac87 |
|
BLAKE2b-256 | f96bbecd99fe7f7491c441d8802229e071e5d97338d5459e80b80f0108cd0e3a |
Hashes for thtools-0.0.2-cp38-cp38-manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 58fab716322f7d9d61c819351aceb676c4c9985da4649dff60035ceb6c5123c2 |
|
MD5 | 9ea97f5581834f85c7294c9d3bf13102 |
|
BLAKE2b-256 | 97346a5f218e4ec2bed1efd0452533906abc0878fdecebe2a2d5e4fc75131749 |
Hashes for thtools-0.0.2-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1145ffd9565e183f79142c943fdf2e018f36ce0b0f5b0d3b1f381df6167dd4ff |
|
MD5 | 931d3869bea84e8ad7aafab6e37499a6 |
|
BLAKE2b-256 | 0ed1562c1974966de6e1befc0c9dd0d91563846de6d1211105aa5d8251e762ab |
Hashes for thtools-0.0.2-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 85df36778f73de764c282a020b92d50a3684c152edfa843f6842ad7fd2dfec15 |
|
MD5 | 807588019b7e5089a22acbc60b1374fe |
|
BLAKE2b-256 | 51d2738ba99ae96698db1232614a13c62a70c897b60e5921fca1f2afe405d5a6 |
Hashes for thtools-0.0.2-cp37-cp37m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 493383d1da1e082025d338dbdaa4d277536443e6ee90a3b184be229c14be3e61 |
|
MD5 | 81995a3ac5ca0746a1ca21223ce712ca |
|
BLAKE2b-256 | 81d2f85f158ddd5e19a0966cc971bf0b136b5bf4127c3966259b2407047833f0 |
Hashes for thtools-0.0.2-cp37-cp37m-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fda610101fc18f04e7b0bbe122043fced573d3ee4eb1896fb6135b6022bd6ee1 |
|
MD5 | e6948d351ccf4f360e7d45d5473a99aa |
|
BLAKE2b-256 | cd4f33d6df4d88de6840c0149df976a29f25e7559542d7ad9acae5268a7b300a |
Hashes for thtools-0.0.2-cp37-cp37m-manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ab4d66446f368b9f98bf3e104250e88d339eb88c7e7d96c2df36e1d4c36ac0a9 |
|
MD5 | fdf04c50979d47f4c58aa718cc7a4932 |
|
BLAKE2b-256 | 925cecd6b45c8df776b08e7d7bf76b50943a4039654204ea9fdf27292d555cb4 |
Hashes for thtools-0.0.2-cp37-cp37m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bb947c95f7e1ea41f709407d56883f814a9b371c5f958e56189fb332aaf0bdae |
|
MD5 | 45a64fa9ea76b9a4786f2da5a0b2d4c2 |
|
BLAKE2b-256 | 4c847d33dfad58fda30208812b0d56fb78cfcc58d38b9fb2951767c5847670bf |
Hashes for thtools-0.0.2-cp37-cp37m-manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5a5fab643bc2869dfdf637f87492612804e53585d627403f89000c42616bfde4 |
|
MD5 | 3abb8d0612a224b745fbf4af01aa6af5 |
|
BLAKE2b-256 | cd822d913ff7798cecf70d827a44e0d8bfd705a0abdab031befd929f9a50fc6a |
Hashes for thtools-0.0.2-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b157566ac7cb4bb234d43b0dd53ae49d8878cd0db9cf45ce077494c922c08eba |
|
MD5 | fef9aaafc231a31509ec5e7466090571 |
|
BLAKE2b-256 | 14f82d326c5142fc975fe690a8e8fcd9546e186a1ce930f731d5df1d5cfd74c5 |
Hashes for thtools-0.0.2-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c7a87c8e29b01d3d08b94f6235cf86956d9ec1628145e900e65ed0d9d4157c46 |
|
MD5 | b38009207d4b5479d464bed377ff3afd |
|
BLAKE2b-256 | a521bce6e7656487b721b1511713b84c148b999c7e5515e690edf0593642aaf6 |
Hashes for thtools-0.0.2-cp36-cp36m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2b7805a67554c01674b5c2cf5e0dc21717dc31764df1030be8f20e9973df9a32 |
|
MD5 | 77faf300a7db92322518d11fef1851f0 |
|
BLAKE2b-256 | 95afebe545020b42b9cf4fdd173bf419da10eb7b777ac0350f702ee486901ab3 |
Hashes for thtools-0.0.2-cp36-cp36m-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e5b33f3f04fb2a5d512847b12eb70195a63687ed5cc3894ea563ac26c8d0755f |
|
MD5 | 8f23888077a8ddddfcacc2819368590e |
|
BLAKE2b-256 | 71533e74b7aefa82f7752f52d593a8a67bee5d5d1aae1d884cb1d7064a94c6a2 |
Hashes for thtools-0.0.2-cp36-cp36m-manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 37ff42a2abffdc8f1d8ead8100293f3c2da9e77394e6b82dc20ecfbdcbe06468 |
|
MD5 | 3c25f68c0a276da50bbe5c6675770090 |
|
BLAKE2b-256 | 05730c8e8731e6e8b713350201ef95a2a95597942420b30bb1a1c3372fb61a1e |
Hashes for thtools-0.0.2-cp36-cp36m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6f23f147b1ccb3df4e00bb1cd501d7e90b6edaee3857b5fdf4c7b65a1a39d56b |
|
MD5 | 69ef21e2526055b9e09374e3cd6ed496 |
|
BLAKE2b-256 | 857facfdb7160ca7c32b081ac617dc25c40010b18d429698400a1eaf6c5688a0 |
Hashes for thtools-0.0.2-cp36-cp36m-manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b4c536ee0d09f8c07c5ff15540e62f695355d6621a83b23a6e5ac737f9e736e1 |
|
MD5 | 2beebb7a03925bfc61e3875f73bd0d56 |
|
BLAKE2b-256 | 9048fc94346b3bed959c6ddd31ad81360ae7a0b42055e0fd3730774f11ca332c |
Hashes for thtools-0.0.2-cp36-cp36m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 60b89c93c052822ec5a42c002c6ae8fa3059c8c1be5c0bb3236885ad2d2e7bba |
|
MD5 | ec77d099fa6b7bf5901fd0e827f2230c |
|
BLAKE2b-256 | 76284b799306f7addcbe7b791dc39248559aa530909a167cabedd1898439bbad |