{
"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",
" Domain | \n",
" Sequence | \n",
"
\n",
" \n",
" \n",
" \n",
" da | \n",
" CAGGUGGAAG | \n",
"
\n",
" \n",
" da* | \n",
" CUUCCACCUG | \n",
"
\n",
" \n",
" db | \n",
" AGGUAAGC | \n",
"
\n",
" \n",
" db* | \n",
" GCUUACCU | \n",
"
\n",
" \n",
"
Strand results:\n",
"\n",
" \n",
" \n",
" Strand | \n",
" Sequence | \n",
"
\n",
" \n",
" \n",
" \n",
" sA_toe | \n",
" GCUUACCU | \n",
"
\n",
" \n",
" sX | \n",
" CAGGUGGAAGAGGUAAGC | \n",
"
\n",
" \n",
" sA | \n",
" GCUUACCUCUUCCACCUG | \n",
"
\n",
" \n",
" sB | \n",
" CAGGUGGAAG | \n",
"
\n",
" \n",
"
Objective function:\n",
" \n",
" \n",
" Objective type | \n",
" Value | \n",
"
\n",
" \n",
" \n",
" \n",
" Weighted ensemble defect | \n",
" 0.0171 | \n",
"
\n",
" \n",
"
Ensemble defect: 0.0171
On-target complex defects:\n",
" \n",
" \n",
" Complex | \n",
" Complex defect (nt) | \n",
" Normalized complex defect | \n",
"
\n",
" \n",
" \n",
" \n",
" cX | \n",
" 0.851 | \n",
" 0.0473 | \n",
"
\n",
" \n",
" cB | \n",
" 0.0708 | \n",
" 0.00708 | \n",
"
\n",
" \n",
" cXA | \n",
" 0.194 | \n",
" 0.00539 | \n",
"
\n",
" \n",
" cAB | \n",
" 0.237 | \n",
" 0.00845 | \n",
"
\n",
" \n",
" cA_toe | \n",
" 0.0156 | \n",
" 0.00195 | \n",
"
\n",
" \n",
"
Tube defects:\n",
" \n",
" \n",
" Tube | \n",
" Tube defect (M) | \n",
" Normalized tube defect | \n",
"
\n",
" \n",
" \n",
" \n",
" reactants | \n",
" 1.10e-08 | \n",
" 0.0238 | \n",
"
\n",
" \n",
" products | \n",
" 2.65e-09 | \n",
" 0.00575 | \n",
"
\n",
" \n",
" crosstalk | \n",
" 1.38e-08 | \n",
" 0.0216 | \n",
"
\n",
" \n",
"
Complex contributions to tube defects:\n",
" \n",
" \n",
" Tube | \n",
" On-target complex | \n",
" Structural defect (M) | \n",
" Concentration defect (M) | \n",
" Total defect (M) | \n",
"
\n",
" \n",
" \n",
" \n",
" reactants | \n",
" cX | \n",
" 8.51e-09 | \n",
" 9.76e-14 | \n",
" 8.51e-09 | \n",
"
\n",
" \n",
" reactants | \n",
" cAB | \n",
" 2.37e-09 | \n",
" 7.71e-11 | \n",
" 2.44e-09 | \n",
"
\n",
" \n",
" products | \n",
" cXA | \n",
" 1.94e-09 | \n",
" 1.25e-14 | \n",
" 1.94e-09 | \n",
"
\n",
" \n",
" products | \n",
" cB | \n",
" 7.08e-10 | \n",
" 4.80e-14 | \n",
" 7.08e-10 | \n",
"
\n",
" \n",
" crosstalk | \n",
" cX | \n",
" 8.51e-09 | \n",
" 1.77e-13 | \n",
" 8.51e-09 | \n",
"
\n",
" \n",
" crosstalk | \n",
" cAB | \n",
" 2.37e-09 | \n",
" 2.16e-14 | \n",
" 2.37e-09 | \n",
"
\n",
" \n",
" crosstalk | \n",
" cA_toe | \n",
" 1.54e-10 | \n",
" 9.36e-10 | \n",
" 1.09e-09 | \n",
"
\n",
" \n",
" crosstalk | \n",
" cB | \n",
" 7.00e-10 | \n",
" 1.17e-09 | \n",
" 1.87e-09 | \n",
"
\n",
" \n",
"
On-target complex concentrations:\n",
"\n",
" \n",
" \n",
" Tube | \n",
" Complex | \n",
" Concentration (M) | \n",
" Target concentration (M) | \n",
"
\n",
" \n",
" \n",
" \n",
" reactants | \n",
" cX | \n",
" 1.00e-08 | \n",
" 1.00e-08 | \n",
"
\n",
" \n",
" reactants | \n",
" cAB | \n",
" 1.00e-08 | \n",
" 1.00e-08 | \n",
"
\n",
" \n",
" products | \n",
" cXA | \n",
" 1.00e-08 | \n",
" 1.00e-08 | \n",
"
\n",
" \n",
" products | \n",
" cB | \n",
" 1.00e-08 | \n",
" 1.00e-08 | \n",
"
\n",
" \n",
" crosstalk | \n",
" cX | \n",
" 1.00e-08 | \n",
" 1.00e-08 | \n",
"
\n",
" \n",
" crosstalk | \n",
" cAB | \n",
" 1.00e-08 | \n",
" 1.00e-08 | \n",
"
\n",
" \n",
" crosstalk | \n",
" cA_toe | \n",
" 9.88e-09 | \n",
" 1.00e-08 | \n",
"
\n",
" \n",
" crosstalk | \n",
" cB | \n",
" 9.88e-09 | \n",
" 1.00e-08 | \n",
"
\n",
" \n",
"
\n",
"\n",
"Significant off-target complex concentrations (≥ 1% max complex concentration in tube):\n",
"\n",
" \n",
" \n",
" Tube | \n",
" Complex | \n",
" Concentration (M) | \n",
"
\n",
" \n",
" \n",
" \n",
" crosstalk | \n",
" (sA_toe+sB) | \n",
" 1.17e-10 | \n",
"
\n",
" \n",
" reactants | \n",
" — | \n",
" — | \n",
"
\n",
" \n",
" products | \n",
" — | \n",
" — | \n",
"
\n",
" \n",
"
"
],
"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
}