{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Multi-tube design example (advanced) " ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Design small conditional RNAs (scRNAs) for conditional Dicer substrate formation (Hochrein et al., J Am Chem Soc, 2013; see Figure 3). \n", "\n", "See the accompanying design specification (PDF files). 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 2-step reaction. To design one scRNA system, there are 3 elementary step tubes plus 1 global crosstalk tube. \n", "\n", "Target test tubes: \n", "- Step 0: Reactants \n", "- Step 1: Intermediates\n", "- Step 2: Products\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", " \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", "
DomainSequence
a
AUGAGG
a*
CCUCAU
b
AGAA
b*
UUCU
c
GAUGGAGC
c*
GCUCCAUC
s
AACAC
s*
GUGUU
w
CG
w*
CG
x
AGGAGGAGAUGA
x*
UCAUCUCCUCCU
y
GAGA
y*
UCUC
z
GCU
z*
AGC
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", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
StrandSequence
sC_out
CGAGGAGGAGAUGAGAGAAACAC
sC
CGAGGAGGAGAUGAGAGAAACACCCUCAUAGCUCUCUCAUCUCCUCCUCG
sC_loop
AACACCCUCAUAGC
sA_toe
GCUCCAUC
sB
AGGAGGAGAUGAGAGAGCUAUGAGGAGAA
sX
AUGAGGAGAAGAUGGAGC
sA
GCUCCAUCUUCUCCUCAUAGCUCUC
Objective function:\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
Objective typeValue
Weighted ensemble defect0.0532
Ensemble defect: 0.0532

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", " \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
C1.180.0237
XA0.7880.0183
AB1.320.0245
BC1.810.0229
A_toe0.006200.000775
B2.160.0746
X0.1540.00853
C_out0.6390.0278
C_loop0.1100.00788
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", "
TubeTube defect (M)Normalized tube defect
Step_02.67e-080.0219
Step_18.14e-080.113
Step_21.97e-080.0249
Crosstalk1.04e-070.0529
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", " \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)
Step_0C1.18e-083.88e-111.19e-08
Step_0X1.54e-099.12e-151.54e-09
Step_0AB1.32e-084.05e-111.33e-08
Step_1XA7.29e-093.23e-083.96e-08
Step_1B2.00e-082.18e-084.18e-08
Step_2BC1.80e-081.67e-091.97e-08
CrosstalkAB1.32e-082.28e-101.34e-08
CrosstalkC1.15e-081.46e-082.61e-08
CrosstalkX1.46e-098.54e-091.00e-08
CrosstalkB2.14e-083.43e-092.48e-08
CrosstalkC_out6.06e-091.19e-081.79e-08
CrosstalkC_loop1.03e-098.67e-099.70e-09
CrosstalkA_toe6.08e-111.57e-091.64e-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", " \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)
Step_0C1.00e-081.00e-08
Step_0X1.00e-081.00e-08
Step_0AB1.00e-081.00e-08
Step_1XA9.25e-091.00e-08
Step_1B9.25e-091.00e-08
Step_2BC9.98e-091.00e-08
CrosstalkAB1.00e-081.00e-08
CrosstalkC9.71e-091.00e-08
CrosstalkX9.53e-091.00e-08
CrosstalkB9.88e-091.00e-08
CrosstalkC_out9.48e-091.00e-08
CrosstalkC_loop9.38e-091.00e-08
CrosstalkA_toe9.80e-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", " \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)
Step_1AB7.51e-10
Step_1X7.51e-10
Crosstalk(sA_toe+sB)1.22e-10
Crosstalk(sC_out+sC)2.92e-10
Crosstalk(sC_loop+sC_out)1.45e-10
Crosstalk(sC_loop+sX)4.74e-10
Step_2
Step_0
" ], "text/plain": [ "" ] }, "execution_count": 2, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# Define physical model\n", "my_model = Model(material='rna', celsius=37)\n", "\n", "# Define sequence domains\n", "a = Domain('N6', name='a')\n", "c = Domain('N8', name='c')\n", "b = Domain('N4', name='b')\n", "w = Domain('N2', name='w')\n", "y = Domain('N4', name='y')\n", "x = Domain('N12', name='x')\n", "z = Domain('N3', name='z')\n", "s = Domain('N5', name='s')\n", "\n", "# Define strands containing these domains\n", "sC_out = TargetStrand([w, x, y, s], name='sC_out')\n", "sA = TargetStrand([~c, ~b, ~a, ~z, ~y], name='sA')\n", "sA_toe = TargetStrand([~c], name='sA_toe')\n", "sC = TargetStrand([w, x, y, s, ~a, ~z, ~y, ~x, ~w], name='sC')\n", "sC_loop = TargetStrand([s, ~a, ~z], name='sC_loop')\n", "sB = TargetStrand([x, y, z, a, b], name='sB')\n", "sX = TargetStrand([a, b, c], name='sX')\n", "\n", "# Define target complexes\n", "C = TargetComplex([sC], 'D2 D12 D4( U5 U6 U3 )', name='C')\n", "B = TargetComplex([sB], 'U12 U4 U3 U6 U4', name='B')\n", "C_loop = TargetComplex([sC_loop], 'U14', name='C_loop')\n", "AB = TargetComplex([sA, sB], 'U8 D4 D6 D3 D4(+ U12)', name='AB')\n", "X = TargetComplex([sX], 'U18', name='X')\n", "XA = TargetComplex([sX, sA], 'D6 D4 D8(+) U3 U4', name='XA')\n", "C_out = TargetComplex([sC_out], 'U23', name='C_out')\n", "BC = TargetComplex([sB, sC], 'D12 D4 D3 D6 (U4 + U2 U12 U4 U5) U2', name='BC')\n", "A_toe = TargetComplex([sA_toe], 'U8', name='A_toe')\n", "\n", "# Define elementary step tubes\n", "Step_0 = TargetTube(on_targets={C: 1e-08, X: 1e-08, AB: 1e-08}, \n", " off_targets=SetSpec(max_size=2, include=[[sA], BC], exclude=[XA]), name='Step_0')\n", "Step_1 = TargetTube(on_targets={XA: 1e-08, B: 1e-08}, \n", " off_targets=SetSpec(max_size=2, include=[X, AB]), name='Step_1')\n", "Step_2 = TargetTube(on_targets={BC: 1e-08}, \n", " off_targets=SetSpec(max_size=2, include=[B, C]), name='Step_2')\n", "\n", "# Define global crosstalk tube\n", "Crosstalk = TargetTube(on_targets={\n", " AB: 1e-08,\n", " C: 1e-08,\n", " X: 1e-08,\n", " B: 1e-08,\n", " C_out: 1e-08,\n", " C_loop: 1e-08,\n", " A_toe: 1e-08,\n", "}, off_targets=SetSpec(max_size=2, exclude=[XA, BC, [sX, sA_toe], [sB, sC_loop]]), name='Crosstalk')\n", "\n", "# Define hard sequence constraints\n", "\n", "# GC content constraints\n", "hard = [\n", " Similarity(d, 'S'*d.nt(), limits=(0.45, 0.55)) \n", " for d in [sC_out, sA, sC, sC_loop, sB, sX]\n", "]\n", "\n", "# Biological sequences \n", "# Note: biological sequence constraints often require a higher stop condition\n", "tpm3 = 'GAACACTATTAGCTATTTGTAGTACTCTAAAGAGGACTGCAGAACGCATCGCAGTAGTGGTGAAAAGCCGTGCGTGCGCGTGAAACATCTGATCCTCACGTTACTTCCACTCGCTCTGCGTTTGACTTGTTGGCGGGGCGTTGGTGCCTTGGACTTTTTTTTCCTCCTTCTCTTCTTCGCGGCTCGGTCCACTACGCTGCTCGAGAGGAATCTGCTTTATTCGACCACACTACTCCTAAAGTAACACATTAAAATGGCCGGATCAAACAGCATCGATGCAGTTAAGAGAAAAATCAAAGTTTTACAACAGCAAGCAGATGAGGCAGAAGAAAGAGCCGAGATTTTGCAGAGACAGGTCGAGGAGGAGAAGCGTGCCAGGGAGCAGGCTGAGGCAGAGGTGGCTTCTCTGAACAGGCGTATCCAGCTGGTTGAGGAGGAGTTGGATCGTGCTCAGGAGAGACTGGCCACAGCCCTGCAAAAGCTGGAGGAAGCCGAGAAGGCCGCAGATGAGAGCGAGAGAGGGATGAAGGTGATTGAGAACAGGGCTCTGAAGGATGAGGAGAAGATGGAGCTGCAGGAGATCCAGCTTAAGGAGGCCAA'\n", "desm = 'CATTTACACAGCGTACAAACCCAACAGGCCCAGTCATGAGCACGAAATATTCAGCCTCCGCCGAGTCGGCGTCCTCTTACCGCCGCACCTTTGGCTCAGGTTTGGGCTCCTCTATTTTCGCCGGCCACGGTTCCTCAGGTTCCTCTGGCTCCTCAAGACTGACCTCCAGAGTTTACGAGGTGACCAAGAGCTCCGCTTCTCCCCATTTTTCCAGCCACCGTGCGTCCGGCTCTTTCGGAGGTGGCTCGGTGGTCCGTTCCTACGCTGGCCTTGGTGAGAAGCTGGATTTCAATCTGGCTGATGCCATAAACCAGGACTTCCTCAACACGCGTACTAATGAGAAGGCCGAGCTCCAGCACCTCAATGACCGCTTCGCCAGCTACATCGAGAAGGTGCGCTTCCTCGAGCAGCAGAACTCTGCCCTGACGGTGGAGATTGAGCGTCTGCGGGGTCGCGAGCCCACCCGTATTGCAGAGCTGTACGAGGAGGAGATGAGAGAGCTGCGCGGACAGGTGGAGGCACTGACCAATCAGAGATCCCGTGTGGAGATCGAGAGGGACAACCTAGTCGATGACCTACAGAAACTAAAGCTCAGACTTC'\n", "\n", "# Window constraints on detection target 'a-b-c' and silencing target 'w-x-y-z'\n", "hard += [Window([a, b, c], [tpm3])] \n", "hard += [Window([w, x, y, z], [desm])] \n", "\n", "# Diversity constraint\n", "hard += [Diversity(word=4, types=2)]\n", "\n", "# Set a stop condition of 8% \n", "# Set seed for random number generation to get a reproducible result for this demo\n", "my_options = DesignOptions(f_stop=0.08, seed=93)\n", "\n", "# Define and run the test tube design job\n", "des = tube_design(tubes=[Step_0, Step_1, Step_2, Crosstalk], model=my_model, hard_constraints=hard, options=my_options)\n", "result = des.run(trials=1)[0]\n", "\n", "# Display the result\n", "result" ] } ], "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 }