{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Multi-tube design example (simple)\n", "\n", "Design a strand displacement gate. \n", "\n", "See the accompanying design specification (PDF file). See also the LaTeX spec file that you can edit to make your own design specs in a standardized format.\n", "\n", "This is a 1-step reaction. To design 1 gate, there are 2 elementary step tubes plus 1 global crosstalk tube. \n", "\n", "Target test tubes: \n", "- Reactants (Step 0)\n", "- Products (Step 1) \n", "- Global crosstalk\n", "\n", "Material: RNA \n", "Temperature: 23 C" ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "# Import Python NUPACK module\n", "from nupack import *" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [ { "data": { "text/html": [ "Domain results:\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
DomainSequence
da
CAGGUGGAAG
da*
CUUCCACCUG
db
AGGUAAGC
db*
GCUUACCU
Strand results:\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
StrandSequence
sA_toe
GCUUACCU
sX
CAGGUGGAAGAGGUAAGC
sA
GCUUACCUCUUCCACCUG
sB
CAGGUGGAAG
Objective function:\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
Objective typeValue
Weighted ensemble defect0.0171
Ensemble defect: 0.0171

On-target complex defects:\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
ComplexComplex defect (nt)Normalized complex defect
cX0.8510.0473
cB0.07080.00708
cXA0.1940.00539
cAB0.2370.00845
cA_toe0.01560.00195
Tube defects:\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
TubeTube defect (M)Normalized tube defect
reactants1.10e-080.0238
products2.65e-090.00575
crosstalk1.38e-080.0216
Complex contributions to tube defects:\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
TubeOn-target complexStructural defect (M)Concentration defect (M)Total defect (M)
reactantscX8.51e-099.76e-148.51e-09
reactantscAB2.37e-097.71e-112.44e-09
productscXA1.94e-091.25e-141.94e-09
productscB7.08e-104.80e-147.08e-10
crosstalkcX8.51e-091.77e-138.51e-09
crosstalkcAB2.37e-092.16e-142.37e-09
crosstalkcA_toe1.54e-109.36e-101.09e-09
crosstalkcB7.00e-101.17e-091.87e-09
On-target complex concentrations:\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
TubeComplexConcentration (M)Target concentration (M)
reactantscX1.00e-081.00e-08
reactantscAB1.00e-081.00e-08
productscXA1.00e-081.00e-08
productscB1.00e-081.00e-08
crosstalkcX1.00e-081.00e-08
crosstalkcAB1.00e-081.00e-08
crosstalkcA_toe9.88e-091.00e-08
crosstalkcB9.88e-091.00e-08
\n", "\n", "Significant off-target complex concentrations (≥ 1% max complex concentration in tube):\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
TubeComplexConcentration (M)
crosstalk(sA_toe+sB)1.17e-10
reactants
products
" ], "text/plain": [ "" ] }, "execution_count": 2, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# Define physical model\n", "my_model = Model(material='rna', celsius=23)\n", "\n", "# Define sequence domains\n", "da = Domain('N10', name='da')\n", "db = Domain('N8', name='db')\n", "\n", "# Define strands containing these domains\n", "sX = TargetStrand([da, db], name='sX')\n", "sA = TargetStrand([~db, ~da], name='sA')\n", "sB = TargetStrand([da], name='sB') # ~dgate is the reverse complement of dgate\n", "sA_toe = TargetStrand([~db], name='sA_toe')\n", "\n", "# Define target complexes\n", "cX = TargetComplex([sX], 'U18', name='cX')\n", "cAB = TargetComplex([sA, sB], 'U8D10+', name='cAB')\n", "cXA = TargetComplex([sX, sA], 'D18+', name='cXA')\n", "cB = TargetComplex([sB], 'U10', name='cB')\n", "cA_toe = TargetComplex([sA_toe], 'U8', name='cA_toe')\n", "\n", "# Define target test tubes \n", "reactants = TargetTube(on_targets={cX: 1e-08, cAB: 1e-08}, \n", " off_targets=SetSpec(max_size=2, exclude=[cXA]), name='reactants')\n", "products = TargetTube(on_targets={cXA: 1e-08, cB: 1e-08}, \n", " off_targets=SetSpec(max_size=2), name='products')\n", "crosstalk = TargetTube(on_targets={cX: 1e-08, cAB: 1e-08, cA_toe: 1e-08, cB:1e-8}, \n", " off_targets=SetSpec(max_size=2, exclude=[cXA, [sX, sA_toe]]), name='crosstalk')\n", "\n", "# Set a stop condition of 2%\n", "# Set seed for random number generation to get a reproducible result for this demo\n", "my_options = DesignOptions(f_stop=0.02, seed=93)\n", "\n", "# Define and run the test tube design job\n", "my_design = tube_design(tubes=[reactants, products, crosstalk], model=my_model, options=my_options)\n", "my_results = my_design.run(trials=1)[0]\n", "\n", "# Display the design results\n", "my_results" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.7.8" } }, "nbformat": 4, "nbformat_minor": 4 }