{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "## Multi-tube design example for orthogonal systems (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 N orthogonal scRNA systems, there are 3 elementary step tubes per system plus 1 global crosstalk tube. \n", "\n", "Target test tubes: \n", "- (Step 0: Reactants) x N orthogonal systems \n", "- (Step 1: Intermediates) x N orthogonal systems\n", "- (Step 2: Products) x N orthogonal systems\n", "- Global crosstalk \n", "\n", "Material: RNA \n", "Temperature: 23 C" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [], "source": [ "# Import Python NUPACK module\n", "from nupack import *" ] }, { "cell_type": "code", "execution_count": 4, "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", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \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[0]
CACGAU
a[0]*
AUCGUG
a[1]
AACACU
a[1]*
AGUGUU
b[0]
UUAC
b[0]*
GUAA
b[1]
CCGG
b[1]*
CCGG
c[0]
GCUGCACU
c[0]*
AGUGCAGC
c[1]
UCCACAUG
c[1]*
CAUGUGGA
s[0]
AAAUC
s[0]*
GAUUU
s[1]
AGUUG
s[1]*
CAACU
w[0]
CA
w[0]*
UG
w[1]
CA
w[1]*
UG
x[0]
AUACCUCCCAGC
x[0]*
GCUGGGAGGUAU
x[1]
GAACAAUAUAAA
x[1]*
UUUAUAUUGUUC
y[0]
CCAA
y[0]*
UUGG
y[1]
AACA
y[1]*
UGUU
z[0]
UUA
z[0]*
UAA
z[1]
UAC
z[1]*
GUA
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", " \n", " \n", " \n", " \n", " \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[1]
CAGAACAAUAUAAAAACAAGUUGAGUGUUGUAUGUUUUUAUAUUGUUCUG
sA_toe[0]
AGUGCAGC
sC_out[1]
CAGAACAAUAUAAAAACAAGUUG
sC_out[0]
CAAUACCUCCCAGCCCAAAAAUC
sA[0]
AGUGCAGCGUAAAUCGUGUAAUUGG
sC_loop[1]
AGUUGAGUGUUGUA
sC[0]
CAAUACCUCCCAGCCCAAAAAUCAUCGUGUAAUUGGGCUGGGAGGUAUUG
sA[1]
CAUGUGGACCGGAGUGUUGUAUGUU
sX[1]
AACACUCCGGUCCACAUG
sA_toe[1]
CAUGUGGA
sB[1]
GAACAAUAUAAAAACAUACAACACUCCGG
sX[0]
CACGAUUUACGCUGCACU
sC_loop[0]
AAAUCAUCGUGUAA
sB[0]
AUACCUCCCAGCCCAAUUACACGAUUUAC
Objective function:\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
Objective typeValue
Weighted ensemble defect0.0499
Ensemble defect: 0.0435

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", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \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
BC[1]2.850.0361
C_loop[1]0.08010.00572
C[0]2.580.0516
A_toe[1]0.04010.00502
B[0]1.450.0500
C[1]2.110.0422
C_out[0]0.1150.00501
AB[1]1.030.0190
BC[0]1.760.0223
X[1]0.9400.0522
XA[1]1.030.0239
A_toe[0]0.04490.00561
B[1]0.6000.0207
C_loop[0]0.1980.0141
AB[0]0.6350.0118
C_out[1]2.670.116
X[0]1.940.108
XA[0]1.130.0262
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", "
TubeTube defect (M)Normalized tube defect
Step_0[0]6.81e-080.0558
Step_1[0]2.75e-080.0382
Step_2[0]4.31e-080.0545
Step_0[1]4.17e-080.0342
Step_1[1]2.84e-080.0394
Step_2[1]3.03e-080.0384
Crosstalk1.74e-070.0443
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", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \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_0[0]C[0]2.54e-088.30e-093.37e-08
Step_0[0]X[0]1.94e-083.69e-111.95e-08
Step_0[0]AB[0]6.25e-098.73e-091.50e-08
Step_1[0]XA[0]1.13e-081.08e-091.23e-08
Step_1[0]B[0]1.45e-087.28e-101.52e-08
Step_2[0]BC[0]1.70e-082.60e-084.31e-08
Step_0[1]C[1]2.11e-083.03e-102.14e-08
Step_0[1]X[1]9.38e-092.83e-109.67e-09
Step_0[1]AB[1]1.03e-083.27e-101.06e-08
Step_1[1]XA[1]1.01e-087.36e-091.75e-08
Step_1[1]B[1]5.90e-095.00e-091.09e-08
Step_2[1]BC[1]2.85e-081.83e-093.03e-08
CrosstalkAB[0]6.35e-091.64e-136.35e-09
CrosstalkC[0]2.58e-082.28e-102.60e-08
CrosstalkX[0]1.92e-081.59e-092.08e-08
CrosstalkB[0]1.45e-085.40e-101.50e-08
CrosstalkC_out[0]1.15e-099.80e-102.13e-09
CrosstalkC_loop[0]1.97e-093.73e-102.34e-09
CrosstalkA_toe[0]4.49e-101.86e-114.67e-10
CrosstalkAB[1]1.03e-083.21e-181.03e-08
CrosstalkC[1]2.11e-084.54e-102.15e-08
CrosstalkX[1]8.70e-091.35e-082.22e-08
CrosstalkB[1]6.00e-091.64e-106.16e-09
CrosstalkC_out[1]2.66e-086.24e-102.72e-08
CrosstalkC_loop[1]7.32e-101.19e-081.27e-08
CrosstalkA_toe[1]4.01e-102.21e-114.23e-10
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", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \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_0[0]C[0]9.83e-091.00e-08
Step_0[0]X[0]1.00e-081.00e-08
Step_0[0]AB[0]9.84e-091.00e-08
Step_1[0]XA[0]9.97e-091.00e-08
Step_1[0]B[0]9.97e-091.00e-08
Step_2[0]BC[0]9.67e-091.00e-08
Step_0[1]C[1]9.99e-091.00e-08
Step_0[1]X[1]9.98e-091.00e-08
Step_0[1]AB[1]9.99e-091.00e-08
Step_1[1]XA[1]9.83e-091.00e-08
Step_1[1]B[1]9.83e-091.00e-08
Step_2[1]BC[1]9.98e-091.00e-08
CrosstalkAB[0]1.00e-081.00e-08
CrosstalkC[0]1.00e-081.00e-08
CrosstalkX[0]9.91e-091.00e-08
CrosstalkB[0]9.98e-091.00e-08
CrosstalkC_out[0]9.96e-091.00e-08
CrosstalkC_loop[0]9.97e-091.00e-08
CrosstalkA_toe[0]1.00e-081.00e-08
CrosstalkAB[1]1.00e-081.00e-08
CrosstalkC[1]9.99e-091.00e-08
CrosstalkX[1]9.25e-091.00e-08
CrosstalkB[1]9.99e-091.00e-08
CrosstalkC_out[1]9.97e-091.00e-08
CrosstalkC_loop[1]9.15e-091.00e-08
CrosstalkA_toe[1]1.00e-081.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_0[0](sA[0])1.62e-10
Step_0[1]
Step_2[0]B[0]3.30e-10
Step_2[0]C[0]3.29e-10
Step_1[1]AB[1]1.71e-10
Step_1[1]X[1]1.71e-10
Crosstalk(sC_loop[1]+sX[1])7.31e-10
Step_2[1]
" ], "text/plain": [ "" ] }, "execution_count": 4, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# Define physical model\n", "my_model = Model(material='rna', celsius=37)\n", "\n", "# Set number of orthogonal systems\n", "systems = 2 \n", "\n", "# Initialize working variables\n", "crosstalk_targets = {} \n", "crosstalk_excludes = [] \n", "step_tubes = [] \n", "\n", "# Loop over orthogonal systems\n", "for i in range(systems):\n", " \n", " # Define sequence domains\n", " a = Domain('N6', name=['a', i])\n", " c = Domain('N8', name=['c', i])\n", " b = Domain('N4', name=['b', i])\n", " w = Domain('N2', name=['w', i])\n", " y = Domain('N4', name=['y', i])\n", " x = Domain('N12',name=['x', i])\n", " z = Domain('N3', name=['z', i])\n", " s = Domain('N5', name=['s', i])\n", " \n", " # Define strands containing these domains\n", " sC_out = TargetStrand([w, x, y, s], name=['sC_out', i])\n", " sA = TargetStrand([~c, ~b, ~a, ~z, ~y], name=['sA', i])\n", " sA_toe = TargetStrand([~c], name=['sA_toe', i])\n", " sC = TargetStrand([w, x, y, s, ~a, ~z, ~y, ~x, ~w], name=['sC', i])\n", " sC_loop = TargetStrand([s, ~a, ~z], name=['sC_loop', i])\n", " sB = TargetStrand([x, y, z, a, b], name=['sB', i])\n", " sX = TargetStrand([a, b, c], name=['sX', i])\n", " \n", " # Define target complexes\n", " C = TargetComplex([sC], 'D2 D12 D4( U5 U6 U3 )', name=['C', i])\n", " B = TargetComplex([sB], 'U12 U4 U3 U6 U4', name=['B', i])\n", " C_loop = TargetComplex([sC_loop], 'U14', name=['C_loop', i])\n", " AB = TargetComplex([sA, sB], 'U8 D4 D6 D3 D4(+ U12)', name=['AB', i])\n", " X = TargetComplex([sX], 'U18', name=['X', i])\n", " XA = TargetComplex([sX, sA], 'D6 D4 D8(+) U3 U4', name=['XA', i])\n", " C_out = TargetComplex([sC_out], 'U23', name=['C_out', i])\n", " BC = TargetComplex([sB, sC], 'D12 D4 D3 D6 (U4 + U2 U12 U4 U5) U2', name=['BC', i])\n", " A_toe = TargetComplex([sA_toe], 'U8', name=['A_toe', i])\n", " \n", " # Define 3 elementary step tubes for each orthogonal system\n", " Step_0 = TargetTube({C: 1e-08, X: 1e-08, AB: 1e-08}, \n", " off_targets=SetSpec(max_size=2, include=[[sA], BC], exclude=[XA]), name=['Step_0', i]) \n", " Step_1 = TargetTube({XA: 1e-08, B: 1e-08}, \n", " off_targets=SetSpec(max_size=2, include=[X, AB]), name=['Step_1', i]) \n", " Step_2 = TargetTube({BC: 1e-08}, \n", " off_targets=SetSpec(max_size=2, include=[B, C]), name=['Step_2', i])\n", " step_tubes += [Step_0, Step_1, Step_2]\n", " \n", " # Store contributions to global crosstalk tube\n", " crosstalk_targets.update({\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", " }) \n", " crosstalk_excludes += [XA, BC, [sX, sA_toe], [sB, sC_loop]]\n", " \n", "# Define 1 global crosstalk tube \n", "crosstalk_tube = TargetTube(crosstalk_targets, \n", " off_targets=SetSpec(max_size=2, exclude=crosstalk_excludes), name='Crosstalk')\n", "\n", "# Define tube set\n", "my_tubes = step_tubes + [crosstalk_tube]\n", "\n", "# Define defect weight of N for global crosstalk tube \n", "# (maintain balance between elementary step tubes and global crosstalk tube as number of \n", "# orthogonal systems increases) \n", "my_weights = Weights(my_tubes)\n", "my_weights[:,:,:,crosstalk_tube] *= systems\n", "\n", "# Set a stop condition of 5% \n", "# Set seed for random number generation to get a reproducible result for this demo\n", "my_options = DesignOptions(f_stop=0.05, seed=93)\n", "\n", "# Define and run the test tube design job\n", "my_design = tube_design(tubes=my_tubes, defect_weights=my_weights, 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 }