#!/usr/bin/env python # coding: utf-8 # # Complex design example # # Design a complex ensemble intend to predominantly adopt a 4-stranded stick figure target structure. # # Material: RNA # Temperature: 23 C # # While we illustrate complex design, we recommend performing test tube design so that it is possible to actively design against formation of off-target complexes that can compete with the desired on-target complex in solution (see tube design example notebook). Indeed, we show at the bottom of this example that a test tube analysis reveals that while the designed sequences perform well within the context of the complex ensemble (as intended by the complex design algorithm), the on-target complex is out-competed by off-target complexes in the context of a test tube ensemble. # In[1]: # Import Python NUPACK module from nupack import * # In[2]: # Define physical model my_model = Model(material='rna', celsius=23) # Define sequence domains da = Domain('N27', name='da') db = Domain('N29', name='db') dc = Domain('N25', name='dc') dd = Domain('N18', name='dd') # Define strands containing these domains sa = TargetStrand([da], name='sa') sb = TargetStrand([db], name='sb') sc = TargetStrand([dc], name='sc') sd = TargetStrand([dd], name='sd') # Define a target complex cstickfigure = TargetComplex([sa, sb, sc, sd], '..((((((((..((((((((((((...+))))))(((.........)))((((((..+.))))))))))))..((((((((..+.)))))))))))))))).', name='cstickfigure') # Set a stop condition of 1% and a seed for random number generation to get a reproducible result for this demo my_options = DesignOptions(f_stop=0.01, seed=93) # Define and run the complex design job my_design = complex_design(complexes=[cstickfigure], model=my_model, options=my_options) my_results = my_design.run(trials=1)[0] # Display the design results my_results # In[3]: # Analyze a test tube ensemble containing the designed sequences formaing all complexes of up to 4 strands # Fromn the list of concentrations below, we see that the on-target complex "cstickfigure" is dominated by # many off-target complexes. This can be avoided by activately designing against formation of the off-target # complexes using test tube design. on_target = my_results.to_analysis(cstickfigure) my_tube = Tube(strands={s: 1e-8 for s in on_target.strands}, complexes=SetSpec(max_size=4, include=[on_target]), name='Tube') tube_analysis(tubes=[my_tube], model=my_model)