Multi-complex analysis example

Analyze a set of multiple complexes representing different states of HCR polymerization (Dirks and Pierce, Proc Natl Acad Sci USA, 2004)

Strand species:
Initiator i1
Hairpin h1
Hairpin h2

Material: DNA
Temperature: 23 C

While we illustrate analysis of a set of complexes here, we recommend performing a test tube analysis so that one does not presuppose which complexes will form in solution (see tube analysis example notebook).

In [1]:
# Import NUPACK Python module
from nupack import *

# Define physical model
my_model = Model(material='dna', celsius=23)

# Define strand species
i1 = Strand('AGTCTAGGATTCGGCGTGGGTTAA', name='i1')

# Define complexes
poly1 = Complex([i1, h1])
poly2 = Complex([i1, h1, h2])
poly3 = Complex([i1, h1, h1, h2])
poly4 = Complex([i1, h1, h2, h1, h2])

# Define complex set comprising all monomers plus additional specified complexes
my_set = ComplexSet(strands=[i1, h1, h2], complexes=SetSpec(max_size=1, include=[poly1, poly2, poly3, poly4]))

# Analyze the set of complexes
# Calculate pfunc, pairs, mfe for each complex
# Calculate equilibrium complex concentrations (default) for each tube ensemble
set_result = complex_analysis(complexes=my_set, compute=['pfunc', 'pairs', 'mfe'], model=my_model)
Complex results:
Complex Pfunc ΔG (kcal/mol) MFE (kcal/mol)
(h1) 3.8928e+20 -27.901 -27.740
(h2) 7.5022e+20 -28.287 -27.979
(i1) 6.0965e+0 -1.064 0.000
(i1+h1) 6.1982e+31 -43.081 -41.379
(i1+h1+h2) 7.8258e+62 -85.225 -83.629
(i1+h1+h1+h2) 2.2947e+94 -127.866 -126.035
(i1+h1+h2+h1+h2) 1.5846e+117 -158.814 -155.648
In [2]:
# Print MFE proxy structure(s) for each complex
print('\nMFE proxy structure(s):')
for plex, result in set_result.complexes.items():
    print('%20s: %50s     (%.2f kcal/mol)' % (, result.mfe[0].structure.rle_dotparensplus(), result.mfe[0].energy))
MFE proxy structure(s):
                (i1):                                                .24     (0.00 kcal/mol)
             (i1+h1):                              (24+)24(.2(2.4)2.).11     (-41.38 kcal/mol)
          (i1+h1+h2):                                  (24+)24(24+.24)24     (-83.63 kcal/mol)
       (i1+h1+h1+h2):                    (24+)24(24+(25.2(2.4)2.).11+)48     (-126.03 kcal/mol)
                (h1):                                         .6(18.6)18     (-27.74 kcal/mol)
                (h2):                                         (18.6)18.6     (-27.98 kcal/mol)
    (i1+h1+h2+h1+h2):    (24+)24(24+(18.6)18.3(2.+.2(23.2(2.4)2.).11+)48     (-155.65 kcal/mol)
In [3]:
# Plot the equilibrium pair probability matrix for each complex
import matplotlib.pyplot as plt

for plex, result in set_result.complexes.items():
    plt.xlabel('Base index')
    plt.ylabel('Base index')
    plt.title('Pair probabilities for complex ' +
    plt.clim(0, 1)