<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://dna.physics.ox.ac.uk/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Rovigatti</id>
	<title>OxDNA - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://dna.physics.ox.ac.uk/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Rovigatti"/>
	<link rel="alternate" type="text/html" href="https://dna.physics.ox.ac.uk/index.php?title=Special:Contributions/Rovigatti"/>
	<updated>2026-04-24T17:36:52Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.8</generator>
	<entry>
		<id>https://dna.physics.ox.ac.uk/index.php?title=SsDNA_Kuhn_length&amp;diff=529</id>
		<title>SsDNA Kuhn length</title>
		<link rel="alternate" type="text/html" href="https://dna.physics.ox.ac.uk/index.php?title=SsDNA_Kuhn_length&amp;diff=529"/>
		<updated>2012-04-21T17:15:32Z</updated>

		<summary type="html">&lt;p&gt;Rovigatti: /* 10-base ssDNA Kuhn length */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Examples]]&lt;br /&gt;
In this example we will compute the Kuhn length strand of ssDNA with two&lt;br /&gt;
different lengths: 10 and 30 nucleotides. Given the simplicity of the system,&lt;br /&gt;
the computation required is of the order on one hour to get very accurate&lt;br /&gt;
results.&lt;br /&gt;
&lt;br /&gt;
Since ssDNA has stacked and unstacked regions, in constant evolution, the usual&lt;br /&gt;
definition of persistence length as a function of the correlation function&lt;br /&gt;
between segments is not directly applicable. Instead, we resort (see&lt;br /&gt;
[[Publications|Ref. 2]]) to a more general property, which is the Kuhn length defined as:&lt;br /&gt;
&lt;br /&gt;
k = &amp;lt;&#039;&#039;&#039;L&#039;&#039;&#039; * &#039;&#039;&#039;L&#039;&#039;&#039;&amp;gt; / &#039;&#039;L&#039;&#039;_max&lt;br /&gt;
&lt;br /&gt;
where &#039;&#039;&#039;L&#039;&#039;&#039; is the end to end vector of the strand and &#039;&#039;L&#039;&#039;_max is the&lt;br /&gt;
maximum length of the polymer. Brackets indicate thermal average. Since our ssDNA is not a rigid polymer, we use&lt;br /&gt;
as a proxy of the maximum length the average distance between nucleotides times the number of covalent&lt;br /&gt;
bonds along the backbone.&lt;br /&gt;
&lt;br /&gt;
For this simulations, we will use Brownian Dynamics with the usual values for&lt;br /&gt;
the [[Thermostat|thermostat]. We&#039;ll run the simulations at room temperature,&lt;br /&gt;
and we will use poly-A sequence with the average parametrisation of the model.&lt;br /&gt;
We use nucleotides that are all the same to avoid the formation of secondary&lt;br /&gt;
structure that could affect the end-to-end distance. With the&lt;br /&gt;
sequence-independent parametrisation, a poly-X sequence is for all intents and&lt;br /&gt;
purposes the same as any sequence that does not form secondary structure.&lt;br /&gt;
&lt;br /&gt;
The directories &amp;lt;tt&amp;gt;30B&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;10B&amp;lt;/tt&amp;gt; inside &amp;lt;tt&amp;gt;EXAMPLES/SSDNA/&amp;lt;/tt&amp;gt;&lt;br /&gt;
are ready to run the simulations of the 10-base and 30-base ssDNA,&lt;br /&gt;
respectively.&lt;br /&gt;
&lt;br /&gt;
The files relative to this example are in the directory &amp;lt;tt&amp;gt;${oxDNA}/EXAMPLES/SSDNAKUHNLENGTH/&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==10-base ssDNA Kuhn length==&lt;br /&gt;
We start by creating a sequence file to&lt;br /&gt;
generate the initial configuration. We just need to put 30 A&#039;s in a file which&lt;br /&gt;
we&#039;ll call &amp;lt;tt&amp;gt;seq.txt&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and then generate the initial configuration with &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
${OXDNA}/UTILS/generate-sa.py 20. seq.txt&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
which generates &amp;lt;tt&amp;gt;generated.top&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;generated.dat&amp;lt;/tt&amp;gt;. We can use&lt;br /&gt;
any standart input file for dynamics with the temperature set to 23C, which we&lt;br /&gt;
will call &amp;lt;tt&amp;gt;input&amp;lt;/tt&amp;gt;.  We store configurations every 50000 steps, which&lt;br /&gt;
should produce almost independent values for the end-to-end distance with the&lt;br /&gt;
standart thermostat settings. Of course this is cannot be known &#039;&#039;a priori&#039;&#039;,&lt;br /&gt;
but we know this since we have ran this simulation before.&lt;br /&gt;
&lt;br /&gt;
The end-to-end distance of ssDNA, which is the relevant parameter to monitor&lt;br /&gt;
for measuring the Kuhn length, has very large fluctuations in our model. A&lt;br /&gt;
large number of values is thus needed to have a reliable average; we store 2000&lt;br /&gt;
configurations, thus we use a total number of steps of 50 000 * 2 000 = 100&lt;br /&gt;
000 000.&lt;br /&gt;
&lt;br /&gt;
The subdirectory &amp;lt;tt&amp;gt;10B&amp;lt;/tt&amp;gt; contains a working sequence and input file ready to be run.&lt;br /&gt;
&lt;br /&gt;
The next step is to generate the trajectory by running the program on the input&lt;br /&gt;
file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
${OXDNA}/Release/oxDNA input&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Let&#039;s now discuss the analysis script &amp;lt;tt&amp;gt;sspl.py&amp;lt;/tt&amp;gt; that will extract&lt;br /&gt;
the kuhn length from the trajectory. The core of the program is as&lt;br /&gt;
follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
line = conffile.readline ()&lt;br /&gt;
line = conffile.readline ()&lt;br /&gt;
line = conffile.readline ()&lt;br /&gt;
line = conffile.readline ()&lt;br /&gt;
while line:&lt;br /&gt;
    # end 2 end&lt;br /&gt;
    r1 = [float(x) for x in line.split()[0:3]]&lt;br /&gt;
    a1 = [float(x) for x in line.split()[3:6]]&lt;br /&gt;
    line = conffile.readline ()&lt;br /&gt;
&lt;br /&gt;
    r2 = [float(x) for x in line.split()[0:3]]&lt;br /&gt;
    a2 = [float(x) for x in line.split()[3:6]]&lt;br /&gt;
    &lt;br /&gt;
    b1 = [r1[i] - 0.4 * a1[i] for i in xrange(3)]&lt;br /&gt;
    b2 = [r2[i] - 0.4 * a2[i] for i in xrange(3)]&lt;br /&gt;
    &lt;br /&gt;
    for i in xrange (nnucl - 2):&lt;br /&gt;
        line = conffile.readline()&lt;br /&gt;
&lt;br /&gt;
    rN = [float(x) for x in line.split()[0:3]]&lt;br /&gt;
    aN = [float(x) for x in line.split()[3:6]]&lt;br /&gt;
    bN = [rN[i] - 0.4 * aN[i] for i in xrange(3)]&lt;br /&gt;
    &lt;br /&gt;
    for i in xrange (4):&lt;br /&gt;
        line = conffile.readline()&lt;br /&gt;
&lt;br /&gt;
    r1N = [rN[i] - r1[i] for i in xrange(3)]&lt;br /&gt;
    r12 = [r2[i] - r1[i] for i in xrange(3)]&lt;br /&gt;
    b1N = [bN[i] - b1[i] for i in xrange(3)]&lt;br /&gt;
    b12 = [b2[i] - b1[i] for i in xrange(3)]&lt;br /&gt;
    &lt;br /&gt;
    niter += 1&lt;br /&gt;
&lt;br /&gt;
Ll0 /= float (niter)&lt;br /&gt;
L2 /= float (niter)&lt;br /&gt;
l0 /= float (niter)&lt;br /&gt;
&lt;br /&gt;
Kl = L2 / ((nnucl -1) * l0)&lt;br /&gt;
&lt;br /&gt;
print &amp;quot;Kuhn length: &amp;quot;, Kl &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We read the position of the first, second and last nucleotide in the system,&lt;br /&gt;
skipping all other lines, and compute the thermal average of &#039;&#039;&#039;L&#039;&#039;&#039; * &#039;&#039;&#039;L&#039;&#039;&#039;&lt;br /&gt;
and &#039;&#039;l_0&#039;&#039;. All distances are computed relative to backbone sites, which are&lt;br /&gt;
0.4 simulation units away from the centres along the principal axis of the&lt;br /&gt;
molecule as described in the [[Documentation#Geometry_of_the_Model|geometry]] of the model. The script produces a file called &amp;lt;tt&amp;gt;end2end.dat&amp;lt;/tt&amp;gt; with the time series of the end-to-end distance, which can be used to check for good statistics.&lt;br /&gt;
&lt;br /&gt;
At the end, we use those the averages to compute the Kuhn&lt;br /&gt;
length of the strand.&lt;br /&gt;
&lt;br /&gt;
The result coming out should be around 1.9 simulation length units, which&lt;br /&gt;
translates to 1.6nm (see [[Model_introduction#Simulation_units|units]]).&lt;br /&gt;
&lt;br /&gt;
==30-Base ssDNA==&lt;br /&gt;
All the steps above can be repeated specifying a longer sequence in the&lt;br /&gt;
&amp;lt;tt&amp;gt;seq.txt&amp;lt;/tt&amp;gt; file. &lt;br /&gt;
The subdirectory &amp;lt;tt&amp;gt;30B&amp;lt;/tt&amp;gt; contains a working sequence and input file ready to be run. Note that we expect a threefold increase in simulation time due to the system being three times as large. We can use the same python script to analyse the trajectory; the Kuhn length should come out as roughly 2.9 simulation units.&lt;/div&gt;</summary>
		<author><name>Rovigatti</name></author>
	</entry>
	<entry>
		<id>https://dna.physics.ox.ac.uk/index.php?title=Hairpin_formation&amp;diff=528</id>
		<title>Hairpin formation</title>
		<link rel="alternate" type="text/html" href="https://dna.physics.ox.ac.uk/index.php?title=Hairpin_formation&amp;diff=528"/>
		<updated>2012-04-21T17:14:39Z</updated>

		<summary type="html">&lt;p&gt;Rovigatti: /* Results */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;!--&amp;lt;div style=&amp;quot;text-align:center&amp;quot;&amp;gt;&lt;br /&gt;
http://kratos.phys.uniroma1.it/hairpin.png&lt;br /&gt;
&amp;lt;/div&amp;gt;--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Examples]]&lt;br /&gt;
== Introduction ==&lt;br /&gt;
In this example, you will simulate a single strand of length 18 and sequence &amp;lt;tt&amp;gt;GCGTTGCTTCTCCAACGC&amp;lt;/tt&amp;gt; at 334 K (~61 °C) in three different ways:&lt;br /&gt;
* with a molecular dynamics (MD) simulation of the sequence-averaged (SA) model. The input file is &amp;lt;tt&amp;gt;inputMD&amp;lt;/tt&amp;gt;.&lt;br /&gt;
* with an MD simulation of the sequence-dependent (SD) model. The input file is &amp;lt;code&amp;gt;inputMD_seq_dep&amp;lt;/code&amp;gt;.&lt;br /&gt;
* with a Monte Carlo (MC) simulation of the SA model in which two base pairs are connected by mutual traps (i.e. additional attractive interactions between two nucleotides). The input file is &amp;lt;tt&amp;gt;inputTRAP&amp;lt;/tt&amp;gt;.&lt;br /&gt;
The traps act between the pairs depicted in blue and red in the sequence G&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;C&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;G&amp;lt;/span&amp;gt;TTGCTTCTCCAA&amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;C&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;G&amp;lt;/span&amp;gt;C. The details of the interaction associated to the traps can be changed in the file &amp;lt;tt&amp;gt;hairpin_forces.dat&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
This strand, if &#039;&#039;T&#039;&#039; is sufficiently low, tends to form an hairpin with a 6-base long stem and a 6-base long loop.&lt;br /&gt;
The temperature has been chosen to be close to the melting temperature of such a hairpin in the SA version of the  model&lt;br /&gt;
&lt;br /&gt;
This document explains how to prepare the &#039;&#039;hairpin&#039;&#039; example (see [[#Preparation|Preparation]]) and how to run it ([[#Running|Running]]). Section [[#Results|Results]] contains results and plots extracted from the simulation output. In the following, &amp;lt;tt&amp;gt;$EXEC&amp;lt;/tt&amp;gt; refers to the oxDNA executable.&lt;br /&gt;
&lt;br /&gt;
== Preparation ==&lt;br /&gt;
The script &amp;lt;tt&amp;gt;run.sh&amp;lt;/tt&amp;gt; generates the input files and runs all the three simulations, one after the other. With the default input files, each simulation, lasting &amp;lt;math&amp;gt;10^8&amp;lt;/math&amp;gt; steps by default, takes approximately one hour on a modern CPU. The default &amp;lt;tt&amp;gt;run.sh&amp;lt;/tt&amp;gt; expects &amp;lt;tt&amp;gt;$EXEC&amp;lt;/tt&amp;gt; to be in the &amp;lt;tt&amp;gt;../..&amp;lt;/tt&amp;gt; directory. If this is not the case, open &amp;lt;tt&amp;gt;run.sh&amp;lt;/tt&amp;gt; and change the variable &amp;lt;tt&amp;gt;CODEDIR&amp;lt;/tt&amp;gt; accordingly.&lt;br /&gt;
&lt;br /&gt;
If you only want to generate the initial configuration, you can issue &amp;lt;tt&amp;gt;./run.sh --generate-only&amp;lt;/tt&amp;gt;. Then you can run the simulations by yourself. The generated initial configuration files are &amp;lt;tt&amp;gt;initial.top&amp;lt;/tt&amp;gt; (which contains the topology) and &amp;lt;tt&amp;gt;initial.conf&amp;lt;/tt&amp;gt; (which contains positions and orientations of the nucleotides).&lt;br /&gt;
&lt;br /&gt;
== Running ==&lt;br /&gt;
In order to run the whole example, it is sufficient to issue the command &amp;lt;tt&amp;gt;./run.sh&amp;lt;/tt&amp;gt; (or &amp;lt;tt&amp;gt;bash run.sh&amp;lt;/tt&amp;gt;). As described in [[#Preparation|Preparation]], you can generate the initial configuration and then run the simulations by hand. The three simulations, described in [[#Introduction|Introduction]], can be performed issuing &amp;lt;tt&amp;gt;$EXEC input&amp;lt;/tt&amp;gt;, where &amp;lt;tt&amp;gt;input&amp;lt;/tt&amp;gt; is a text file that specifies the simulation configuration. For this example, three files have been prepared: &amp;lt;tt&amp;gt;inputMD&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;inputMD_seq_dep&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;inputTRAP&amp;lt;/tt&amp;gt;. The table below reports all the files associated to each simulations.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
! Type &lt;br /&gt;
! Input&lt;br /&gt;
! energy file&lt;br /&gt;
! trajectory file&lt;br /&gt;
! last configuration file&lt;br /&gt;
! log file&lt;br /&gt;
|-&lt;br /&gt;
|SA model&lt;br /&gt;
|inputMD&lt;br /&gt;
|energy.dat&lt;br /&gt;
|trajectory.dat&lt;br /&gt;
|last_conf.dat&lt;br /&gt;
|log.dat&lt;br /&gt;
|-&lt;br /&gt;
|SD model&lt;br /&gt;
|inputMD_seq_dep&lt;br /&gt;
|energy_seq_dep.dat&lt;br /&gt;
|trajectory_seq_dep.dat&lt;br /&gt;
|last_conf_seq_dep.dat&lt;br /&gt;
|log_seq_dep.dat&lt;br /&gt;
|-&lt;br /&gt;
|SA model with traps&lt;br /&gt;
|inputTRAP&lt;br /&gt;
|energy_trap.dat&lt;br /&gt;
|trajectory_trap.dat&lt;br /&gt;
|last_conf_trap.dat&lt;br /&gt;
|log_trap.dat&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Results ==&lt;br /&gt;
As mentioned in the [[#Introduction|introduction]], temperature has been chosen so that the hairpin is near its melting temperature when simulated via SA model. Figure 1 shows the probability distribution histogram &amp;lt;math&amp;gt;P(U_{HB})&amp;lt;/math&amp;gt; for the hydrogen-bonding (HB) energy &amp;lt;math&amp;gt;U_{HB}&amp;lt;/math&amp;gt; of the system (in simulation units). &amp;lt;math&amp;gt;U_{HB}&amp;lt;/math&amp;gt; is stored in the fifth column of the energy file as a function of MD steps. Both the minimum in &amp;lt;math&amp;gt;P(U_{HB})&amp;lt;/math&amp;gt; and a direct inspection of the time series (inset) show that the hairpin is indeed near the melting temperature, since &amp;lt;math&amp;gt;U_{HB}&amp;lt;/math&amp;gt; oscillates between 0 (no HBs) and ~ -3.5, which corresponds to 4-5 hydrogen-bonded nucleotides. At this temperature the fraying effect is relevant, and therefore the last base-pair is not always formed. This is clearly visible in the snapshot at the beginning of this document, in which 4 base-pairs are formed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align:center&amp;quot;&amp;gt;&lt;br /&gt;
http://kratos.phys.uniroma1.it/histo_MD.png&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h5&amp;gt;Figure 1: Probability of having a hydrogen-bonding interaction energy &amp;lt;math&amp;gt;U_{HB}&amp;lt;/math&amp;gt; for the SA model. Inset: time series of the hydrogen-bonding energy.&amp;lt;/h5&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Figure 2 shows &amp;lt;math&amp;gt;P(U_{HB})&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;U_{HB}&amp;lt;/math&amp;gt; for the SD hairpin. In this case, one expects a different melting temperature. Indeed, at this temperature the hairpin is nearly always in its folded conformation and the average value of &amp;lt;math&amp;gt;U_{HB}&amp;lt;/math&amp;gt; is lower than in the SA case. Although stacking interactions play a role, the major contribution to this effect is due to the presence of four &amp;lt;tt&amp;gt;GC&amp;lt;/tt&amp;gt; only two &amp;lt;tt&amp;gt;AT&amp;lt;/tt&amp;gt; base-pairs in the stem.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align:center&amp;quot;&amp;gt;&lt;br /&gt;
http://kratos.phys.uniroma1.it/histo_MD_seq_dep.png&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h5&amp;gt;Figure 2: Same as Figure 1, but for the SD model.&amp;lt;/h5&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If mutual traps between stem base-pairs are introduced, then the equilibrium properties of the hairpin are changed and, even if the SA model is employed, the hairpin is always (after the initial equilibration) in its folded conformation. The use of mutual traps can highly decrease the simulation time required by the folding of strands into target structures (like DNA origami or DNA constructs).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align:center&amp;quot;&amp;gt;&lt;br /&gt;
http://kratos.phys.uniroma1.it/histo_TRAP.png&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h5&amp;gt;Figure 3: Same as Figure 1, but for the system with mutual traps. Time is expressed in Monte Carlo sweeps.&amp;lt;/h5&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;/div&gt;</summary>
		<author><name>Rovigatti</name></author>
	</entry>
	<entry>
		<id>https://dna.physics.ox.ac.uk/index.php?title=Hairpin_formation&amp;diff=527</id>
		<title>Hairpin formation</title>
		<link rel="alternate" type="text/html" href="https://dna.physics.ox.ac.uk/index.php?title=Hairpin_formation&amp;diff=527"/>
		<updated>2012-04-21T17:14:15Z</updated>

		<summary type="html">&lt;p&gt;Rovigatti: /* Results */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;!--&amp;lt;div style=&amp;quot;text-align:center&amp;quot;&amp;gt;&lt;br /&gt;
http://kratos.phys.uniroma1.it/hairpin.png&lt;br /&gt;
&amp;lt;/div&amp;gt;--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Examples]]&lt;br /&gt;
== Introduction ==&lt;br /&gt;
In this example, you will simulate a single strand of length 18 and sequence &amp;lt;tt&amp;gt;GCGTTGCTTCTCCAACGC&amp;lt;/tt&amp;gt; at 334 K (~61 °C) in three different ways:&lt;br /&gt;
* with a molecular dynamics (MD) simulation of the sequence-averaged (SA) model. The input file is &amp;lt;tt&amp;gt;inputMD&amp;lt;/tt&amp;gt;.&lt;br /&gt;
* with an MD simulation of the sequence-dependent (SD) model. The input file is &amp;lt;code&amp;gt;inputMD_seq_dep&amp;lt;/code&amp;gt;.&lt;br /&gt;
* with a Monte Carlo (MC) simulation of the SA model in which two base pairs are connected by mutual traps (i.e. additional attractive interactions between two nucleotides). The input file is &amp;lt;tt&amp;gt;inputTRAP&amp;lt;/tt&amp;gt;.&lt;br /&gt;
The traps act between the pairs depicted in blue and red in the sequence G&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;C&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;G&amp;lt;/span&amp;gt;TTGCTTCTCCAA&amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;C&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;G&amp;lt;/span&amp;gt;C. The details of the interaction associated to the traps can be changed in the file &amp;lt;tt&amp;gt;hairpin_forces.dat&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
This strand, if &#039;&#039;T&#039;&#039; is sufficiently low, tends to form an hairpin with a 6-base long stem and a 6-base long loop.&lt;br /&gt;
The temperature has been chosen to be close to the melting temperature of such a hairpin in the SA version of the  model&lt;br /&gt;
&lt;br /&gt;
This document explains how to prepare the &#039;&#039;hairpin&#039;&#039; example (see [[#Preparation|Preparation]]) and how to run it ([[#Running|Running]]). Section [[#Results|Results]] contains results and plots extracted from the simulation output. In the following, &amp;lt;tt&amp;gt;$EXEC&amp;lt;/tt&amp;gt; refers to the oxDNA executable.&lt;br /&gt;
&lt;br /&gt;
== Preparation ==&lt;br /&gt;
The script &amp;lt;tt&amp;gt;run.sh&amp;lt;/tt&amp;gt; generates the input files and runs all the three simulations, one after the other. With the default input files, each simulation, lasting &amp;lt;math&amp;gt;10^8&amp;lt;/math&amp;gt; steps by default, takes approximately one hour on a modern CPU. The default &amp;lt;tt&amp;gt;run.sh&amp;lt;/tt&amp;gt; expects &amp;lt;tt&amp;gt;$EXEC&amp;lt;/tt&amp;gt; to be in the &amp;lt;tt&amp;gt;../..&amp;lt;/tt&amp;gt; directory. If this is not the case, open &amp;lt;tt&amp;gt;run.sh&amp;lt;/tt&amp;gt; and change the variable &amp;lt;tt&amp;gt;CODEDIR&amp;lt;/tt&amp;gt; accordingly.&lt;br /&gt;
&lt;br /&gt;
If you only want to generate the initial configuration, you can issue &amp;lt;tt&amp;gt;./run.sh --generate-only&amp;lt;/tt&amp;gt;. Then you can run the simulations by yourself. The generated initial configuration files are &amp;lt;tt&amp;gt;initial.top&amp;lt;/tt&amp;gt; (which contains the topology) and &amp;lt;tt&amp;gt;initial.conf&amp;lt;/tt&amp;gt; (which contains positions and orientations of the nucleotides).&lt;br /&gt;
&lt;br /&gt;
== Running ==&lt;br /&gt;
In order to run the whole example, it is sufficient to issue the command &amp;lt;tt&amp;gt;./run.sh&amp;lt;/tt&amp;gt; (or &amp;lt;tt&amp;gt;bash run.sh&amp;lt;/tt&amp;gt;). As described in [[#Preparation|Preparation]], you can generate the initial configuration and then run the simulations by hand. The three simulations, described in [[#Introduction|Introduction]], can be performed issuing &amp;lt;tt&amp;gt;$EXEC input&amp;lt;/tt&amp;gt;, where &amp;lt;tt&amp;gt;input&amp;lt;/tt&amp;gt; is a text file that specifies the simulation configuration. For this example, three files have been prepared: &amp;lt;tt&amp;gt;inputMD&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;inputMD_seq_dep&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;inputTRAP&amp;lt;/tt&amp;gt;. The table below reports all the files associated to each simulations.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
! Type &lt;br /&gt;
! Input&lt;br /&gt;
! energy file&lt;br /&gt;
! trajectory file&lt;br /&gt;
! last configuration file&lt;br /&gt;
! log file&lt;br /&gt;
|-&lt;br /&gt;
|SA model&lt;br /&gt;
|inputMD&lt;br /&gt;
|energy.dat&lt;br /&gt;
|trajectory.dat&lt;br /&gt;
|last_conf.dat&lt;br /&gt;
|log.dat&lt;br /&gt;
|-&lt;br /&gt;
|SD model&lt;br /&gt;
|inputMD_seq_dep&lt;br /&gt;
|energy_seq_dep.dat&lt;br /&gt;
|trajectory_seq_dep.dat&lt;br /&gt;
|last_conf_seq_dep.dat&lt;br /&gt;
|log_seq_dep.dat&lt;br /&gt;
|-&lt;br /&gt;
|SA model with traps&lt;br /&gt;
|inputTRAP&lt;br /&gt;
|energy_trap.dat&lt;br /&gt;
|trajectory_trap.dat&lt;br /&gt;
|last_conf_trap.dat&lt;br /&gt;
|log_trap.dat&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Results ==&lt;br /&gt;
As mentioned in the [[#Introduction|Introduction]], temperature has been chosen so that the hairpin is near its melting temperature when simulated via SA model. Figure 1 shows the probability distribution histogram &amp;lt;math&amp;gt;P(U_{HB})&amp;lt;/math&amp;gt; for the hydrogen-bonding (HB) energy &amp;lt;math&amp;gt;U_{HB}&amp;lt;/math&amp;gt; of the system (in simulation units). &amp;lt;math&amp;gt;U_{HB}&amp;lt;/math&amp;gt; is stored in the fifth column of the energy file as a function of MD steps. Both the minimum in &amp;lt;math&amp;gt;P(U_{HB})&amp;lt;/math&amp;gt; and a direct inspection of the time series (inset) show that the hairpin is indeed near the melting temperature, since &amp;lt;math&amp;gt;U_{HB}&amp;lt;/math&amp;gt; oscillates between 0 (no HBs) and ~ -3.5, which corresponds to 4-5 hydrogen-bonded nucleotides. At this temperature the fraying effect is relevant, and therefore the last base-pair is not always formed. This is clearly visible in the snapshot at the beginning of this document, in which 4 base-pairs are formed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align:center&amp;quot;&amp;gt;&lt;br /&gt;
http://kratos.phys.uniroma1.it/histo_MD.png&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h5&amp;gt;Figure 1: Probability of having a hydrogen-bonding interaction energy &amp;lt;math&amp;gt;U_{HB}&amp;lt;/math&amp;gt; for the SA model. Inset: time series of the hydrogen-bonding energy.&amp;lt;/h5&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Figure 2 shows &amp;lt;math&amp;gt;P(U_{HB})&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;U_{HB}&amp;lt;/math&amp;gt; for the SD hairpin. In this case, one expects a different melting temperature. Indeed, at this temperature the hairpin is nearly always in its folded conformation and the average value of &amp;lt;math&amp;gt;U_{HB}&amp;lt;/math&amp;gt; is lower than in the SA case. Although stacking interactions play a role, the major contribution to this effect is due to the presence of four &amp;lt;tt&amp;gt;GC&amp;lt;/tt&amp;gt; only two &amp;lt;tt&amp;gt;AT&amp;lt;/tt&amp;gt; base-pairs in the stem.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align:center&amp;quot;&amp;gt;&lt;br /&gt;
http://kratos.phys.uniroma1.it/histo_MD_seq_dep.png&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h5&amp;gt;Figure 2: Same as Figure 1, but for the SD model.&amp;lt;/h5&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If mutual traps between stem base-pairs are introduced, then the equilibrium properties of the hairpin are changed and, even if the SA model is employed, the hairpin is always (after the initial equilibration) in its folded conformation. The use of mutual traps can highly decrease the simulation time required by the folding of strands into target structures (like DNA origami or DNA constructs).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align:center&amp;quot;&amp;gt;&lt;br /&gt;
http://kratos.phys.uniroma1.it/histo_TRAP.png&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h5&amp;gt;Figure 3: Same as Figure 1, but for the system with mutual traps. Time is expressed in Monte Carlo sweeps.&amp;lt;/h5&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;/div&gt;</summary>
		<author><name>Rovigatti</name></author>
	</entry>
	<entry>
		<id>https://dna.physics.ox.ac.uk/index.php?title=Hairpin_formation&amp;diff=526</id>
		<title>Hairpin formation</title>
		<link rel="alternate" type="text/html" href="https://dna.physics.ox.ac.uk/index.php?title=Hairpin_formation&amp;diff=526"/>
		<updated>2012-04-21T17:13:43Z</updated>

		<summary type="html">&lt;p&gt;Rovigatti: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;!--&amp;lt;div style=&amp;quot;text-align:center&amp;quot;&amp;gt;&lt;br /&gt;
http://kratos.phys.uniroma1.it/hairpin.png&lt;br /&gt;
&amp;lt;/div&amp;gt;--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Examples]]&lt;br /&gt;
== Introduction ==&lt;br /&gt;
In this example, you will simulate a single strand of length 18 and sequence &amp;lt;tt&amp;gt;GCGTTGCTTCTCCAACGC&amp;lt;/tt&amp;gt; at 334 K (~61 °C) in three different ways:&lt;br /&gt;
* with a molecular dynamics (MD) simulation of the sequence-averaged (SA) model. The input file is &amp;lt;tt&amp;gt;inputMD&amp;lt;/tt&amp;gt;.&lt;br /&gt;
* with an MD simulation of the sequence-dependent (SD) model. The input file is &amp;lt;code&amp;gt;inputMD_seq_dep&amp;lt;/code&amp;gt;.&lt;br /&gt;
* with a Monte Carlo (MC) simulation of the SA model in which two base pairs are connected by mutual traps (i.e. additional attractive interactions between two nucleotides). The input file is &amp;lt;tt&amp;gt;inputTRAP&amp;lt;/tt&amp;gt;.&lt;br /&gt;
The traps act between the pairs depicted in blue and red in the sequence G&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;C&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;G&amp;lt;/span&amp;gt;TTGCTTCTCCAA&amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;C&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;G&amp;lt;/span&amp;gt;C. The details of the interaction associated to the traps can be changed in the file &amp;lt;tt&amp;gt;hairpin_forces.dat&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
This strand, if &#039;&#039;T&#039;&#039; is sufficiently low, tends to form an hairpin with a 6-base long stem and a 6-base long loop.&lt;br /&gt;
The temperature has been chosen to be close to the melting temperature of such a hairpin in the SA version of the  model&lt;br /&gt;
&lt;br /&gt;
This document explains how to prepare the &#039;&#039;hairpin&#039;&#039; example (see [[#Preparation|Preparation]]) and how to run it ([[#Running|Running]]). Section [[#Results|Results]] contains results and plots extracted from the simulation output. In the following, &amp;lt;tt&amp;gt;$EXEC&amp;lt;/tt&amp;gt; refers to the oxDNA executable.&lt;br /&gt;
&lt;br /&gt;
== Preparation ==&lt;br /&gt;
The script &amp;lt;tt&amp;gt;run.sh&amp;lt;/tt&amp;gt; generates the input files and runs all the three simulations, one after the other. With the default input files, each simulation, lasting &amp;lt;math&amp;gt;10^8&amp;lt;/math&amp;gt; steps by default, takes approximately one hour on a modern CPU. The default &amp;lt;tt&amp;gt;run.sh&amp;lt;/tt&amp;gt; expects &amp;lt;tt&amp;gt;$EXEC&amp;lt;/tt&amp;gt; to be in the &amp;lt;tt&amp;gt;../..&amp;lt;/tt&amp;gt; directory. If this is not the case, open &amp;lt;tt&amp;gt;run.sh&amp;lt;/tt&amp;gt; and change the variable &amp;lt;tt&amp;gt;CODEDIR&amp;lt;/tt&amp;gt; accordingly.&lt;br /&gt;
&lt;br /&gt;
If you only want to generate the initial configuration, you can issue &amp;lt;tt&amp;gt;./run.sh --generate-only&amp;lt;/tt&amp;gt;. Then you can run the simulations by yourself. The generated initial configuration files are &amp;lt;tt&amp;gt;initial.top&amp;lt;/tt&amp;gt; (which contains the topology) and &amp;lt;tt&amp;gt;initial.conf&amp;lt;/tt&amp;gt; (which contains positions and orientations of the nucleotides).&lt;br /&gt;
&lt;br /&gt;
== Running ==&lt;br /&gt;
In order to run the whole example, it is sufficient to issue the command &amp;lt;tt&amp;gt;./run.sh&amp;lt;/tt&amp;gt; (or &amp;lt;tt&amp;gt;bash run.sh&amp;lt;/tt&amp;gt;). As described in [[#Preparation|Preparation]], you can generate the initial configuration and then run the simulations by hand. The three simulations, described in [[#Introduction|Introduction]], can be performed issuing &amp;lt;tt&amp;gt;$EXEC input&amp;lt;/tt&amp;gt;, where &amp;lt;tt&amp;gt;input&amp;lt;/tt&amp;gt; is a text file that specifies the simulation configuration. For this example, three files have been prepared: &amp;lt;tt&amp;gt;inputMD&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;inputMD_seq_dep&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;inputTRAP&amp;lt;/tt&amp;gt;. The table below reports all the files associated to each simulations.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
! Type &lt;br /&gt;
! Input&lt;br /&gt;
! energy file&lt;br /&gt;
! trajectory file&lt;br /&gt;
! last configuration file&lt;br /&gt;
! log file&lt;br /&gt;
|-&lt;br /&gt;
|SA model&lt;br /&gt;
|inputMD&lt;br /&gt;
|energy.dat&lt;br /&gt;
|trajectory.dat&lt;br /&gt;
|last_conf.dat&lt;br /&gt;
|log.dat&lt;br /&gt;
|-&lt;br /&gt;
|SD model&lt;br /&gt;
|inputMD_seq_dep&lt;br /&gt;
|energy_seq_dep.dat&lt;br /&gt;
|trajectory_seq_dep.dat&lt;br /&gt;
|last_conf_seq_dep.dat&lt;br /&gt;
|log_seq_dep.dat&lt;br /&gt;
|-&lt;br /&gt;
|SA model with traps&lt;br /&gt;
|inputTRAP&lt;br /&gt;
|energy_trap.dat&lt;br /&gt;
|trajectory_trap.dat&lt;br /&gt;
|last_conf_trap.dat&lt;br /&gt;
|log_trap.dat&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Results ==&lt;br /&gt;
As mentioned in the [[#Introduction|Introduction]], temperature has been chosen so that the hairpin is near its melting temperature when simulated via SA model. Figure 1 shows the probability distribution histogram &amp;lt;math&amp;gt;P(U_{HB})&amp;lt;/math&amp;gt; for the hydrogen-bonding (HB) energy &amp;lt;math&amp;gt;U_{HB}&amp;lt;/math&amp;gt; of the system (in simulation units. Both the minimum in &amp;lt;math&amp;gt;P(U_{HB})&amp;lt;/math&amp;gt; and a direct inspection of the time series (inset) show that the hairpin is indeed near the melting temperature, since &amp;lt;math&amp;gt;U_{HB}&amp;lt;/math&amp;gt; oscillates between 0 (no HBs) and ~ -3.5, which corresponds to 4-5 hydrogen-bonded nucleotides. At this temperature the fraying effect is relevant, and therefore the last base-pair is not always formed. This is clearly visible in the snapshot at the beginning of this document, in which 4 base-pairs are formed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align:center&amp;quot;&amp;gt;&lt;br /&gt;
http://kratos.phys.uniroma1.it/histo_MD.png&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h5&amp;gt;Figure 1: Probability of having a hydrogen-bonding interaction energy &amp;lt;math&amp;gt;U_{HB}&amp;lt;/math&amp;gt; for the SA model. Inset: time series of the hydrogen-bonding energy.&amp;lt;/h5&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Figure 2 shows &amp;lt;math&amp;gt;P(U_{HB})&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;U_{HB}&amp;lt;/math&amp;gt; for the SD hairpin. In this case, one expects a different melting temperature. Indeed, at this temperature the hairpin is nearly always in its folded conformation and the average value of &amp;lt;math&amp;gt;U_{HB}&amp;lt;/math&amp;gt; is lower than in the SA case. Although stacking interactions play a role, the major contribution to this effect is due to the presence of four &amp;lt;tt&amp;gt;GC&amp;lt;/tt&amp;gt; only two &amp;lt;tt&amp;gt;AT&amp;lt;/tt&amp;gt; base-pairs in the stem.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align:center&amp;quot;&amp;gt;&lt;br /&gt;
http://kratos.phys.uniroma1.it/histo_MD_seq_dep.png&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h5&amp;gt;Figure 2: Same as Figure 1, but for the SD model.&amp;lt;/h5&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If mutual traps between stem base-pairs are introduced, then the equilibrium properties of the hairpin are changed and, even if the SA model is employed, the hairpin is always (after the initial equilibration) in its folded conformation. The use of mutual traps can highly decrease the simulation time required by the folding of strands into target structures (like DNA origami or DNA constructs).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align:center&amp;quot;&amp;gt;&lt;br /&gt;
http://kratos.phys.uniroma1.it/histo_TRAP.png&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h5&amp;gt;Figure 3: Same as Figure 1, but for the system with mutual traps. Time is expressed in Monte Carlo sweeps.&amp;lt;/h5&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;/div&gt;</summary>
		<author><name>Rovigatti</name></author>
	</entry>
	<entry>
		<id>https://dna.physics.ox.ac.uk/index.php?title=DsDNA_persistence_length&amp;diff=525</id>
		<title>DsDNA persistence length</title>
		<link rel="alternate" type="text/html" href="https://dna.physics.ox.ac.uk/index.php?title=DsDNA_persistence_length&amp;diff=525"/>
		<updated>2012-04-21T17:08:46Z</updated>

		<summary type="html">&lt;p&gt;Rovigatti: /* Persistence length of a double-stranded DNA */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Examples]]&lt;br /&gt;
== Persistence length of a double-stranded DNA ==&lt;br /&gt;
&lt;br /&gt;
The example shows how to calculate a persistence length of a double stranded DNA molecule. &lt;br /&gt;
dsDNA persistence length. The persistence length in this example is calculated using the following formula (see [http://jcp.aip.org/resource/1/jcpsa6/v134/i8/p085101_s1?bypassSSO=1] for details):&lt;br /&gt;
&lt;br /&gt;
http://www-thphys.physics.ox.ac.uk/people/PetrSulc/images/eqn.png&lt;br /&gt;
&lt;br /&gt;
In the &amp;lt;tt&amp;gt; EXAMPLES/PERSISTENCE_LENGTH&amp;lt;/tt&amp;gt; directory, you will find a setup for calculating the persistence length of a 202 base pairs long dsDNA. &lt;br /&gt;
Note that for calculating a persistence length of a dsDNA, one needs a large number of decorrelated states. To obtain the states (which will be saved into a trajectory file), run the simulation program using the prepared input_persistence file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;oxDNA input_persistence&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The program will run a molecular dynamics simulation at 23 °C and record the individual configurations. By default, they are saved in the &amp;lt;tt&amp;gt;trajectory.dat&amp;lt;/tt&amp;gt; file. To analyze the data, use the python script &amp;lt;tt&amp;gt;dspl.py&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;dspl.py trajectory.dat init.top 10 50&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This program will produce a table of correlations between helical vectors, http://www-thphys.physics.ox.ac.uk/people/PetrSulc/images/eqn2.png.&lt;br /&gt;
&lt;br /&gt;
The program &amp;lt;tt&amp;gt;dspl.py&amp;lt;/tt&amp;gt; requires &amp;lt;tt&amp;gt;base.py&amp;lt;/tt&amp;gt; in the UTILS directory to be present and to have UTILS directory set in your PYTHONPATH environment variable. The program calculates the local helical axis vector (n_k) as a unit vector pointing from the midpoint of hydrogen bonding sites of k-th base pair to the midpoint between (k+1)-th base pair. &lt;br /&gt;
The init.top file contains topology of the 202 base pairs long strand (included in the &amp;lt;tt&amp;gt; EXAMPLES/PERSISTENCE_LENGTH&amp;lt;/tt&amp;gt;). In the example above, the program starts at the 10-th base pair and calculates correlations of n_10 with n_11, n_12, etc. up to n_60. It then prints out the correlations (one per line). Using an exponential fit to these data, one can find the persistence length, as illustrated in the following picture:&lt;br /&gt;
&lt;br /&gt;
http://www-thphys.physics.ox.ac.uk/people/PetrSulc/images/ds.png&lt;br /&gt;
&lt;br /&gt;
The exponential fit shows, in this particular example, a persistence length of 124.8 base pairs.&lt;/div&gt;</summary>
		<author><name>Rovigatti</name></author>
	</entry>
	<entry>
		<id>https://dna.physics.ox.ac.uk/index.php?title=DsDNA_persistence_length&amp;diff=524</id>
		<title>DsDNA persistence length</title>
		<link rel="alternate" type="text/html" href="https://dna.physics.ox.ac.uk/index.php?title=DsDNA_persistence_length&amp;diff=524"/>
		<updated>2012-04-21T17:07:47Z</updated>

		<summary type="html">&lt;p&gt;Rovigatti: /* Persistence length of a double-stranded DNA */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Examples]]&lt;br /&gt;
== Persistence length of a double-stranded DNA ==&lt;br /&gt;
&lt;br /&gt;
The example shows how to calculate a persistence length of a double stranded DNA molecule. &lt;br /&gt;
dsDNA persistence length. The persistence length in this example is calculated using the following formula (see [http://jcp.aip.org/resource/1/jcpsa6/v134/i8/p085101_s1?bypassSSO=1] for details):&lt;br /&gt;
&lt;br /&gt;
http://www-thphys.physics.ox.ac.uk/people/PetrSulc/images/eqn.png&lt;br /&gt;
&lt;br /&gt;
In the &amp;lt;tt&amp;gt; EXAMPLES/PERSISTENCE_LENGTH&amp;lt;/tt&amp;gt; directory, you will find a setup for calculating the persistence length of a 202 base pairs long dsDNA. &lt;br /&gt;
Note that for calculating a persistence length of a dsDNA, one needs a large number of decorrelated states. To obtain the states (which will be saved into a trajectory file), run the simulation program using the prepared input_persistence file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;oxDNA input_persistence&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The program will run a molecular dynamics simulation at 23 °C and record the individual configurations. They are saved in trajectory.dat file. To analyze the data, use the python script dspl.py:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;dspl.py trajectory.dat init.top 10 50&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This program will produce a table of correlations between helical vectors, http://www-thphys.physics.ox.ac.uk/people/PetrSulc/images/eqn2.png.&lt;br /&gt;
&lt;br /&gt;
The program &amp;lt;tt&amp;gt;dspl.py&amp;lt;/tt&amp;gt; requires &amp;lt;tt&amp;gt;base.py&amp;lt;/tt&amp;gt; in the UTILS directory to be present and to have UTILS directory set in your PYTHONPATH environment variable. The program calculates the local helical axis vector (n_k) as a unit vector pointing from the midpoint of hydrogen bonding sites of k-th base pair to the midpoint between (k+1)-th base pair. &lt;br /&gt;
The init.top file contains topology of the 202 base pairs long strand (included in the &amp;lt;tt&amp;gt; EXAMPLES/PERSISTENCE_LENGTH&amp;lt;/tt&amp;gt;). In the example above, the program starts at the 10-th base pair and calculates correlations of n_10 with n_11, n_12, etc. up to n_60. It then prints out the correlations (one per line). Using an exponential fit to these data, one can find the persistence length, as illustrated in the following picture:&lt;br /&gt;
&lt;br /&gt;
http://www-thphys.physics.ox.ac.uk/people/PetrSulc/images/ds.png&lt;br /&gt;
&lt;br /&gt;
The exponential fit shows, in this particular example, a persistence length of 124.8 base pairs.&lt;/div&gt;</summary>
		<author><name>Rovigatti</name></author>
	</entry>
	<entry>
		<id>https://dna.physics.ox.ac.uk/index.php?title=DsDNA_persistence_length&amp;diff=523</id>
		<title>DsDNA persistence length</title>
		<link rel="alternate" type="text/html" href="https://dna.physics.ox.ac.uk/index.php?title=DsDNA_persistence_length&amp;diff=523"/>
		<updated>2012-04-21T17:06:59Z</updated>

		<summary type="html">&lt;p&gt;Rovigatti: /* Persistence length of a double-stranded DNA */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Examples]]&lt;br /&gt;
== Persistence length of a double-stranded DNA ==&lt;br /&gt;
&lt;br /&gt;
The example shows how to calculate a persistence length of a double stranded DNA molecule. &lt;br /&gt;
dsDNA persistence length. The persistence length in this example is calculated using the following formula (see [http://jcp.aip.org/resource/1/jcpsa6/v134/i8/p085101_s1?bypassSSO=1] for details):&lt;br /&gt;
&lt;br /&gt;
http://www-thphys.physics.ox.ac.uk/people/PetrSulc/images/eqn.png&lt;br /&gt;
&lt;br /&gt;
In the &amp;lt;tt&amp;gt; EXAMPLES/PERSISTENCE_LENGTH &amp;lt;/tt&amp;gt; directory, you will find a setup for calculating the persistence length of a 202 base pairs long dsDNA. &lt;br /&gt;
Note that for calculating a persistence length of a dsDNA, one needs a large number of decorrelated states. To obtain the states (which will be saved into a trajectory file), run the simulation program using the prepared input_persistence file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;oxDNA input_persistence&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The program will run a molecular dynamics simulation at 23 °C and record the individual configurations. They are saved in trajectory.dat file. To analyze the data, use the python script dspl.py:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;dspl.py trajectory.dat init.top 10 50&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This program will produce a table of correlations between helical vectors, http://www-thphys.physics.ox.ac.uk/people/PetrSulc/images/eqn2.png.&lt;br /&gt;
&lt;br /&gt;
The program dspl.py requires base.py in the UTILS directory to be present and to have UTILS directory set in your PYTHONPATH environment variable. The program calculates the local helical axis vector (n_k) as a unit vector pointing from the midpoint of hydrogen bonding sites of k-th base pair to the midpoint between (k+1)-th base pair. &lt;br /&gt;
The init.top file contains topology of the 202 base pairs long strand (included in the &amp;lt;tt&amp;gt; EXAMPLES/PERSISTENCE_LENGTH &amp;lt;/tt&amp;gt;). In the example above, the program starts at the 10-th base pair and calculates correlations of n_10 with n_11, n_12, etc. up to n_60. It then prints out the correlations (one per line). Using an exponential fit to these data, one can find the persistence length, as illustrated in the following picture:&lt;br /&gt;
&lt;br /&gt;
http://www-thphys.physics.ox.ac.uk/people/PetrSulc/images/ds.png&lt;br /&gt;
&lt;br /&gt;
The exponential fit shows, in this particular example, a persistence length of 124.8 base pairs.&lt;/div&gt;</summary>
		<author><name>Rovigatti</name></author>
	</entry>
	<entry>
		<id>https://dna.physics.ox.ac.uk/index.php?title=Thermostat&amp;diff=522</id>
		<title>Thermostat</title>
		<link rel="alternate" type="text/html" href="https://dna.physics.ox.ac.uk/index.php?title=Thermostat&amp;diff=522"/>
		<updated>2012-04-20T09:43:45Z</updated>

		<summary type="html">&lt;p&gt;Rovigatti: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The best thermostat implemented in the simulation code (&#039;&#039;john&#039;&#039; thermostat) is a simple thermostat&lt;br /&gt;
that emulates Brownian dynamics. The system is evolved integrating Newton&#039;s&lt;br /&gt;
equations of motion (&#039;NVE&#039; ensemble) for a given (small) number of steps.&lt;br /&gt;
Then the velocity and momentum of each particle are refreshed, with a given&lt;br /&gt;
fixed probability. The new velocities and momenta are chosen according to&lt;br /&gt;
the Maxwell distribution of the temperature at which the simulation is ran.&lt;br /&gt;
This approximates a Brownian dynamics on time scales much longer than the&lt;br /&gt;
refresh interval.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;dt&#039;&#039;&#039; time steps of the integration&lt;br /&gt;
* &#039;&#039;&#039;newtonian steps&#039;&#039;&#039; number of steps between refresh attempts&lt;br /&gt;
* &#039;&#039;&#039;pt&#039;&#039;&#039; the probability with which each particle gets its velocity and momentum refreshed at each attempt.&lt;br /&gt;
* &#039;&#039;&#039;diff_coeff&#039;&#039;&#039; the overall monomer diffusion coefficient resulting from the thermostat. The code internally sets &amp;lt;tt&amp;gt;pt&amp;lt;/tt&amp;gt; to get this value. Specifying &amp;lt;tt&amp;gt;pt&amp;lt;/tt&amp;gt; will override this, regardless which comes first in the input file.&lt;br /&gt;
&lt;br /&gt;
The algorithm works as follows: the system is evolved for a number of steps equal to &amp;lt;tt&amp;gt;newtonian_steps&amp;lt;/tt&amp;gt; according to Newton&#039;s equations of motion. Than for each particle a random number is extracted; if it is larger than the value for &amp;lt;tt&amp;gt;pt&amp;lt;/tt&amp;gt; (either set explicitly or derived &lt;br /&gt;
from &amp;lt;tt&amp;gt;diff_coeff&amp;lt;/tt&amp;gt;) the particle is left untouched. If the random number extracted is lower than the value of &amp;lt;tt&amp;gt;pt&amp;lt;/tt&amp;gt;, each of the components of the the velocity and angular momentum of the particle are refreshed according to &lt;br /&gt;
the Maxwell distribution dictated by the value of the temperature.&lt;br /&gt;
&lt;br /&gt;
A completely Browninan dynamics (on the time scale set by &amp;lt;tt&amp;gt;dt&amp;lt;/tt&amp;gt;) can be obtained setting &amp;lt;tt&amp;gt;pt = 1&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;newtonian_steps = 0&amp;lt;/tt&amp;gt;. Of course, this makes little sense.&lt;br /&gt;
&lt;br /&gt;
Increasing the value of &amp;lt;tt&amp;gt;pt&amp;lt;/tt&amp;gt; makes the dynamics more dumped, so that overall diffusion is slower but local motion is somewhat better explored. We found that a good thermostat setting to study diffusion-limited events is to set &amp;lt;tt&amp;gt;diff_coeff = 2.5&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;newtonian_steps = 103&amp;lt;/tt&amp;gt;. If one is not limited by diffusion, internal relaxation can be speeded up by lowering the value of &amp;lt;tt&amp;gt;diff_coeff&amp;lt;/tt&amp;gt; by a factor 2 or 4.&lt;/div&gt;</summary>
		<author><name>Rovigatti</name></author>
	</entry>
	<entry>
		<id>https://dna.physics.ox.ac.uk/index.php?title=Thermostat&amp;diff=521</id>
		<title>Thermostat</title>
		<link rel="alternate" type="text/html" href="https://dna.physics.ox.ac.uk/index.php?title=Thermostat&amp;diff=521"/>
		<updated>2012-04-20T09:38:42Z</updated>

		<summary type="html">&lt;p&gt;Rovigatti: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The thermostat implemented in the simulation code is a simple thermostat&lt;br /&gt;
that emulates Brownian dynamics. The system is evolved integrating Newton&#039;s&lt;br /&gt;
equations of motion (&#039;NVE&#039; ensemble) for a given (small) number of steps.&lt;br /&gt;
Then the velocity and momentum of each particle are refreshed, with a given&lt;br /&gt;
fixed probability. The new velocities and momenta are chosen according to&lt;br /&gt;
the Maxwell distribution of the temperature at which the simulation is ran.&lt;br /&gt;
This approximates a Brownian dynamics on time scales much longer than the&lt;br /&gt;
refresh interval.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;dt&#039;&#039;&#039; time steps of the integration&lt;br /&gt;
* &#039;&#039;&#039;newtonian steps&#039;&#039;&#039; number of steps between refresh attempts&lt;br /&gt;
* &#039;&#039;&#039;pt&#039;&#039;&#039; the probability with which each particle gets its velocity and momentum refreshed at each attempt.&lt;br /&gt;
* &#039;&#039;&#039;diff_coeff&#039;&#039;&#039; the overall monomer diffusion coefficient resulting from the thermostat. The code internally sets &amp;lt;tt&amp;gt;pt&amp;lt;/tt&amp;gt; to get this value. Specifying &amp;lt;tt&amp;gt;pt&amp;lt;/tt&amp;gt; will override this, regardless which comes first in the input file.&lt;br /&gt;
&lt;br /&gt;
The algorithm works as follows: the system is evolved for a number of steps equal to &amp;lt;tt&amp;gt;newtonian_steps&amp;lt;/tt&amp;gt; according to Newton&#039;s equations of motion. Than for each particle a random number is extracted; if it is larger than the value for &amp;lt;tt&amp;gt;pt&amp;lt;/tt&amp;gt; (either set explicitly or derived &lt;br /&gt;
from &amp;lt;tt&amp;gt;diff_coeff&amp;lt;/tt&amp;gt;) the particle is left untouched. If the random number extracted is lower than the value of &amp;lt;tt&amp;gt;pt&amp;lt;/tt&amp;gt;, each of the components of the the velocity and angular momentum of the particle are refreshed according to &lt;br /&gt;
the Maxwell distribution dictated by the value of the temperature.&lt;br /&gt;
&lt;br /&gt;
A completely Browninan dynamics (on the time scale set by &amp;lt;tt&amp;gt;dt&amp;lt;/tt&amp;gt;) can be obtained setting &amp;lt;tt&amp;gt;pt = 1&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;newtonian_steps = 0&amp;lt;/tt&amp;gt;. Of course, this makes little sense.&lt;br /&gt;
&lt;br /&gt;
Increasing the value of &amp;lt;tt&amp;gt;pt&amp;lt;/tt&amp;gt; makes the dynamics more dumped, so that overall diffusion is slower but local motion is somewhat better explored. We found that a good thermostat setting to study diffusion-limited events is to set &amp;lt;tt&amp;gt;diff_coeff = 2.5&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;newtonian_steps = 103&amp;lt;/tt&amp;gt;. If one is not limited by diffusion, internal relaxation can be speeded up by lowering the value of &amp;lt;tt&amp;gt;diff_coeff&amp;lt;/tt&amp;gt; by a factor 2 or 4.&lt;/div&gt;</summary>
		<author><name>Rovigatti</name></author>
	</entry>
	<entry>
		<id>https://dna.physics.ox.ac.uk/index.php?title=Documentation&amp;diff=520</id>
		<title>Documentation</title>
		<link rel="alternate" type="text/html" href="https://dna.physics.ox.ac.uk/index.php?title=Documentation&amp;diff=520"/>
		<updated>2012-04-20T09:35:49Z</updated>

		<summary type="html">&lt;p&gt;Rovigatti: /* Geometry of the Model */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Compile options==&lt;br /&gt;
&lt;br /&gt;
Compiling oxDNA requires that you change the first rows in the makefile to match your machine configuration. The following parameters can be passed to make:&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;dbg=1&#039;&#039;&#039; oxDNA will be compiled with debug flags (both for nvcc and gcc). The resulting executable will be put in the Debug directory.&lt;br /&gt;
*&#039;&#039;&#039;g=1&#039;&#039;&#039; oxDNA will be compiled with both debug and optimization flags. The resulting executable will be put in the Release directory.&lt;br /&gt;
*&#039;&#039;&#039;intel=1&#039;&#039;&#039; oxDNA will be compiled using the Intel icpc compiler. The resulting executable will be named oxDNA_intel.&lt;br /&gt;
&lt;br /&gt;
==Usage==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;oxDNA input_file&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The input file contains all the relevant information for the program to run, such as what initial configuration to use, the topology of the system, how often to print the energies to a file, etc. Please make sure you read the [[Thermostat|thermostat]] page if you use molecular dynamics.&lt;br /&gt;
&lt;br /&gt;
==Input file==&lt;br /&gt;
&lt;br /&gt;
As always in UNIX environments, everything is case sensitive.&lt;br /&gt;
The options are in the form key = value. There can be arbitrary spaces before and after both key and value. Line with a leading # will be treated as comments.&lt;br /&gt;
In this part | (pipe) is the separator between the different values that can be used to specify a value for the key.&lt;br /&gt;
Keys between [ and ] are optional, the value after the equal sign is the default value.&lt;br /&gt;
&lt;br /&gt;
===Generic options===&lt;br /&gt;
The options listed here define the generic behavior of the entire program.&lt;br /&gt;
;[sim_type=MD]: MD|MC&lt;br /&gt;
:MD = Molecular Dynamics, MC = Monte Carlo&lt;br /&gt;
;backend: CPU&lt;br /&gt;
;backend_precision: float|double&lt;br /&gt;
;[debug=0]: 0|1&lt;br /&gt;
: 1 if you want verbose logs, 0 otherwise.&lt;br /&gt;
&lt;br /&gt;
===Simulation options===&lt;br /&gt;
	The options listed here specify the behaviour of the simulation.&lt;br /&gt;
&lt;br /&gt;
;steps: number of steps to be performed.&lt;br /&gt;
		&lt;br /&gt;
;[restart_step_counter=0]: 0|1&lt;br /&gt;
:0 means that the step counter will start from the value read in the configuration file; if 1, the step counter will be reset to 0. The total duration of the simulation is unchanged.&lt;br /&gt;
			&lt;br /&gt;
;[seed=time(NULL)]: seed for the random number generator. On Unix systems, it will use by default a number from /dev/urandom + time(NULL)&lt;br /&gt;
		&lt;br /&gt;
;T: temperature of the simulation. It can be expressed in simulation units or kelvin (append a k or K after the value) or celsius (append a c or C after the value).&lt;br /&gt;
:Examples:&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
! Value&lt;br /&gt;
! Simulation Units&lt;br /&gt;
|-&lt;br /&gt;
| 0.1&lt;br /&gt;
| 0.1&lt;br /&gt;
|-&lt;br /&gt;
| 300 K&lt;br /&gt;
| 0.1&lt;br /&gt;
|-&lt;br /&gt;
| 300k&lt;br /&gt;
| 0.1&lt;br /&gt;
|-&lt;br /&gt;
| 26.85c&lt;br /&gt;
| 0.1&lt;br /&gt;
|-&lt;br /&gt;
| 26.85 C &lt;br /&gt;
| 0.1&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
		&lt;br /&gt;
;verlet_skin: if a particle moves more than verlet_skin then the lists will be updated. Its name is somewhat misleading: the actual verlet skin is 2*verlet_skin.&lt;br /&gt;
	&lt;br /&gt;
;[use_average_seq=1]: 0|1&lt;br /&gt;
: specifies whether to use the default hard-coded average parameters for base-pairing and stacking interaction strengths or not. If sequence dependence is to be used, set this to 0 and specify seq_dep_file.&lt;br /&gt;
	&lt;br /&gt;
;[seq_dep_file]: specifies the file from which the sequence dependent parameters should be read. Mandatory if use_average_seq=no, ignored otherwise. A sample file is provided (sequence_dependent_parameters.txt).&lt;br /&gt;
&lt;br /&gt;
;[external_forces=0]: 0|1&lt;br /&gt;
: specifies whether there are external forces acting on the nucleotides or not. If it is set to 1, then a file which specifies the external forces&#039; configuration has to be provided (see external_forces_file).&lt;br /&gt;
&lt;br /&gt;
;[external_forces_file]: specifies the file containing all the external forces&#039; configurations. Currently there are six supported force types (see EXAMPLES/TRAPS for some examples):&lt;br /&gt;
:*string&lt;br /&gt;
:*twist&lt;br /&gt;
:*trap&lt;br /&gt;
:*repulsion_plane&lt;br /&gt;
:*repulsion_plane_moving&lt;br /&gt;
:*mutual_trap&lt;br /&gt;
	&lt;br /&gt;
====Molecular dynamics simulations options====&lt;br /&gt;
&lt;br /&gt;
;dt: time step of the integration.&lt;br /&gt;
&lt;br /&gt;
;thermostat: no|refresh|john &lt;br /&gt;
:no means no thermostat will be used. refresh will refresh all the particle&#039;s velocities from a maxwellian every newtonian_steps steps. john is an Anderson-like thermostat (see pt). Make sure you read [[Thermostat|thermostat]].&lt;br /&gt;
&lt;br /&gt;
;newtonian_steps: required if thermostat != no&lt;br /&gt;
:number of steps after which a procedure of thermalization will be performed.&lt;br /&gt;
			&lt;br /&gt;
;pt: used if thermostat == john. It&#039;s the probability that a particle&#039;s velocity will be refreshed during a thermalization procedure.&lt;br /&gt;
		&lt;br /&gt;
;diff_coeff: required if pt is not specified&lt;br /&gt;
:used internally to automatically compute the pt that would be needed if we wanted such a self diffusion coefficient. Not used if pt is set.&lt;br /&gt;
&lt;br /&gt;
====Monte Carlo simulations options====&lt;br /&gt;
	&lt;br /&gt;
;[check_energy_every=10]: this number times print_energy_every gives the number of steps after which the energy will be computed from scratch and checked against the actual value computed adding energy differences.&lt;br /&gt;
		&lt;br /&gt;
;[check_energy_threshold=1e-4]:	if abs((old_energy - new_energy)/old_energy) &amp;gt; check_energy_threshold then the program will die and warn the user.&lt;br /&gt;
	&lt;br /&gt;
;ensemble: NVT&lt;br /&gt;
:ensemble of the simulation. More ensembles could be added in future versions.&lt;br /&gt;
	&lt;br /&gt;
;delta_translation: maximum displacement (per dimension) for translational moves in simulation units.&lt;br /&gt;
	&lt;br /&gt;
;delta_translation: maximum displacement for rotational moves in simulation units.&lt;br /&gt;
&lt;br /&gt;
===Input/output===&lt;br /&gt;
The options listed here are used to manage the I/O (read and write configurations, energies and so on)&lt;br /&gt;
	&lt;br /&gt;
;conf_file: initial configuration file. &lt;br /&gt;
		&lt;br /&gt;
;topology: file containing the system&#039;s topology.&lt;br /&gt;
		&lt;br /&gt;
;trajectory_file: the main output of the program. All the configurations will be appended to this file as they are printed.&lt;br /&gt;
		&lt;br /&gt;
;[confs_to_skip=0]: valid only if conf_file is a trajectory. Skip the first confs_to_skip configurations and then load in memory the (confs_to_skip+1)th.&lt;br /&gt;
		&lt;br /&gt;
;[lastconf_file=last_conf.dat]: this is the file where the last configuration is saved (when the program finishes or is killed). Set to last_conf.dat by default&lt;br /&gt;
&lt;br /&gt;
;[refresh_vel=0]: 0|1&lt;br /&gt;
:if 1 the initial velocities will be refreshed from a maxwellian.&lt;br /&gt;
	&lt;br /&gt;
;energy_file: energy output file.&lt;br /&gt;
		&lt;br /&gt;
;[print_energy_every=1000]: this will make the program print the energies every print_energy_every steps.&lt;br /&gt;
		&lt;br /&gt;
;[no_stdout_energy=0]: 0|1&lt;br /&gt;
:if 1 the energy will be printed just to the energy_file.&lt;br /&gt;
		&lt;br /&gt;
;[time_scale=linear]: linear|log_lin&lt;br /&gt;
:using linear configurations will be saved every print_conf_interval.&lt;br /&gt;
:using log_lin configurations will be saved logarithmically for print_conf_ppc times. After that the logarithmic sequence will restart.&lt;br /&gt;
	&lt;br /&gt;
;print_conf_interval: linear interval if time_scale == linear. First step of the logarithmic scale if time_scale == log_lin.&lt;br /&gt;
		&lt;br /&gt;
;print_conf_ppc: used if time_scale == log_lin&lt;br /&gt;
:points per logarithmic cycle.&lt;br /&gt;
		&lt;br /&gt;
;[print_reduced_conf_every=0]: every print_reduced_conf_every steps the program will print out the reduced configurations (i.e. confs containing only the centers of mass of strands).&lt;br /&gt;
&lt;br /&gt;
;reduced_conf_output_dir: used if print_reduced_conf_every &amp;gt; 0&lt;br /&gt;
:output directory for reduced_conf files.&lt;br /&gt;
		&lt;br /&gt;
;[log_file=stderr]: file where generic and debug informations will be logged. If not specified then stderr will be used.&lt;br /&gt;
	&lt;br /&gt;
;[print_timings=0]: 0|1&lt;br /&gt;
:if 1 the MD step timing have be printed to a file.&lt;br /&gt;
			&lt;br /&gt;
;timings_filename: used if print_timings == 1&lt;br /&gt;
:output file where the MD step timing will be appended to.&lt;br /&gt;
&lt;br /&gt;
==Output files==&lt;br /&gt;
*The log file contains all relevant informations about the simulation (specified options, activated external forces, warnings about misconfiguratios, critical errors, etc.). If the log file is omitted, all these informations will be displayed on the standard output.&lt;br /&gt;
&lt;br /&gt;
*The energy file layout for MD simulations is&lt;br /&gt;
&lt;br /&gt;
:{|&lt;br /&gt;
| time&lt;br /&gt;
| potential energy&lt;br /&gt;
| kinetic energy&lt;br /&gt;
| total energy&lt;br /&gt;
| hydrogen bonding energy&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
:while for MC simulations is&lt;br /&gt;
&lt;br /&gt;
:{|&lt;br /&gt;
| time&lt;br /&gt;
| potential energy&lt;br /&gt;
| hydrogen bonding energy&lt;br /&gt;
| acceptance ratio for translational moves&lt;br /&gt;
| acceptance ratio for rotational moves&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
:Mind that potential, kinetic and total energies are divided by the number of particles whereas the hydrogen bonding energy is not.&lt;br /&gt;
&lt;br /&gt;
*Configurations are saved in the trajectory file.&lt;br /&gt;
&lt;br /&gt;
==Configuration and topology files==&lt;br /&gt;
The current state of a system, as by oxDNA, is described by two files: a configuration file and a topology file. The configuration file contains all the general informations (timestep, energy and box size) and orientations and positions of each nucleotide. The topology file, on the other hand, keeps track of the backbone-backbone bonds between nucleotides in the same strand. Working configuration and topology files can be found in the &amp;lt;tt&amp;gt;[[Examples|EXAMPLES]]&amp;lt;/tt&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
===Configuration file===&lt;br /&gt;
The first three rows of a configuration file contain the timestep &amp;lt;tt&amp;gt;T&amp;lt;/tt&amp;gt; at which the configuration has been printed, the length of the box sides &amp;lt;tt&amp;gt;Lx&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;Ly&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;Lz&amp;lt;/tt&amp;gt; and the total, potential and kinetic energies, &amp;lt;tt&amp;gt;Etot&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;U&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;K&amp;lt;/tt&amp;gt;, respectively:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
t = T&lt;br /&gt;
b = Lz Ly Lz&lt;br /&gt;
E = Etot U K&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
after this header, each row contains position of the centre of mass, orientation, velocity and angular velocity of a single nucleotide in the following order:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\overbrace{r_x r_y r_z}^{\rm Position} \overbrace{b_x b_y b_z}^{\rm Backbone-base versor} \overbrace{n_x n_y n_z}^{\rm Normal versor} \overbrace{v_x v_y v_z}^{\rm Velocity} \overbrace{L_x L_y L_z}^{\rm Angular velocity}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Topology file===&lt;br /&gt;
The topology file stores the intra-strand, fixed bonding topology (i.e. which nucleotides share backbone links). The first row contains the total number of nucleotides &amp;lt;tt&amp;gt;N&amp;lt;/tt&amp;gt; and the number of strands &amp;lt;tt&amp;gt;Ns&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
N Ns&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After this header, the &amp;lt;tt&amp;gt;i&amp;lt;/tt&amp;gt;-th row specifies strand, base and 3&#039; and 5&#039; neighbors of the &amp;lt;tt&amp;gt;i&amp;lt;/tt&amp;gt;-th nucleotide in this way:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
S B 3&#039; 5&#039;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where S is the number of the strand (starting from 1) which the nucleotide belongs to, B is the base and 3&#039; and 5&#039; specify the index of the nucleotides with which the &amp;lt;tt&amp;gt;i&amp;lt;/tt&amp;gt;-th nucleotide is bonded in the 3&#039; and 5&#039; direction, respectively. A &amp;lt;tt&amp;gt;-1&amp;lt;/tt&amp;gt; signals that the nucleotide terminates the strand in either 3&#039; or 5&#039; direction. The topology file of a strand of sequence &amp;lt;tt&amp;gt;GCGTTG&amp;lt;/tt&amp;gt; would be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
6 1&lt;br /&gt;
1 G -1 1&lt;br /&gt;
1 C 0 2&lt;br /&gt;
1 G 1 3&lt;br /&gt;
1 T 2 4&lt;br /&gt;
1 T 3 5&lt;br /&gt;
1 G 4 -1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Specifying the topology in this way can simplify the process of simulating, for example, circular DNA.&lt;br /&gt;
&lt;br /&gt;
===Generation of initial configurations===&lt;br /&gt;
In order to generate initial configuration and topology files, we provide the &amp;lt;tt&amp;gt;${oxDNA}/UTILS/generate-sa.py&amp;lt;/tt&amp;gt; script. The usage of the script is&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;generate-sa.py &amp;lt;box side&amp;gt; &amp;lt;file with sequence&amp;gt;&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
where &amp;lt;tt&amp;gt;&amp;lt;box side&amp;gt;&amp;lt;/tt&amp;gt; specifies the length of the box side in simulation units and &amp;lt;tt&amp;gt;&amp;lt;file with sequence&amp;gt;&amp;lt;/tt&amp;gt; contains the sequence of the strands to be generated, one row per strand. If double strands are needed, each sequence must be preceded by &amp;lt;tt&amp;gt;DOUBLE&amp;lt;/tt&amp;gt;. For example, a file containing&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
DOUBLE AGGGCT&lt;br /&gt;
CCTGTA&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
would generate a double strand with a sequence &amp;lt;tt&amp;gt;AGGGCT&amp;lt;/tt&amp;gt; and a single strand with a sequence &amp;lt;tt&amp;gt;CCTGTA&amp;lt;/tt&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Positions and orientations of the strands are all chosen at random in such a way that the resulting initial configuration does not contain significant excluded volume interactions between nucleotides belonging to different strands. Generated single- and double-strands have helical conformations (i.e. they are in the minimum of the intra-strand interaction energy).&lt;br /&gt;
&lt;br /&gt;
The output configuration and topology are stored in &amp;lt;tt&amp;gt;generated.dat&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;generated.top&amp;lt;/tt&amp;gt;, respectively. &lt;br /&gt;
Since this script will initialize nucleotides&#039; velocities and angular velocities to 0, when performing molecular (or Brownian) dynamics simulation remember to put &amp;lt;tt&amp;gt;refresh_vel = 1&amp;lt;/tt&amp;gt; in the [[Documentation#Input_file|input]] file.&lt;br /&gt;
&lt;br /&gt;
==Analysis of configurations==&lt;br /&gt;
The configurations produced by oxDNA can be analysed with the &amp;lt;tt&amp;gt;output_bonds&amp;lt;/tt&amp;gt; program in &amp;lt;tt&amp;gt;${oxDNA}/UTILS/process_data/&amp;lt;/tt&amp;gt; directory. This program takes an input the input file (to recover the temperature and topology file), a configuration/trajectory file and an optional number. Since &amp;lt;tt&amp;gt;output_bonds&amp;lt;/tt&amp;gt; reads analyses a single configuration, the optional number selects the configuration which it needs to analyse in the trajectory. Analysing a whole trajectory can be done by looping over a counter.&lt;br /&gt;
&lt;br /&gt;
Please note that &amp;lt;tt&amp;gt;output_bonds&amp;lt;/tt&amp;gt; is not compiled automatically. If you never compiled it, do so as described in the [[Download_and_Installation#Installation|installation instructions]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;output_bonds&amp;lt;/tt&amp;gt; can be used as follows:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
${oxDNA}/UTILS/process_data/output_bonds &amp;lt;input_file&amp;gt; &amp;lt;trajectory_file&amp;gt; [counter]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The program outputs some debugging information to the standard error and information regarding the interaction energies to the standard output. The contributions arising from each of the terms in the potential (see the appendix of [[Publications|Ref. 2]]) are reported for each pair of nucleotides that have non-zero total interactions.&lt;br /&gt;
&lt;br /&gt;
This output can be easily parsed to analyse the configurations.&lt;br /&gt;
&lt;br /&gt;
For each pair of nucleotides that do interact in the configuration, the program prints out a line containing:&lt;br /&gt;
* The id of the two particles (starting from 0)&lt;br /&gt;
* The total interaction energy&lt;br /&gt;
* The hydrogen bonding (base pairing) energy&lt;br /&gt;
* The stacking energy&lt;br /&gt;
* The cross stacking energy&lt;br /&gt;
* The excluded volume energy&lt;br /&gt;
* The FENE interaction energy&lt;br /&gt;
* A letter indicating a status code. This will be &amp;lt;tt&amp;gt;N&amp;lt;/tt&amp;gt; for pairs that interact through bonded interactions (i.e. they are neighbors along a strand) and it will be &amp;lt;tt&amp;gt;H&amp;lt;/tt&amp;gt; when a base pair is present. Our definition of base pair is when two nucleotides have a hydrogen bonding energy less than 0.1 in simulation units (see [[Publications|Ref. 2]]).&lt;br /&gt;
&lt;br /&gt;
===Geometry of the Model===&lt;br /&gt;
In the configuration/trajectory files only the positions and orientations of the nucleotides are stored. If one wants to recover the positions of the individual interaction sites in the model, some maths need to be done.&lt;br /&gt;
&lt;br /&gt;
The position of the base, stacking and backbone sites can be recovered as follows:&lt;br /&gt;
&lt;br /&gt;
base site:     (center) + 0.40 * (axis vector)&lt;br /&gt;
&lt;br /&gt;
stacking site: (center) + 0.34 * (axis vector)&lt;br /&gt;
&lt;br /&gt;
backbone site: (center) - 0.40 * (axis_vector)&lt;br /&gt;
&lt;br /&gt;
The picture in the [[Model_introduction|introduction]] might help understanding where the sites are.&lt;br /&gt;
&lt;br /&gt;
==External Forces==&lt;br /&gt;
The code implements several types of external forces that can be imposed on the system that can be used either to simulate tension exerted on DNA or simply to accelerate the formation of secondary or tertiary structure. External forces can be tricky to treat, especially in a dynamics simulation, since they are an external source of work. Care should be taken in adjusting the time step, thermostat parameters and such.&lt;br /&gt;
&lt;br /&gt;
To enable external forces, one needs to specify &amp;lt;tt&amp;gt;external_forces = 1&amp;lt;/tt&amp;gt; in the input file and also supply an external force file to read from with the key &amp;lt;tt&amp;gt;external_forces_file = &amp;lt;file&amp;gt;&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The syntax of the external forces file is quite simple. Examples of such files can be found in the [[Hairpin_formation|hairpin formation]] and [[Pseudoknot|Pseudoknot formation]] examples. Each force is specified within a block contained in curly brackets. Empty lines and lines beginning with an hash symbol (&amp;lt;tt&amp;gt;#&amp;lt;/tt&amp;gt;) are ignored. Different forces require different keys to be present. If the file has the wrong syntax, oxDNA should spit out a sensible error message while parsing the file.&lt;br /&gt;
&lt;br /&gt;
The different types of forces implemented at the moment are:&lt;br /&gt;
* harmonic trap&lt;br /&gt;
* string &lt;br /&gt;
* repulsion plane&lt;br /&gt;
* mutual trap&lt;br /&gt;
&lt;br /&gt;
All forces act on the centre of the particle.&lt;br /&gt;
&lt;br /&gt;
Forces of different kinds can be combined in the same simulation. There is a maximum number of 10 external forces per particle for memory reasons. This can be manually overridden recompiling the code with a different value of the macro &amp;lt;tt&amp;gt;MAX_EXT_FORCES&amp;lt;/tt&amp;gt; (currently 10) in &amp;lt;tt&amp;gt;defs.h&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===String===&lt;br /&gt;
A string is implemented as a force that does not depend on the particle position. Its value can be constant or can change linearly with time. It is useful as it does not fluctuate with time.&lt;br /&gt;
&lt;br /&gt;
A force of this kind is specified with &amp;lt;tt&amp;gt;type = string&amp;lt;/tt&amp;gt;. The relevant keys are:&lt;br /&gt;
* &#039;&#039;&#039;particle&#039;&#039;&#039; (int) the particle on which to exert the force&lt;br /&gt;
* &#039;&#039;&#039;F0&#039;&#039;&#039; (float) the value of the force at time = 0 in simulation units (please note that the value of the time may or may not be reset when starting a simulation, depending on the input file)&lt;br /&gt;
* &#039;&#039;&#039;rate&#039;&#039;&#039; (float) growing rate of the force (simulation units/time steps). Typical values are very small (&amp;lt; 10^(-5))&lt;br /&gt;
* &#039;&#039;&#039;dir&#039;&#039;&#039; (3 floats separated by commas) direction of the force (automatically normalised by the code)&lt;br /&gt;
&lt;br /&gt;
The following bit of code will create an external force on the first nucleotide in the system starting at 1 simulation units (48.15 pN) and growing linearly with time at the rate of 48.15pN every million time steps. The force will pull the nucleotide along the &amp;lt;tt&amp;gt;z&amp;lt;/tt&amp;gt; direction.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
type = string&lt;br /&gt;
particle = 0&lt;br /&gt;
F0 = 1.&lt;br /&gt;
rate = 1e-6&lt;br /&gt;
dir = 0., 0., 1.&lt;br /&gt;
} &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Harmonic trap===&lt;br /&gt;
This type of force implements an harmonic trap, of arbitrary stiffness, that can move linearly with time. It can be useful to fix the position of the nucleotides to simulate attachment to something or to implement (quasi) constant extension simulations.&lt;br /&gt;
&lt;br /&gt;
A force of this kind is specified with &amp;lt;tt&amp;gt;type = trap&amp;lt;/tt&amp;gt;. The relevant keys are:&lt;br /&gt;
* &#039;&#039;&#039;particle&#039;&#039;&#039; (int) the particle on which to exert the force&lt;br /&gt;
* &#039;&#039;&#039;pos0&#039;&#039;&#039; (3 floats separated by commas) rest position of the trap&lt;br /&gt;
* &#039;&#039;&#039;stiff&#039;&#039;&#039; (float) stiffness of the trap (the force is stiff * dx)&lt;br /&gt;
* &#039;&#039;&#039;rate&#039;&#039;&#039; (float) speed of the trap (length simulation units/time steps)&lt;br /&gt;
* &#039;&#039;&#039;dir&#039;&#039;&#039; (3 floats separated by commas) direction of movement of the trap&lt;br /&gt;
&lt;br /&gt;
Here is an example input for a harmonic trap acting on the third nucleotide constraining it to stay close to the origin. In this example the trap does not move (&amp;lt;tt&amp;gt;rate=0&amp;lt;/tt&amp;gt;), but one could have it move at a constant speed along the direction specified by &amp;lt;tt&amp;gt;dir&amp;lt;/tt&amp;gt;, in this case the &amp;lt;tt&amp;gt;x&amp;lt;/tt&amp;gt; direction.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
type = trap&lt;br /&gt;
particle = 2&lt;br /&gt;
pos0 = 0., 0., 0.&lt;br /&gt;
stiff = 1.0&lt;br /&gt;
rate = 0.&lt;br /&gt;
dir = 1.,0.,0.&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Please note that the trap does not comply with periodic boundary conditions. This is most likely what you want.&lt;br /&gt;
&lt;br /&gt;
===Repulsion plane===&lt;br /&gt;
This kind of external force implements a repulsion plane that constrains a particle (or the whole system) to stay on one side of it. It is implemented as a harmonic repulsion, but the stiffness can be made arbitrarily high to mimic a hard repulsion.&lt;br /&gt;
&lt;br /&gt;
A force of this kind is specified with &amp;lt;tt&amp;gt;type = repulsion_plane&amp;lt;/tt&amp;gt;. The relevant keys are:&lt;br /&gt;
* &#039;&#039;&#039;particle&#039;&#039;&#039; (int) the particle on which to exert the force. If set to the special value -1, the force will be exerted on all particles.&lt;br /&gt;
* &#039;&#039;&#039;stiff&#039;&#039;&#039; (float) stiffness of the trap (the force is stiff * D, where D is distance from the plane. The force is exerted only if the nucleotide is below the plane)&lt;br /&gt;
* &#039;&#039;&#039;dir&#039;&#039;&#039; (3 floats separated by commas) a direction normal to the plane&lt;br /&gt;
* &#039;&#039;&#039;position&#039;&#039;&#039; (1 float number) specifies the position of the plane&lt;br /&gt;
&lt;br /&gt;
If direction is &amp;lt;tt&amp;gt; direction =  u,v,w &amp;lt;/tt&amp;gt; , then the plane contains all the points (x,y,z) that satisfy the equation: u*x + v*y + w*z + position = 0.&lt;br /&gt;
Only nucleotides  with coordinates (x,y,z) that satisfy u*x + v*y + w*z + position &amp;lt; 0 will feel the force.&lt;br /&gt;
The force exerted on a nucleotide is equal to stiff * D, where D is the distance of the nucleotide from the plane, where &amp;lt;tt&amp;gt; D = | u*x + v*y + w*z + position | / \sqrt(v^2 + u^2 + z^2 ).&amp;lt;/tt&amp;gt;&lt;br /&gt;
For nucleotides for which u*x + v*y + w*z + position &amp;gt;= 0, no force will be exerted.&lt;br /&gt;
&lt;br /&gt;
Here is an example. This plane acts on the whole system and will not exert any force on nucleotides with a positive &amp;lt;tt&amp;gt;x&amp;lt;/tt&amp;gt; coordinate. A force proportional to 96.3pN * (&amp;lt;tt&amp;gt;x&amp;lt;/tt&amp;gt; coordinate) will be exerted on all particles . &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
type = repulsion_plane&lt;br /&gt;
#whole system&lt;br /&gt;
particle = -1&lt;br /&gt;
stiff = 1. #96.3 pN in simulation units&lt;br /&gt;
dir = 1, 0, 0&lt;br /&gt;
position = 0&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If in the above example you would specify position = 3, then the force would be exerted on all nucleotides with coordinate x &amp;gt; -3.&lt;br /&gt;
&lt;br /&gt;
===Mutual trap===&lt;br /&gt;
This force is useful to form initial configurations. It is a harmonic force that at every moment pulls a particle towards a reference particle. It is possible to specify the separation at which the force will be 0.&lt;br /&gt;
&lt;br /&gt;
A force of this kind is specified with &amp;lt;tt&amp;gt;type = mutual_trap&amp;lt;/tt&amp;gt;. The relevant keys are:&lt;br /&gt;
* &#039;&#039;&#039;particle&#039;&#039;&#039; (int) the particle on which to exert the force.&lt;br /&gt;
* &#039;&#039;&#039;ref_particle&#039;&#039;&#039; (int) particle to pull towards. Please note that this particle will not feel any force (the name mutual trap is thus misleading).&lt;br /&gt;
* &#039;&#039;&#039;stiff&#039;&#039;&#039; (float) stiffness of the trap&lt;br /&gt;
* &#039;&#039;&#039;r0&#039;&#039;&#039; (float) equilibrium distance of the trap.&lt;br /&gt;
* &#039;&#039;&#039;position&#039;&#039;&#039; (3 floats separated by commas) one point belonging to the plane.&lt;br /&gt;
&lt;br /&gt;
Here is an example, extracted from the [[Pseudoknot|pseudoknot formation example]]. This will pull particle 14 towards particle 39, favouring an equilibrium distance of 1.4 (which corresponds roughly to the minimum of the hydrogen bonding potential, not a coincidence). The same force with opposite sign is exerted on particle 39 through a separate force. It is not necessary to have both particles feel the force, but it is usually works much better.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
type = mutual_trap&lt;br /&gt;
particle = 14&lt;br /&gt;
ref_particle = 39&lt;br /&gt;
stiff = 1.&lt;br /&gt;
r0 = 1.2&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
{&lt;br /&gt;
type = mutual_trap&lt;br /&gt;
particle = 39&lt;br /&gt;
ref_particle = 14&lt;br /&gt;
stiff = 1.&lt;br /&gt;
r0 = 1.2&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Visualisation of structures==&lt;br /&gt;
oxDNA produces a trajectory file where all the relevant information is&lt;br /&gt;
stored. A converter is provided (&amp;lt;tt&amp;gt;traj2vis.py&amp;lt;/tt&amp;gt;) in the&lt;br /&gt;
&amp;lt;tt&amp;gt;UTILS&amp;lt;/tt&amp;gt; directory that is able to produce files in the &amp;lt;tt&amp;gt;xyz&amp;lt;/tt&amp;gt;&lt;br /&gt;
and &amp;lt;tt&amp;gt;pdb&amp;lt;/tt&amp;gt; formats. The same program can be used on a configuration&lt;br /&gt;
file and it will produce a snapshot.&lt;br /&gt;
&lt;br /&gt;
Since the model is coearse-grained, we have to &amp;quot;trick&amp;quot; the visualisers into&lt;br /&gt;
thinking that the interaction sites in the model are actually atoms.&lt;br /&gt;
Advanced nucleic acids representations such as ribbons will not work on the&lt;br /&gt;
outputs.&lt;br /&gt;
&lt;br /&gt;
All the images in the [[Screenshots]] page were produced with the pdb representation using UCSF chimera (see later on).&lt;br /&gt;
&lt;br /&gt;
===xyz format===&lt;br /&gt;
&lt;br /&gt;
just run &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;$oxDNA/UTILS/traj2vis.py xyz &amp;lt;trajectory&amp;gt; &amp;lt;topology&amp;gt; &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(where &amp;lt;tt&amp;gt;$oxDNA&amp;lt;/tt&amp;gt; is the oxDNA source directory) to get the xyz representation in a file called the same as the trajectory&lt;br /&gt;
file with &amp;lt;tt&amp;gt;.xyz&amp;lt;/tt&amp;gt; appended. Please note that boundary conditions are&lt;br /&gt;
implemented strand-wise, so strands that are bound might appear at two&lt;br /&gt;
different sizes of the box. Also, the center of mass of the system (where&lt;br /&gt;
each strand is weighted the same regardless of the length) is set to 0 at&lt;br /&gt;
each frame. Carbons represent the backbone sites and oxygens the base sites.&lt;br /&gt;
&lt;br /&gt;
The resulting file can be read with a variety of programs. Here we will&lt;br /&gt;
explain how to visualise it sensibly in [http://www.ks.uiuc.edu/Research/vmd/ VMD].&lt;br /&gt;
&lt;br /&gt;
* Run VMD and load the xyz file.&lt;br /&gt;
* In the graphics menu, go to Representations.&lt;br /&gt;
* In the Selected Atoms line, input &amp;lt;tt&amp;gt;name C&amp;lt;/tt&amp;gt;. Also select Drawing method CPK, sphere scale 0.8 and Bond Radius 0.&lt;br /&gt;
* In the Selected Atoms line, input &amp;lt;tt&amp;gt;name O&amp;lt;/tt&amp;gt;. Also select Drawing method CPK, sphere scale 0.6 and Bond Radius 0.&lt;br /&gt;
&lt;br /&gt;
This should produce a ball representation of our model DNA. Bonds&lt;br /&gt;
automatically produced by VMD are NOT meaningful in our context.&lt;br /&gt;
&lt;br /&gt;
===pdb format===&lt;br /&gt;
Run &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;$oxDNA/UTILS/traj2vis.py xyz &amp;lt;trajectory&amp;gt; &amp;lt;topology&amp;gt; &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to produce a trajectory/configuration in the pdb format. A further file&lt;br /&gt;
called &amp;lt;tt&amp;gt;chimera.com&amp;lt;/tt&amp;gt; will be produced (more on this later). All&lt;br /&gt;
comments above about periodic boundaries and centre of mass apply here as&lt;br /&gt;
well.&lt;br /&gt;
&lt;br /&gt;
The pdb file can be visualised in VMD just like the xyz format, but a nicer&lt;br /&gt;
output can be produced with [http://www.cgl.ucsf.edu/chimera/ UCSF Chimera] (although only for snapshots at&lt;br /&gt;
the moment) as follows:&lt;br /&gt;
&lt;br /&gt;
Run chimera and load the pdb file. An ugly output will be displayed.&lt;br /&gt;
&lt;br /&gt;
Bring up the command line under the &amp;lt;tt&amp;gt;Tools → General Controls&amp;lt;/tt&amp;gt; menu.&lt;br /&gt;
Input &amp;lt;tt&amp;gt;read chimera.com&amp;lt;/tt&amp;gt; in the command line and press enter. You&lt;br /&gt;
should get a nicer visualisation with different bases in different colors,&lt;br /&gt;
all the covalent bonds in the right place, etc.&lt;br /&gt;
&lt;br /&gt;
On large configurations, the production of ellipsoids will be extremely&lt;br /&gt;
slow. You can remove it by removing the line&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;aniso scale 0.75 smoothing 4&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
from the commands file. Loading the resulting file should be much faster.&lt;br /&gt;
&lt;br /&gt;
UCSF chimera can in turn export the scene in a variety of formats.&lt;/div&gt;</summary>
		<author><name>Rovigatti</name></author>
	</entry>
	<entry>
		<id>https://dna.physics.ox.ac.uk/index.php?title=Documentation&amp;diff=519</id>
		<title>Documentation</title>
		<link rel="alternate" type="text/html" href="https://dna.physics.ox.ac.uk/index.php?title=Documentation&amp;diff=519"/>
		<updated>2012-04-20T09:34:49Z</updated>

		<summary type="html">&lt;p&gt;Rovigatti: /* Topology file */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Compile options==&lt;br /&gt;
&lt;br /&gt;
Compiling oxDNA requires that you change the first rows in the makefile to match your machine configuration. The following parameters can be passed to make:&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;dbg=1&#039;&#039;&#039; oxDNA will be compiled with debug flags (both for nvcc and gcc). The resulting executable will be put in the Debug directory.&lt;br /&gt;
*&#039;&#039;&#039;g=1&#039;&#039;&#039; oxDNA will be compiled with both debug and optimization flags. The resulting executable will be put in the Release directory.&lt;br /&gt;
*&#039;&#039;&#039;intel=1&#039;&#039;&#039; oxDNA will be compiled using the Intel icpc compiler. The resulting executable will be named oxDNA_intel.&lt;br /&gt;
&lt;br /&gt;
==Usage==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;oxDNA input_file&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The input file contains all the relevant information for the program to run, such as what initial configuration to use, the topology of the system, how often to print the energies to a file, etc. Please make sure you read the [[Thermostat|thermostat]] page if you use molecular dynamics.&lt;br /&gt;
&lt;br /&gt;
==Input file==&lt;br /&gt;
&lt;br /&gt;
As always in UNIX environments, everything is case sensitive.&lt;br /&gt;
The options are in the form key = value. There can be arbitrary spaces before and after both key and value. Line with a leading # will be treated as comments.&lt;br /&gt;
In this part | (pipe) is the separator between the different values that can be used to specify a value for the key.&lt;br /&gt;
Keys between [ and ] are optional, the value after the equal sign is the default value.&lt;br /&gt;
&lt;br /&gt;
===Generic options===&lt;br /&gt;
The options listed here define the generic behavior of the entire program.&lt;br /&gt;
;[sim_type=MD]: MD|MC&lt;br /&gt;
:MD = Molecular Dynamics, MC = Monte Carlo&lt;br /&gt;
;backend: CPU&lt;br /&gt;
;backend_precision: float|double&lt;br /&gt;
;[debug=0]: 0|1&lt;br /&gt;
: 1 if you want verbose logs, 0 otherwise.&lt;br /&gt;
&lt;br /&gt;
===Simulation options===&lt;br /&gt;
	The options listed here specify the behaviour of the simulation.&lt;br /&gt;
&lt;br /&gt;
;steps: number of steps to be performed.&lt;br /&gt;
		&lt;br /&gt;
;[restart_step_counter=0]: 0|1&lt;br /&gt;
:0 means that the step counter will start from the value read in the configuration file; if 1, the step counter will be reset to 0. The total duration of the simulation is unchanged.&lt;br /&gt;
			&lt;br /&gt;
;[seed=time(NULL)]: seed for the random number generator. On Unix systems, it will use by default a number from /dev/urandom + time(NULL)&lt;br /&gt;
		&lt;br /&gt;
;T: temperature of the simulation. It can be expressed in simulation units or kelvin (append a k or K after the value) or celsius (append a c or C after the value).&lt;br /&gt;
:Examples:&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
! Value&lt;br /&gt;
! Simulation Units&lt;br /&gt;
|-&lt;br /&gt;
| 0.1&lt;br /&gt;
| 0.1&lt;br /&gt;
|-&lt;br /&gt;
| 300 K&lt;br /&gt;
| 0.1&lt;br /&gt;
|-&lt;br /&gt;
| 300k&lt;br /&gt;
| 0.1&lt;br /&gt;
|-&lt;br /&gt;
| 26.85c&lt;br /&gt;
| 0.1&lt;br /&gt;
|-&lt;br /&gt;
| 26.85 C &lt;br /&gt;
| 0.1&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
		&lt;br /&gt;
;verlet_skin: if a particle moves more than verlet_skin then the lists will be updated. Its name is somewhat misleading: the actual verlet skin is 2*verlet_skin.&lt;br /&gt;
	&lt;br /&gt;
;[use_average_seq=1]: 0|1&lt;br /&gt;
: specifies whether to use the default hard-coded average parameters for base-pairing and stacking interaction strengths or not. If sequence dependence is to be used, set this to 0 and specify seq_dep_file.&lt;br /&gt;
	&lt;br /&gt;
;[seq_dep_file]: specifies the file from which the sequence dependent parameters should be read. Mandatory if use_average_seq=no, ignored otherwise. A sample file is provided (sequence_dependent_parameters.txt).&lt;br /&gt;
&lt;br /&gt;
;[external_forces=0]: 0|1&lt;br /&gt;
: specifies whether there are external forces acting on the nucleotides or not. If it is set to 1, then a file which specifies the external forces&#039; configuration has to be provided (see external_forces_file).&lt;br /&gt;
&lt;br /&gt;
;[external_forces_file]: specifies the file containing all the external forces&#039; configurations. Currently there are six supported force types (see EXAMPLES/TRAPS for some examples):&lt;br /&gt;
:*string&lt;br /&gt;
:*twist&lt;br /&gt;
:*trap&lt;br /&gt;
:*repulsion_plane&lt;br /&gt;
:*repulsion_plane_moving&lt;br /&gt;
:*mutual_trap&lt;br /&gt;
	&lt;br /&gt;
====Molecular dynamics simulations options====&lt;br /&gt;
&lt;br /&gt;
;dt: time step of the integration.&lt;br /&gt;
&lt;br /&gt;
;thermostat: no|refresh|john &lt;br /&gt;
:no means no thermostat will be used. refresh will refresh all the particle&#039;s velocities from a maxwellian every newtonian_steps steps. john is an Anderson-like thermostat (see pt). Make sure you read [[Thermostat|thermostat]].&lt;br /&gt;
&lt;br /&gt;
;newtonian_steps: required if thermostat != no&lt;br /&gt;
:number of steps after which a procedure of thermalization will be performed.&lt;br /&gt;
			&lt;br /&gt;
;pt: used if thermostat == john. It&#039;s the probability that a particle&#039;s velocity will be refreshed during a thermalization procedure.&lt;br /&gt;
		&lt;br /&gt;
;diff_coeff: required if pt is not specified&lt;br /&gt;
:used internally to automatically compute the pt that would be needed if we wanted such a self diffusion coefficient. Not used if pt is set.&lt;br /&gt;
&lt;br /&gt;
====Monte Carlo simulations options====&lt;br /&gt;
	&lt;br /&gt;
;[check_energy_every=10]: this number times print_energy_every gives the number of steps after which the energy will be computed from scratch and checked against the actual value computed adding energy differences.&lt;br /&gt;
		&lt;br /&gt;
;[check_energy_threshold=1e-4]:	if abs((old_energy - new_energy)/old_energy) &amp;gt; check_energy_threshold then the program will die and warn the user.&lt;br /&gt;
	&lt;br /&gt;
;ensemble: NVT&lt;br /&gt;
:ensemble of the simulation. More ensembles could be added in future versions.&lt;br /&gt;
	&lt;br /&gt;
;delta_translation: maximum displacement (per dimension) for translational moves in simulation units.&lt;br /&gt;
	&lt;br /&gt;
;delta_translation: maximum displacement for rotational moves in simulation units.&lt;br /&gt;
&lt;br /&gt;
===Input/output===&lt;br /&gt;
The options listed here are used to manage the I/O (read and write configurations, energies and so on)&lt;br /&gt;
	&lt;br /&gt;
;conf_file: initial configuration file. &lt;br /&gt;
		&lt;br /&gt;
;topology: file containing the system&#039;s topology.&lt;br /&gt;
		&lt;br /&gt;
;trajectory_file: the main output of the program. All the configurations will be appended to this file as they are printed.&lt;br /&gt;
		&lt;br /&gt;
;[confs_to_skip=0]: valid only if conf_file is a trajectory. Skip the first confs_to_skip configurations and then load in memory the (confs_to_skip+1)th.&lt;br /&gt;
		&lt;br /&gt;
;[lastconf_file=last_conf.dat]: this is the file where the last configuration is saved (when the program finishes or is killed). Set to last_conf.dat by default&lt;br /&gt;
&lt;br /&gt;
;[refresh_vel=0]: 0|1&lt;br /&gt;
:if 1 the initial velocities will be refreshed from a maxwellian.&lt;br /&gt;
	&lt;br /&gt;
;energy_file: energy output file.&lt;br /&gt;
		&lt;br /&gt;
;[print_energy_every=1000]: this will make the program print the energies every print_energy_every steps.&lt;br /&gt;
		&lt;br /&gt;
;[no_stdout_energy=0]: 0|1&lt;br /&gt;
:if 1 the energy will be printed just to the energy_file.&lt;br /&gt;
		&lt;br /&gt;
;[time_scale=linear]: linear|log_lin&lt;br /&gt;
:using linear configurations will be saved every print_conf_interval.&lt;br /&gt;
:using log_lin configurations will be saved logarithmically for print_conf_ppc times. After that the logarithmic sequence will restart.&lt;br /&gt;
	&lt;br /&gt;
;print_conf_interval: linear interval if time_scale == linear. First step of the logarithmic scale if time_scale == log_lin.&lt;br /&gt;
		&lt;br /&gt;
;print_conf_ppc: used if time_scale == log_lin&lt;br /&gt;
:points per logarithmic cycle.&lt;br /&gt;
		&lt;br /&gt;
;[print_reduced_conf_every=0]: every print_reduced_conf_every steps the program will print out the reduced configurations (i.e. confs containing only the centers of mass of strands).&lt;br /&gt;
&lt;br /&gt;
;reduced_conf_output_dir: used if print_reduced_conf_every &amp;gt; 0&lt;br /&gt;
:output directory for reduced_conf files.&lt;br /&gt;
		&lt;br /&gt;
;[log_file=stderr]: file where generic and debug informations will be logged. If not specified then stderr will be used.&lt;br /&gt;
	&lt;br /&gt;
;[print_timings=0]: 0|1&lt;br /&gt;
:if 1 the MD step timing have be printed to a file.&lt;br /&gt;
			&lt;br /&gt;
;timings_filename: used if print_timings == 1&lt;br /&gt;
:output file where the MD step timing will be appended to.&lt;br /&gt;
&lt;br /&gt;
==Output files==&lt;br /&gt;
*The log file contains all relevant informations about the simulation (specified options, activated external forces, warnings about misconfiguratios, critical errors, etc.). If the log file is omitted, all these informations will be displayed on the standard output.&lt;br /&gt;
&lt;br /&gt;
*The energy file layout for MD simulations is&lt;br /&gt;
&lt;br /&gt;
:{|&lt;br /&gt;
| time&lt;br /&gt;
| potential energy&lt;br /&gt;
| kinetic energy&lt;br /&gt;
| total energy&lt;br /&gt;
| hydrogen bonding energy&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
:while for MC simulations is&lt;br /&gt;
&lt;br /&gt;
:{|&lt;br /&gt;
| time&lt;br /&gt;
| potential energy&lt;br /&gt;
| hydrogen bonding energy&lt;br /&gt;
| acceptance ratio for translational moves&lt;br /&gt;
| acceptance ratio for rotational moves&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
:Mind that potential, kinetic and total energies are divided by the number of particles whereas the hydrogen bonding energy is not.&lt;br /&gt;
&lt;br /&gt;
*Configurations are saved in the trajectory file.&lt;br /&gt;
&lt;br /&gt;
==Configuration and topology files==&lt;br /&gt;
The current state of a system, as by oxDNA, is described by two files: a configuration file and a topology file. The configuration file contains all the general informations (timestep, energy and box size) and orientations and positions of each nucleotide. The topology file, on the other hand, keeps track of the backbone-backbone bonds between nucleotides in the same strand. Working configuration and topology files can be found in the &amp;lt;tt&amp;gt;[[Examples|EXAMPLES]]&amp;lt;/tt&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
===Configuration file===&lt;br /&gt;
The first three rows of a configuration file contain the timestep &amp;lt;tt&amp;gt;T&amp;lt;/tt&amp;gt; at which the configuration has been printed, the length of the box sides &amp;lt;tt&amp;gt;Lx&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;Ly&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;Lz&amp;lt;/tt&amp;gt; and the total, potential and kinetic energies, &amp;lt;tt&amp;gt;Etot&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;U&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;K&amp;lt;/tt&amp;gt;, respectively:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
t = T&lt;br /&gt;
b = Lz Ly Lz&lt;br /&gt;
E = Etot U K&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
after this header, each row contains position of the centre of mass, orientation, velocity and angular velocity of a single nucleotide in the following order:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\overbrace{r_x r_y r_z}^{\rm Position} \overbrace{b_x b_y b_z}^{\rm Backbone-base versor} \overbrace{n_x n_y n_z}^{\rm Normal versor} \overbrace{v_x v_y v_z}^{\rm Velocity} \overbrace{L_x L_y L_z}^{\rm Angular velocity}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Topology file===&lt;br /&gt;
The topology file stores the intra-strand, fixed bonding topology (i.e. which nucleotides share backbone links). The first row contains the total number of nucleotides &amp;lt;tt&amp;gt;N&amp;lt;/tt&amp;gt; and the number of strands &amp;lt;tt&amp;gt;Ns&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
N Ns&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After this header, the &amp;lt;tt&amp;gt;i&amp;lt;/tt&amp;gt;-th row specifies strand, base and 3&#039; and 5&#039; neighbors of the &amp;lt;tt&amp;gt;i&amp;lt;/tt&amp;gt;-th nucleotide in this way:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
S B 3&#039; 5&#039;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where S is the number of the strand (starting from 1) which the nucleotide belongs to, B is the base and 3&#039; and 5&#039; specify the index of the nucleotides with which the &amp;lt;tt&amp;gt;i&amp;lt;/tt&amp;gt;-th nucleotide is bonded in the 3&#039; and 5&#039; direction, respectively. A &amp;lt;tt&amp;gt;-1&amp;lt;/tt&amp;gt; signals that the nucleotide terminates the strand in either 3&#039; or 5&#039; direction. The topology file of a strand of sequence &amp;lt;tt&amp;gt;GCGTTG&amp;lt;/tt&amp;gt; would be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
6 1&lt;br /&gt;
1 G -1 1&lt;br /&gt;
1 C 0 2&lt;br /&gt;
1 G 1 3&lt;br /&gt;
1 T 2 4&lt;br /&gt;
1 T 3 5&lt;br /&gt;
1 G 4 -1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Specifying the topology in this way can simplify the process of simulating, for example, circular DNA.&lt;br /&gt;
&lt;br /&gt;
===Generation of initial configurations===&lt;br /&gt;
In order to generate initial configuration and topology files, we provide the &amp;lt;tt&amp;gt;${oxDNA}/UTILS/generate-sa.py&amp;lt;/tt&amp;gt; script. The usage of the script is&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;generate-sa.py &amp;lt;box side&amp;gt; &amp;lt;file with sequence&amp;gt;&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
where &amp;lt;tt&amp;gt;&amp;lt;box side&amp;gt;&amp;lt;/tt&amp;gt; specifies the length of the box side in simulation units and &amp;lt;tt&amp;gt;&amp;lt;file with sequence&amp;gt;&amp;lt;/tt&amp;gt; contains the sequence of the strands to be generated, one row per strand. If double strands are needed, each sequence must be preceded by &amp;lt;tt&amp;gt;DOUBLE&amp;lt;/tt&amp;gt;. For example, a file containing&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
DOUBLE AGGGCT&lt;br /&gt;
CCTGTA&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
would generate a double strand with a sequence &amp;lt;tt&amp;gt;AGGGCT&amp;lt;/tt&amp;gt; and a single strand with a sequence &amp;lt;tt&amp;gt;CCTGTA&amp;lt;/tt&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Positions and orientations of the strands are all chosen at random in such a way that the resulting initial configuration does not contain significant excluded volume interactions between nucleotides belonging to different strands. Generated single- and double-strands have helical conformations (i.e. they are in the minimum of the intra-strand interaction energy).&lt;br /&gt;
&lt;br /&gt;
The output configuration and topology are stored in &amp;lt;tt&amp;gt;generated.dat&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;generated.top&amp;lt;/tt&amp;gt;, respectively. &lt;br /&gt;
Since this script will initialize nucleotides&#039; velocities and angular velocities to 0, when performing molecular (or Brownian) dynamics simulation remember to put &amp;lt;tt&amp;gt;refresh_vel = 1&amp;lt;/tt&amp;gt; in the [[Documentation#Input_file|input]] file.&lt;br /&gt;
&lt;br /&gt;
==Analysis of configurations==&lt;br /&gt;
The configurations produced by oxDNA can be analysed with the &amp;lt;tt&amp;gt;output_bonds&amp;lt;/tt&amp;gt; program in &amp;lt;tt&amp;gt;${oxDNA}/UTILS/process_data/&amp;lt;/tt&amp;gt; directory. This program takes an input the input file (to recover the temperature and topology file), a configuration/trajectory file and an optional number. Since &amp;lt;tt&amp;gt;output_bonds&amp;lt;/tt&amp;gt; reads analyses a single configuration, the optional number selects the configuration which it needs to analyse in the trajectory. Analysing a whole trajectory can be done by looping over a counter.&lt;br /&gt;
&lt;br /&gt;
Please note that &amp;lt;tt&amp;gt;output_bonds&amp;lt;/tt&amp;gt; is not compiled automatically. If you never compiled it, do so as described in the [[Download_and_Installation#Installation|installation instructions]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;output_bonds&amp;lt;/tt&amp;gt; can be used as follows:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
${oxDNA}/UTILS/process_data/output_bonds &amp;lt;input_file&amp;gt; &amp;lt;trajectory_file&amp;gt; [counter]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The program outputs some debugging information to the standard error and information regarding the interaction energies to the standard output. The contributions arising from each of the terms in the potential (see the appendix of [[Publications|Ref. 2]]) are reported for each pair of nucleotides that have non-zero total interactions.&lt;br /&gt;
&lt;br /&gt;
This output can be easily parsed to analyse the configurations.&lt;br /&gt;
&lt;br /&gt;
For each pair of nucleotides that do interact in the configuration, the program prints out a line containing:&lt;br /&gt;
* The id of the two particles (starting from 0)&lt;br /&gt;
* The total interaction energy&lt;br /&gt;
* The hydrogen bonding (base pairing) energy&lt;br /&gt;
* The stacking energy&lt;br /&gt;
* The cross stacking energy&lt;br /&gt;
* The excluded volume energy&lt;br /&gt;
* The FENE interaction energy&lt;br /&gt;
* A letter indicating a status code. This will be &amp;lt;tt&amp;gt;N&amp;lt;/tt&amp;gt; for pairs that interact through bonded interactions (i.e. they are neighbors along a strand) and it will be &amp;lt;tt&amp;gt;H&amp;lt;/tt&amp;gt; when a base pair is present. Our definition of base pair is when two nucleotides have a hydrogen bonding energy less than 0.1 in simulation units (see [[Publications|Ref. 2]]).&lt;br /&gt;
&lt;br /&gt;
===Geometry of the Model===&lt;br /&gt;
In the configuration/trajectory files only the positions and orientations of the nucleotides are stored. If one wants to recover the positions of the individual interaction sites in the model, some maths need to be done.&lt;br /&gt;
&lt;br /&gt;
The position of the base, stacking and backbone sites can be recovered as follows:&lt;br /&gt;
&lt;br /&gt;
base site:     (center) + 0.40 * (axis vector)&lt;br /&gt;
&lt;br /&gt;
stacking site: (center) + 0.34 * (axis vector)&lt;br /&gt;
&lt;br /&gt;
backbone site: (center) - 0.40 * (axis_vector)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The picture in the [[Model_introduction|introduction]] might help understanding where the sites are.&lt;br /&gt;
&lt;br /&gt;
==External Forces==&lt;br /&gt;
The code implements several types of external forces that can be imposed on the system that can be used either to simulate tension exerted on DNA or simply to accelerate the formation of secondary or tertiary structure. External forces can be tricky to treat, especially in a dynamics simulation, since they are an external source of work. Care should be taken in adjusting the time step, thermostat parameters and such.&lt;br /&gt;
&lt;br /&gt;
To enable external forces, one needs to specify &amp;lt;tt&amp;gt;external_forces = 1&amp;lt;/tt&amp;gt; in the input file and also supply an external force file to read from with the key &amp;lt;tt&amp;gt;external_forces_file = &amp;lt;file&amp;gt;&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The syntax of the external forces file is quite simple. Examples of such files can be found in the [[Hairpin_formation|hairpin formation]] and [[Pseudoknot|Pseudoknot formation]] examples. Each force is specified within a block contained in curly brackets. Empty lines and lines beginning with an hash symbol (&amp;lt;tt&amp;gt;#&amp;lt;/tt&amp;gt;) are ignored. Different forces require different keys to be present. If the file has the wrong syntax, oxDNA should spit out a sensible error message while parsing the file.&lt;br /&gt;
&lt;br /&gt;
The different types of forces implemented at the moment are:&lt;br /&gt;
* harmonic trap&lt;br /&gt;
* string &lt;br /&gt;
* repulsion plane&lt;br /&gt;
* mutual trap&lt;br /&gt;
&lt;br /&gt;
All forces act on the centre of the particle.&lt;br /&gt;
&lt;br /&gt;
Forces of different kinds can be combined in the same simulation. There is a maximum number of 10 external forces per particle for memory reasons. This can be manually overridden recompiling the code with a different value of the macro &amp;lt;tt&amp;gt;MAX_EXT_FORCES&amp;lt;/tt&amp;gt; (currently 10) in &amp;lt;tt&amp;gt;defs.h&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===String===&lt;br /&gt;
A string is implemented as a force that does not depend on the particle position. Its value can be constant or can change linearly with time. It is useful as it does not fluctuate with time.&lt;br /&gt;
&lt;br /&gt;
A force of this kind is specified with &amp;lt;tt&amp;gt;type = string&amp;lt;/tt&amp;gt;. The relevant keys are:&lt;br /&gt;
* &#039;&#039;&#039;particle&#039;&#039;&#039; (int) the particle on which to exert the force&lt;br /&gt;
* &#039;&#039;&#039;F0&#039;&#039;&#039; (float) the value of the force at time = 0 in simulation units (please note that the value of the time may or may not be reset when starting a simulation, depending on the input file)&lt;br /&gt;
* &#039;&#039;&#039;rate&#039;&#039;&#039; (float) growing rate of the force (simulation units/time steps). Typical values are very small (&amp;lt; 10^(-5))&lt;br /&gt;
* &#039;&#039;&#039;dir&#039;&#039;&#039; (3 floats separated by commas) direction of the force (automatically normalised by the code)&lt;br /&gt;
&lt;br /&gt;
The following bit of code will create an external force on the first nucleotide in the system starting at 1 simulation units (48.15 pN) and growing linearly with time at the rate of 48.15pN every million time steps. The force will pull the nucleotide along the &amp;lt;tt&amp;gt;z&amp;lt;/tt&amp;gt; direction.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
type = string&lt;br /&gt;
particle = 0&lt;br /&gt;
F0 = 1.&lt;br /&gt;
rate = 1e-6&lt;br /&gt;
dir = 0., 0., 1.&lt;br /&gt;
} &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Harmonic trap===&lt;br /&gt;
This type of force implements an harmonic trap, of arbitrary stiffness, that can move linearly with time. It can be useful to fix the position of the nucleotides to simulate attachment to something or to implement (quasi) constant extension simulations.&lt;br /&gt;
&lt;br /&gt;
A force of this kind is specified with &amp;lt;tt&amp;gt;type = trap&amp;lt;/tt&amp;gt;. The relevant keys are:&lt;br /&gt;
* &#039;&#039;&#039;particle&#039;&#039;&#039; (int) the particle on which to exert the force&lt;br /&gt;
* &#039;&#039;&#039;pos0&#039;&#039;&#039; (3 floats separated by commas) rest position of the trap&lt;br /&gt;
* &#039;&#039;&#039;stiff&#039;&#039;&#039; (float) stiffness of the trap (the force is stiff * dx)&lt;br /&gt;
* &#039;&#039;&#039;rate&#039;&#039;&#039; (float) speed of the trap (length simulation units/time steps)&lt;br /&gt;
* &#039;&#039;&#039;dir&#039;&#039;&#039; (3 floats separated by commas) direction of movement of the trap&lt;br /&gt;
&lt;br /&gt;
Here is an example input for a harmonic trap acting on the third nucleotide constraining it to stay close to the origin. In this example the trap does not move (&amp;lt;tt&amp;gt;rate=0&amp;lt;/tt&amp;gt;), but one could have it move at a constant speed along the direction specified by &amp;lt;tt&amp;gt;dir&amp;lt;/tt&amp;gt;, in this case the &amp;lt;tt&amp;gt;x&amp;lt;/tt&amp;gt; direction.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
type = trap&lt;br /&gt;
particle = 2&lt;br /&gt;
pos0 = 0., 0., 0.&lt;br /&gt;
stiff = 1.0&lt;br /&gt;
rate = 0.&lt;br /&gt;
dir = 1.,0.,0.&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Please note that the trap does not comply with periodic boundary conditions. This is most likely what you want.&lt;br /&gt;
&lt;br /&gt;
===Repulsion plane===&lt;br /&gt;
This kind of external force implements a repulsion plane that constrains a particle (or the whole system) to stay on one side of it. It is implemented as a harmonic repulsion, but the stiffness can be made arbitrarily high to mimic a hard repulsion.&lt;br /&gt;
&lt;br /&gt;
A force of this kind is specified with &amp;lt;tt&amp;gt;type = repulsion_plane&amp;lt;/tt&amp;gt;. The relevant keys are:&lt;br /&gt;
* &#039;&#039;&#039;particle&#039;&#039;&#039; (int) the particle on which to exert the force. If set to the special value -1, the force will be exerted on all particles.&lt;br /&gt;
* &#039;&#039;&#039;stiff&#039;&#039;&#039; (float) stiffness of the trap (the force is stiff * D, where D is distance from the plane. The force is exerted only if the nucleotide is below the plane)&lt;br /&gt;
* &#039;&#039;&#039;dir&#039;&#039;&#039; (3 floats separated by commas) a direction normal to the plane&lt;br /&gt;
* &#039;&#039;&#039;position&#039;&#039;&#039; (1 float number) specifies the position of the plane&lt;br /&gt;
&lt;br /&gt;
If direction is &amp;lt;tt&amp;gt; direction =  u,v,w &amp;lt;/tt&amp;gt; , then the plane contains all the points (x,y,z) that satisfy the equation: u*x + v*y + w*z + position = 0.&lt;br /&gt;
Only nucleotides  with coordinates (x,y,z) that satisfy u*x + v*y + w*z + position &amp;lt; 0 will feel the force.&lt;br /&gt;
The force exerted on a nucleotide is equal to stiff * D, where D is the distance of the nucleotide from the plane, where &amp;lt;tt&amp;gt; D = | u*x + v*y + w*z + position | / \sqrt(v^2 + u^2 + z^2 ).&amp;lt;/tt&amp;gt;&lt;br /&gt;
For nucleotides for which u*x + v*y + w*z + position &amp;gt;= 0, no force will be exerted.&lt;br /&gt;
&lt;br /&gt;
Here is an example. This plane acts on the whole system and will not exert any force on nucleotides with a positive &amp;lt;tt&amp;gt;x&amp;lt;/tt&amp;gt; coordinate. A force proportional to 96.3pN * (&amp;lt;tt&amp;gt;x&amp;lt;/tt&amp;gt; coordinate) will be exerted on all particles . &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
type = repulsion_plane&lt;br /&gt;
#whole system&lt;br /&gt;
particle = -1&lt;br /&gt;
stiff = 1. #96.3 pN in simulation units&lt;br /&gt;
dir = 1, 0, 0&lt;br /&gt;
position = 0&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If in the above example you would specify position = 3, then the force would be exerted on all nucleotides with coordinate x &amp;gt; -3.&lt;br /&gt;
&lt;br /&gt;
===Mutual trap===&lt;br /&gt;
This force is useful to form initial configurations. It is a harmonic force that at every moment pulls a particle towards a reference particle. It is possible to specify the separation at which the force will be 0.&lt;br /&gt;
&lt;br /&gt;
A force of this kind is specified with &amp;lt;tt&amp;gt;type = mutual_trap&amp;lt;/tt&amp;gt;. The relevant keys are:&lt;br /&gt;
* &#039;&#039;&#039;particle&#039;&#039;&#039; (int) the particle on which to exert the force.&lt;br /&gt;
* &#039;&#039;&#039;ref_particle&#039;&#039;&#039; (int) particle to pull towards. Please note that this particle will not feel any force (the name mutual trap is thus misleading).&lt;br /&gt;
* &#039;&#039;&#039;stiff&#039;&#039;&#039; (float) stiffness of the trap&lt;br /&gt;
* &#039;&#039;&#039;r0&#039;&#039;&#039; (float) equilibrium distance of the trap.&lt;br /&gt;
* &#039;&#039;&#039;position&#039;&#039;&#039; (3 floats separated by commas) one point belonging to the plane.&lt;br /&gt;
&lt;br /&gt;
Here is an example, extracted from the [[Pseudoknot|pseudoknot formation example]]. This will pull particle 14 towards particle 39, favouring an equilibrium distance of 1.4 (which corresponds roughly to the minimum of the hydrogen bonding potential, not a coincidence). The same force with opposite sign is exerted on particle 39 through a separate force. It is not necessary to have both particles feel the force, but it is usually works much better.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
type = mutual_trap&lt;br /&gt;
particle = 14&lt;br /&gt;
ref_particle = 39&lt;br /&gt;
stiff = 1.&lt;br /&gt;
r0 = 1.2&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
{&lt;br /&gt;
type = mutual_trap&lt;br /&gt;
particle = 39&lt;br /&gt;
ref_particle = 14&lt;br /&gt;
stiff = 1.&lt;br /&gt;
r0 = 1.2&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Visualisation of structures==&lt;br /&gt;
oxDNA produces a trajectory file where all the relevant information is&lt;br /&gt;
stored. A converter is provided (&amp;lt;tt&amp;gt;traj2vis.py&amp;lt;/tt&amp;gt;) in the&lt;br /&gt;
&amp;lt;tt&amp;gt;UTILS&amp;lt;/tt&amp;gt; directory that is able to produce files in the &amp;lt;tt&amp;gt;xyz&amp;lt;/tt&amp;gt;&lt;br /&gt;
and &amp;lt;tt&amp;gt;pdb&amp;lt;/tt&amp;gt; formats. The same program can be used on a configuration&lt;br /&gt;
file and it will produce a snapshot.&lt;br /&gt;
&lt;br /&gt;
Since the model is coearse-grained, we have to &amp;quot;trick&amp;quot; the visualisers into&lt;br /&gt;
thinking that the interaction sites in the model are actually atoms.&lt;br /&gt;
Advanced nucleic acids representations such as ribbons will not work on the&lt;br /&gt;
outputs.&lt;br /&gt;
&lt;br /&gt;
All the images in the [[Screenshots]] page were produced with the pdb representation using UCSF chimera (see later on).&lt;br /&gt;
&lt;br /&gt;
===xyz format===&lt;br /&gt;
&lt;br /&gt;
just run &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;$oxDNA/UTILS/traj2vis.py xyz &amp;lt;trajectory&amp;gt; &amp;lt;topology&amp;gt; &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(where &amp;lt;tt&amp;gt;$oxDNA&amp;lt;/tt&amp;gt; is the oxDNA source directory) to get the xyz representation in a file called the same as the trajectory&lt;br /&gt;
file with &amp;lt;tt&amp;gt;.xyz&amp;lt;/tt&amp;gt; appended. Please note that boundary conditions are&lt;br /&gt;
implemented strand-wise, so strands that are bound might appear at two&lt;br /&gt;
different sizes of the box. Also, the center of mass of the system (where&lt;br /&gt;
each strand is weighted the same regardless of the length) is set to 0 at&lt;br /&gt;
each frame. Carbons represent the backbone sites and oxygens the base sites.&lt;br /&gt;
&lt;br /&gt;
The resulting file can be read with a variety of programs. Here we will&lt;br /&gt;
explain how to visualise it sensibly in [http://www.ks.uiuc.edu/Research/vmd/ VMD].&lt;br /&gt;
&lt;br /&gt;
* Run VMD and load the xyz file.&lt;br /&gt;
* In the graphics menu, go to Representations.&lt;br /&gt;
* In the Selected Atoms line, input &amp;lt;tt&amp;gt;name C&amp;lt;/tt&amp;gt;. Also select Drawing method CPK, sphere scale 0.8 and Bond Radius 0.&lt;br /&gt;
* In the Selected Atoms line, input &amp;lt;tt&amp;gt;name O&amp;lt;/tt&amp;gt;. Also select Drawing method CPK, sphere scale 0.6 and Bond Radius 0.&lt;br /&gt;
&lt;br /&gt;
This should produce a ball representation of our model DNA. Bonds&lt;br /&gt;
automatically produced by VMD are NOT meaningful in our context.&lt;br /&gt;
&lt;br /&gt;
===pdb format===&lt;br /&gt;
Run &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;$oxDNA/UTILS/traj2vis.py xyz &amp;lt;trajectory&amp;gt; &amp;lt;topology&amp;gt; &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to produce a trajectory/configuration in the pdb format. A further file&lt;br /&gt;
called &amp;lt;tt&amp;gt;chimera.com&amp;lt;/tt&amp;gt; will be produced (more on this later). All&lt;br /&gt;
comments above about periodic boundaries and centre of mass apply here as&lt;br /&gt;
well.&lt;br /&gt;
&lt;br /&gt;
The pdb file can be visualised in VMD just like the xyz format, but a nicer&lt;br /&gt;
output can be produced with [http://www.cgl.ucsf.edu/chimera/ UCSF Chimera] (although only for snapshots at&lt;br /&gt;
the moment) as follows:&lt;br /&gt;
&lt;br /&gt;
Run chimera and load the pdb file. An ugly output will be displayed.&lt;br /&gt;
&lt;br /&gt;
Bring up the command line under the &amp;lt;tt&amp;gt;Tools → General Controls&amp;lt;/tt&amp;gt; menu.&lt;br /&gt;
Input &amp;lt;tt&amp;gt;read chimera.com&amp;lt;/tt&amp;gt; in the command line and press enter. You&lt;br /&gt;
should get a nicer visualisation with different bases in different colors,&lt;br /&gt;
all the covalent bonds in the right place, etc.&lt;br /&gt;
&lt;br /&gt;
On large configurations, the production of ellipsoids will be extremely&lt;br /&gt;
slow. You can remove it by removing the line&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;aniso scale 0.75 smoothing 4&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
from the commands file. Loading the resulting file should be much faster.&lt;br /&gt;
&lt;br /&gt;
UCSF chimera can in turn export the scene in a variety of formats.&lt;/div&gt;</summary>
		<author><name>Rovigatti</name></author>
	</entry>
	<entry>
		<id>https://dna.physics.ox.ac.uk/index.php?title=Model_introduction&amp;diff=518</id>
		<title>Model introduction</title>
		<link rel="alternate" type="text/html" href="https://dna.physics.ox.ac.uk/index.php?title=Model_introduction&amp;diff=518"/>
		<updated>2012-04-20T09:32:47Z</updated>

		<summary type="html">&lt;p&gt;Rovigatti: /* Simulation units */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The model treats DNA as a string of rigid nucleotides, which interact through potentials which depend on the position and orientation of the nucleotides. The interactions are:&lt;br /&gt;
#Sugar-phosphate backbone connectivity,&lt;br /&gt;
#Excluded volume,&lt;br /&gt;
#Hydrogen bonding,&lt;br /&gt;
#Nearest-neighbour stacking,&lt;br /&gt;
#Cross-stacking between base-pair steps in a duplex,&lt;br /&gt;
#Coaxial stacking.&lt;br /&gt;
&lt;br /&gt;
This interactions are illustrated below. Orientational modulations of the stacking potential encourage the bases to form coplanar stacks, the twist arising from the different length scales of the backbone separation and the optimum stacking separation. The possibility of unstacking allows single strands to be very flexible. Hydrogen bonding  can occur between complementary bases when they are anti-aligned, leading to the formation of double helical structures.&lt;br /&gt;
&lt;br /&gt;
http://www-thphys.physics.ox.ac.uk/people/ThomasOuldridge/Site/The_model.png&lt;br /&gt;
&lt;br /&gt;
(a) Model interaction sites with their interaction ranges (the typical range of an interaction is twice the radius of the sphere shown).&lt;br /&gt;
&lt;br /&gt;
(b) Representation of these interaction site in a visualisation that makes the planarity of the base clear.&lt;br /&gt;
&lt;br /&gt;
(c) A duplex in this representation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
http://www-thphys.physics.ox.ac.uk/people/ThomasOuldridge/Site/interactions.png&lt;br /&gt;
&lt;br /&gt;
Indication of the interactions which hold together a typical duplex. V(b.b.) indicates the phosphate-sugar backbone connectivity.&lt;br /&gt;
&lt;br /&gt;
In the original model, all complementary base pairs and stacking partners interact with the same strength (there is no attractive interaction between non-complementary bases). A preliminary sequence-dependent parameterisation of the hydrogen-bonding and stacking interactions is included as an option in the code release: a paper discussing this parameterisation and its effects is currently in preparation.&lt;br /&gt;
&lt;br /&gt;
The model does not incorporate the differentiation between the major and minor grooves of DNA double helices, and incorporates electrostatics only through the short-ranged excluded volume. For this reason, it is only appropriate for the study of systems at high salt concentration, when electrostatic interactions are strongly screened.&lt;br /&gt;
&lt;br /&gt;
===Simulation units===&lt;br /&gt;
The code uses dimensionless energy, mass, length and timescales for convenience. The relationship between simulation units (SU) and SI units is given below.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
! Simulation unit &lt;br /&gt;
! Physical unit&lt;br /&gt;
|-&lt;br /&gt;
| 1 unit of length&lt;br /&gt;
| 8.518x10&amp;lt;math&amp;gt;^{-10}&amp;lt;/math&amp;gt; m&lt;br /&gt;
|-&lt;br /&gt;
| 1 unit of energy&lt;br /&gt;
| 4.142&amp;lt;math&amp;gt;^{-20}&amp;lt;/math&amp;gt; J&lt;br /&gt;
|-&lt;br /&gt;
| 1 unit of Temperature      &lt;br /&gt;
| 3000 K&lt;br /&gt;
|-&lt;br /&gt;
| 1 unit of Force&lt;br /&gt;
| 4.863&amp;lt;math&amp;gt;^{-11}&amp;lt;/math&amp;gt; N&lt;br /&gt;
|-&lt;br /&gt;
| 1 unit of Mass&lt;br /&gt;
| 1.66&amp;lt;math&amp;gt;^{-25}&amp;lt;/math&amp;gt; kg&lt;br /&gt;
|-&lt;br /&gt;
| 1 unit of Time&lt;br /&gt;
| 1.71&amp;lt;math&amp;gt;^{-12}&amp;lt;/math&amp;gt; s&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The model and its performance is discussed in detail in the following references (the thesis provides the most complete analysis):&lt;br /&gt;
&lt;br /&gt;
T. E. Ouldridge, D.Phil. Thesis, University of Oxford, 2011.&lt;br /&gt;
[http://ora.ox.ac.uk/objects/uuid:b2415bb2-7975-4f59-b5e2-8c022b4a3719 Coarse-grained modelling of DNA and DNA self-assembly]&lt;br /&gt;
&lt;br /&gt;
T. E. Ouldridge, A. A. Louis and J. P. K. Doye, J. Chem. Phys, 134, 085101 (2011)&lt;br /&gt;
[http://link.aip.org/link/?JCP/134/085101 Structural, mechanical and thermodynamic properties of a coarse-grained DNA model] ([http://arxiv.org/abs/arXiv:1009.4480 arXiv])&lt;/div&gt;</summary>
		<author><name>Rovigatti</name></author>
	</entry>
	<entry>
		<id>https://dna.physics.ox.ac.uk/index.php?title=Hairpin_formation&amp;diff=509</id>
		<title>Hairpin formation</title>
		<link rel="alternate" type="text/html" href="https://dna.physics.ox.ac.uk/index.php?title=Hairpin_formation&amp;diff=509"/>
		<updated>2012-04-19T15:23:07Z</updated>

		<summary type="html">&lt;p&gt;Rovigatti: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;!--&amp;lt;div style=&amp;quot;text-align:center&amp;quot;&amp;gt;&lt;br /&gt;
http://kratos.phys.uniroma1.it/hairpin.png&lt;br /&gt;
&amp;lt;/div&amp;gt;--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Examples]]&lt;br /&gt;
== Introduction ==&lt;br /&gt;
In this example, you will simulate a single strand of length 18 and sequence &amp;lt;tt&amp;gt;GCGTTGCTTCTCCAACGC&amp;lt;/tt&amp;gt; at 334 K (~61 °C) in three different ways:&lt;br /&gt;
* with a molecular dynamics (MD) simulation of the sequence-averaged (SA) model. The input file is &amp;lt;tt&amp;gt;inputMD&amp;lt;/tt&amp;gt;.&lt;br /&gt;
* with an MD simulation of the sequence-dependent (SD) model. The input file is &amp;lt;code&amp;gt;inputMD_seq_dep&amp;lt;/code&amp;gt;.&lt;br /&gt;
* with a Monte Carlo (MC) simulation of the SA model in which two base pairs are connected by mutual traps (i.e. additional attractive interactions between two nucleotides). The input file is &amp;lt;tt&amp;gt;inputTRAP&amp;lt;/tt&amp;gt;.&lt;br /&gt;
The traps act between the pairs depicted in blue and red in the sequence G&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;C&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;G&amp;lt;/span&amp;gt;TTGCTTCTCCAA&amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;C&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;G&amp;lt;/span&amp;gt;C. The details of the interaction associated to the traps can be changed in the file &amp;lt;tt&amp;gt;hairpin_forces.dat&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
This strand, if &#039;&#039;T&#039;&#039; is sufficiently low, tends to form an hairpin with a 6-base long stem and a 6-base long loop.&lt;br /&gt;
The temperature has been chosen to be close to the melting temperature of such a hairpin in the SA version of the  model&lt;br /&gt;
&lt;br /&gt;
This document explains how to prepare the &#039;&#039;hairpin&#039;&#039; example (see [[#Preparation|Preparation]]) and how to run it ([[#Running|Running]]). Section [[#Results|Results]] contains results and plots extracted from the simulation output. In the following, &amp;lt;tt&amp;gt;$EXEC&amp;lt;/tt&amp;gt; refers to the oxDNA executable.&lt;br /&gt;
&lt;br /&gt;
== Preparation ==&lt;br /&gt;
The script &amp;lt;tt&amp;gt;run.sh&amp;lt;/tt&amp;gt; generates the input files and runs all the three simulations, one after the other. With the default input files, each simulation, lasting &amp;lt;math&amp;gt;10^8&amp;lt;/math&amp;gt; steps by default, takes approximately one hour on a modern CPU. The default &amp;lt;tt&amp;gt;run.sh&amp;lt;/tt&amp;gt; expects &amp;lt;tt&amp;gt;$EXEC&amp;lt;/tt&amp;gt; to be in the &amp;lt;tt&amp;gt;../..&amp;lt;/tt&amp;gt; directory. If this is not the case, open &amp;lt;tt&amp;gt;run.sh&amp;lt;/tt&amp;gt; and change the variable &amp;lt;tt&amp;gt;CODEDIR&amp;lt;/tt&amp;gt; accordingly.&lt;br /&gt;
&lt;br /&gt;
If you only want to generate the initial configuration, you can issue &amp;lt;tt&amp;gt;./run.sh --generate-only&amp;lt;/tt&amp;gt;. Then you can run the simulations by yourself. The generated initial configuration files are &amp;lt;tt&amp;gt;initial.top&amp;lt;/tt&amp;gt; (which contains the topology) and &amp;lt;tt&amp;gt;initial.conf&amp;lt;/tt&amp;gt; (which contains positions and orientations of the nucleotides).&lt;br /&gt;
&lt;br /&gt;
== Running ==&lt;br /&gt;
In order to run the whole example, it is sufficient to issue the command &amp;lt;tt&amp;gt;./run.sh&amp;lt;/tt&amp;gt; (or &amp;lt;tt&amp;gt;bash run.sh&amp;lt;/tt&amp;gt;). As described in [[#Preparation|Preparation]], you can generate the initial configuration and then run the simulations by hand. The three simulations, described in [[#Introduction|Introduction]], can be performed issuing &amp;lt;tt&amp;gt;$EXEC input&amp;lt;/tt&amp;gt;, where &amp;lt;tt&amp;gt;input&amp;lt;/tt&amp;gt; is a text file that specifies the simulation configuration. For this example, three files have been prepared: &amp;lt;tt&amp;gt;inputMD&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;inputMD_seq_dep&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;inputTRAP&amp;lt;/tt&amp;gt;. The table below reports all the files associated to each simulations.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
! Type &lt;br /&gt;
! Input&lt;br /&gt;
! energy file&lt;br /&gt;
! trajectory file&lt;br /&gt;
! last configuration file&lt;br /&gt;
! log file&lt;br /&gt;
|-&lt;br /&gt;
|SA model&lt;br /&gt;
|inputMD&lt;br /&gt;
|energy.dat&lt;br /&gt;
|trajectory.dat&lt;br /&gt;
|last_conf.dat&lt;br /&gt;
|log.dat&lt;br /&gt;
|-&lt;br /&gt;
|SD model&lt;br /&gt;
|inputMD_seq_dep&lt;br /&gt;
|energy_seq_dep.dat&lt;br /&gt;
|trajectory_seq_dep.dat&lt;br /&gt;
|last_conf_seq_dep.dat&lt;br /&gt;
|log_seq_dep.dat&lt;br /&gt;
|-&lt;br /&gt;
|SA model with traps&lt;br /&gt;
|inputTRAP&lt;br /&gt;
|energy_trap.dat&lt;br /&gt;
|trajectory_trap.dat&lt;br /&gt;
|last_conf_trap.dat&lt;br /&gt;
|log_trap.dat&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Results ==&lt;br /&gt;
As mentioned in the [[#Introduction|Introduction]], temperature has been chosen so that the hairpin is near its melting temperature when simulated via SA model. Figure 1 shows the probability distribution histogram &amp;lt;math&amp;gt;P(U_{HB})&amp;lt;/math&amp;gt; for the hydrogen-bonding (HB) energy &amp;lt;math&amp;gt;U_{HB}&amp;lt;/math&amp;gt; of the system (in simulation units. Both the minimum in &amp;lt;math&amp;gt;P(U_{HB})&amp;lt;/math&amp;gt; and a direct inspection of the time series (inset) show that the hairpin is indeed near the melting temperature, since &amp;lt;math&amp;gt;U_{HB}&amp;lt;/math&amp;gt; oscillates between 0 (no HBs) and ~ -3.5, which corresponds to 4-5 hydrogen-bonded nucleotides. At this temperature the fraying effect is relevant, and therefore the last base-pair is not always formed. This is clearly visible in the snapshot at the beginning of this document, in which 4 base-pairs are formed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align:center&amp;quot;&amp;gt;&lt;br /&gt;
http://kratos.phys.uniroma1.it/histo_MD.png&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h5&amp;gt;Figure 1: Probability of having a hydrogen-bonding interaction energy &amp;lt;math&amp;gt;U_{HB}&amp;lt;/math&amp;gt; for the SA model. Inset: time series of the hydrogen-bonding energy (stored in the fifth column of the energy file as a function of MD steps.&amp;lt;/h5&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Figure 2 shows &amp;lt;math&amp;gt;P(U_{HB})&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;U_{HB}&amp;lt;/math&amp;gt; for the SD hairpin. In this case, one expects a different melting temperature. Indeed, at this temperature the hairpin is nearly always in its folded conformation and the average value of &amp;lt;math&amp;gt;U_{HB}&amp;lt;/math&amp;gt; is lower than in the SA case. Although stacking interactions play a role, the major contribution to this effect is due to the presence of four &amp;lt;tt&amp;gt;GC&amp;lt;/tt&amp;gt; only two &amp;lt;tt&amp;gt;AT&amp;lt;/tt&amp;gt; base-pairs in the stem.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align:center&amp;quot;&amp;gt;&lt;br /&gt;
http://kratos.phys.uniroma1.it/histo_MD_seq_dep.png&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h5&amp;gt;Figure 2: Same as Figure 1, but for the SD model.&amp;lt;/h5&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If mutual traps between stem base-pairs are introduced, then the equilibrium properties of the hairpin are changed and, even if the SA model is employed, the hairpin is always (after the initial equilibration) in its folded conformation. The use of mutual traps can highly decrease the simulation time required by the folding of strands into target structures (like DNA origami or DNA constructs).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align:center&amp;quot;&amp;gt;&lt;br /&gt;
http://kratos.phys.uniroma1.it/histo_TRAP.png&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h5&amp;gt;Figure 3: Same as Figure 1, but for the system with mutual traps. Time is expressed in Monte Carlo sweeps.&amp;lt;/h5&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;/div&gt;</summary>
		<author><name>Rovigatti</name></author>
	</entry>
	<entry>
		<id>https://dna.physics.ox.ac.uk/index.php?title=Hairpin_formation&amp;diff=508</id>
		<title>Hairpin formation</title>
		<link rel="alternate" type="text/html" href="https://dna.physics.ox.ac.uk/index.php?title=Hairpin_formation&amp;diff=508"/>
		<updated>2012-04-19T15:21:49Z</updated>

		<summary type="html">&lt;p&gt;Rovigatti: /* Results */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Examples]]&lt;br /&gt;
== Introduction ==&lt;br /&gt;
In this example, you will simulate a single strand of length 18 and sequence &amp;lt;tt&amp;gt;GCGTTGCTTCTCCAACGC&amp;lt;/tt&amp;gt; at 334 K (~61 °C) in three different ways:&lt;br /&gt;
* with a molecular dynamics (MD) simulation of the sequence-averaged (SA) model. The input file is &amp;lt;tt&amp;gt;inputMD&amp;lt;/tt&amp;gt;.&lt;br /&gt;
* with an MD simulation of the sequence-dependent (SD) model. The input file is &amp;lt;code&amp;gt;inputMD_seq_dep&amp;lt;/code&amp;gt;.&lt;br /&gt;
* with a Monte Carlo (MC) simulation of the SA model in which two base pairs are connected by mutual traps (i.e. additional attractive interactions between two nucleotides). The input file is &amp;lt;tt&amp;gt;inputTRAP&amp;lt;/tt&amp;gt;.&lt;br /&gt;
The traps act between the pairs depicted in blue and red in the sequence G&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;C&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;G&amp;lt;/span&amp;gt;TTGCTTCTCCAA&amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;C&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;G&amp;lt;/span&amp;gt;C. The details of the interaction associated to the traps can be changed in the file &amp;lt;tt&amp;gt;hairpin_forces.dat&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
This strand, if &#039;&#039;T&#039;&#039; is sufficiently low, tends to form an hairpin with a 6-base long stem and a 6-base long loop.&lt;br /&gt;
The temperature has been chosen to be close to the melting temperature of such a hairpin in the SA version of the  model&lt;br /&gt;
&lt;br /&gt;
This document explains how to prepare the &#039;&#039;hairpin&#039;&#039; example (see [[#Preparation|Preparation]]) and how to run it ([[#Running|Running]]). Section [[#Results|Results]] contains results and plots extracted from the simulation output. In the following, &amp;lt;tt&amp;gt;$EXEC&amp;lt;/tt&amp;gt; refers to the oxDNA executable.&lt;br /&gt;
&lt;br /&gt;
== Preparation ==&lt;br /&gt;
The script &amp;lt;tt&amp;gt;run.sh&amp;lt;/tt&amp;gt; generates the input files and runs all the three simulations, one after the other. With the default input files, each simulation, lasting &amp;lt;math&amp;gt;10^8&amp;lt;/math&amp;gt; steps by default, takes approximately one hour on a modern CPU. The default &amp;lt;tt&amp;gt;run.sh&amp;lt;/tt&amp;gt; expects &amp;lt;tt&amp;gt;$EXEC&amp;lt;/tt&amp;gt; to be in the &amp;lt;tt&amp;gt;../..&amp;lt;/tt&amp;gt; directory. If this is not the case, open &amp;lt;tt&amp;gt;run.sh&amp;lt;/tt&amp;gt; and change the variable &amp;lt;tt&amp;gt;CODEDIR&amp;lt;/tt&amp;gt; accordingly.&lt;br /&gt;
&lt;br /&gt;
If you only want to generate the initial configuration, you can issue &amp;lt;tt&amp;gt;./run.sh --generate-only&amp;lt;/tt&amp;gt;. Then you can run the simulations by yourself. The generated initial configuration files are &amp;lt;tt&amp;gt;initial.top&amp;lt;/tt&amp;gt; (which contains the topology) and &amp;lt;tt&amp;gt;initial.conf&amp;lt;/tt&amp;gt; (which contains positions and orientations of the nucleotides).&lt;br /&gt;
&lt;br /&gt;
== Running ==&lt;br /&gt;
In order to run the whole example, it is sufficient to issue the command &amp;lt;tt&amp;gt;./run.sh&amp;lt;/tt&amp;gt; (or &amp;lt;tt&amp;gt;bash run.sh&amp;lt;/tt&amp;gt;). As described in [[#Preparation|Preparation]], you can generate the initial configuration and then run the simulations by hand. The three simulations, described in [[#Introduction|Introduction]], can be performed issuing &amp;lt;tt&amp;gt;$EXEC input&amp;lt;/tt&amp;gt;, where &amp;lt;tt&amp;gt;input&amp;lt;/tt&amp;gt; is a text file that specifies the simulation configuration. For this example, three files have been prepared: &amp;lt;tt&amp;gt;inputMD&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;inputMD_seq_dep&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;inputTRAP&amp;lt;/tt&amp;gt;. The table below reports all the files associated to each simulations.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
! Type &lt;br /&gt;
! Input&lt;br /&gt;
! energy file&lt;br /&gt;
! trajectory file&lt;br /&gt;
! last configuration file&lt;br /&gt;
! log file&lt;br /&gt;
|-&lt;br /&gt;
|SA model&lt;br /&gt;
|inputMD&lt;br /&gt;
|energy.dat&lt;br /&gt;
|trajectory.dat&lt;br /&gt;
|last_conf.dat&lt;br /&gt;
|log.dat&lt;br /&gt;
|-&lt;br /&gt;
|SD model&lt;br /&gt;
|inputMD_seq_dep&lt;br /&gt;
|energy_seq_dep.dat&lt;br /&gt;
|trajectory_seq_dep.dat&lt;br /&gt;
|last_conf_seq_dep.dat&lt;br /&gt;
|log_seq_dep.dat&lt;br /&gt;
|-&lt;br /&gt;
|SA model with traps&lt;br /&gt;
|inputTRAP&lt;br /&gt;
|energy_trap.dat&lt;br /&gt;
|trajectory_trap.dat&lt;br /&gt;
|last_conf_trap.dat&lt;br /&gt;
|log_trap.dat&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Results ==&lt;br /&gt;
As mentioned in the [[#Introduction|Introduction]], temperature has been chosen so that the hairpin is near its melting temperature when simulated via SA model. Figure 1 shows the probability distribution histogram &amp;lt;math&amp;gt;P(U_{HB})&amp;lt;/math&amp;gt; for the hydrogen-bonding (HB) energy &amp;lt;math&amp;gt;U_{HB}&amp;lt;/math&amp;gt; of the system (in simulation units. Both the minimum in &amp;lt;math&amp;gt;P(U_{HB})&amp;lt;/math&amp;gt; and a direct inspection of the time series (inset) show that the hairpin is indeed near the melting temperature, since &amp;lt;math&amp;gt;U_{HB}&amp;lt;/math&amp;gt; oscillates between 0 (no HBs) and ~ -3.5, which corresponds to 4-5 hydrogen-bonded nucleotides. At this temperature the fraying effect is relevant, and therefore the last base-pair is not always formed. This is clearly visible in the snapshot at the beginning of this document, in which 4 base-pairs are formed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align:center&amp;quot;&amp;gt;&lt;br /&gt;
http://kratos.phys.uniroma1.it/histo_MD.png&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h5&amp;gt;Figure 1: Probability of having a hydrogen-bonding interaction energy &amp;lt;math&amp;gt;U_{HB}&amp;lt;/math&amp;gt; for the SA model. Inset: time series of the hydrogen-bonding energy (stored in the fifth column of the energy file as a function of MD steps.&amp;lt;/h5&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Figure 2 shows &amp;lt;math&amp;gt;P(U_{HB})&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;U_{HB}&amp;lt;/math&amp;gt; for the SD hairpin. In this case, one expects a different melting temperature. Indeed, at this temperature the hairpin is nearly always in its folded conformation and the average value of &amp;lt;math&amp;gt;U_{HB}&amp;lt;/math&amp;gt; is lower than in the SA case. Although stacking interactions play a role, the major contribution to this effect is due to the presence of four &amp;lt;tt&amp;gt;GC&amp;lt;/tt&amp;gt; only two &amp;lt;tt&amp;gt;AT&amp;lt;/tt&amp;gt; base-pairs in the stem.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align:center&amp;quot;&amp;gt;&lt;br /&gt;
http://kratos.phys.uniroma1.it/histo_MD_seq_dep.png&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h5&amp;gt;Figure 2: Same as Figure 1, but for the SD model.&amp;lt;/h5&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If mutual traps between stem base-pairs are introduced, then the equilibrium properties of the hairpin are changed and, even if the SA model is employed, the hairpin is always (after the initial equilibration) in its folded conformation. The use of mutual traps can highly decrease the simulation time required by the folding of strands into target structures (like DNA origami or DNA constructs).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align:center&amp;quot;&amp;gt;&lt;br /&gt;
http://kratos.phys.uniroma1.it/histo_TRAP.png&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h5&amp;gt;Figure 3: Same as Figure 1, but for the system with mutual traps. Time is expressed in Monte Carlo sweeps.&amp;lt;/h5&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;/div&gt;</summary>
		<author><name>Rovigatti</name></author>
	</entry>
	<entry>
		<id>https://dna.physics.ox.ac.uk/index.php?title=Hairpin_formation&amp;diff=507</id>
		<title>Hairpin formation</title>
		<link rel="alternate" type="text/html" href="https://dna.physics.ox.ac.uk/index.php?title=Hairpin_formation&amp;diff=507"/>
		<updated>2012-04-19T15:21:39Z</updated>

		<summary type="html">&lt;p&gt;Rovigatti: /* Running */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Examples]]&lt;br /&gt;
== Introduction ==&lt;br /&gt;
In this example, you will simulate a single strand of length 18 and sequence &amp;lt;tt&amp;gt;GCGTTGCTTCTCCAACGC&amp;lt;/tt&amp;gt; at 334 K (~61 °C) in three different ways:&lt;br /&gt;
* with a molecular dynamics (MD) simulation of the sequence-averaged (SA) model. The input file is &amp;lt;tt&amp;gt;inputMD&amp;lt;/tt&amp;gt;.&lt;br /&gt;
* with an MD simulation of the sequence-dependent (SD) model. The input file is &amp;lt;code&amp;gt;inputMD_seq_dep&amp;lt;/code&amp;gt;.&lt;br /&gt;
* with a Monte Carlo (MC) simulation of the SA model in which two base pairs are connected by mutual traps (i.e. additional attractive interactions between two nucleotides). The input file is &amp;lt;tt&amp;gt;inputTRAP&amp;lt;/tt&amp;gt;.&lt;br /&gt;
The traps act between the pairs depicted in blue and red in the sequence G&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;C&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;G&amp;lt;/span&amp;gt;TTGCTTCTCCAA&amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;C&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;G&amp;lt;/span&amp;gt;C. The details of the interaction associated to the traps can be changed in the file &amp;lt;tt&amp;gt;hairpin_forces.dat&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
This strand, if &#039;&#039;T&#039;&#039; is sufficiently low, tends to form an hairpin with a 6-base long stem and a 6-base long loop.&lt;br /&gt;
The temperature has been chosen to be close to the melting temperature of such a hairpin in the SA version of the  model&lt;br /&gt;
&lt;br /&gt;
This document explains how to prepare the &#039;&#039;hairpin&#039;&#039; example (see [[#Preparation|Preparation]]) and how to run it ([[#Running|Running]]). Section [[#Results|Results]] contains results and plots extracted from the simulation output. In the following, &amp;lt;tt&amp;gt;$EXEC&amp;lt;/tt&amp;gt; refers to the oxDNA executable.&lt;br /&gt;
&lt;br /&gt;
== Preparation ==&lt;br /&gt;
The script &amp;lt;tt&amp;gt;run.sh&amp;lt;/tt&amp;gt; generates the input files and runs all the three simulations, one after the other. With the default input files, each simulation, lasting &amp;lt;math&amp;gt;10^8&amp;lt;/math&amp;gt; steps by default, takes approximately one hour on a modern CPU. The default &amp;lt;tt&amp;gt;run.sh&amp;lt;/tt&amp;gt; expects &amp;lt;tt&amp;gt;$EXEC&amp;lt;/tt&amp;gt; to be in the &amp;lt;tt&amp;gt;../..&amp;lt;/tt&amp;gt; directory. If this is not the case, open &amp;lt;tt&amp;gt;run.sh&amp;lt;/tt&amp;gt; and change the variable &amp;lt;tt&amp;gt;CODEDIR&amp;lt;/tt&amp;gt; accordingly.&lt;br /&gt;
&lt;br /&gt;
If you only want to generate the initial configuration, you can issue &amp;lt;tt&amp;gt;./run.sh --generate-only&amp;lt;/tt&amp;gt;. Then you can run the simulations by yourself. The generated initial configuration files are &amp;lt;tt&amp;gt;initial.top&amp;lt;/tt&amp;gt; (which contains the topology) and &amp;lt;tt&amp;gt;initial.conf&amp;lt;/tt&amp;gt; (which contains positions and orientations of the nucleotides).&lt;br /&gt;
&lt;br /&gt;
== Running ==&lt;br /&gt;
In order to run the whole example, it is sufficient to issue the command &amp;lt;tt&amp;gt;./run.sh&amp;lt;/tt&amp;gt; (or &amp;lt;tt&amp;gt;bash run.sh&amp;lt;/tt&amp;gt;). As described in [[#Preparation|Preparation]], you can generate the initial configuration and then run the simulations by hand. The three simulations, described in [[#Introduction|Introduction]], can be performed issuing &amp;lt;tt&amp;gt;$EXEC input&amp;lt;/tt&amp;gt;, where &amp;lt;tt&amp;gt;input&amp;lt;/tt&amp;gt; is a text file that specifies the simulation configuration. For this example, three files have been prepared: &amp;lt;tt&amp;gt;inputMD&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;inputMD_seq_dep&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;inputTRAP&amp;lt;/tt&amp;gt;. The table below reports all the files associated to each simulations.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
! Type &lt;br /&gt;
! Input&lt;br /&gt;
! energy file&lt;br /&gt;
! trajectory file&lt;br /&gt;
! last configuration file&lt;br /&gt;
! log file&lt;br /&gt;
|-&lt;br /&gt;
|SA model&lt;br /&gt;
|inputMD&lt;br /&gt;
|energy.dat&lt;br /&gt;
|trajectory.dat&lt;br /&gt;
|last_conf.dat&lt;br /&gt;
|log.dat&lt;br /&gt;
|-&lt;br /&gt;
|SD model&lt;br /&gt;
|inputMD_seq_dep&lt;br /&gt;
|energy_seq_dep.dat&lt;br /&gt;
|trajectory_seq_dep.dat&lt;br /&gt;
|last_conf_seq_dep.dat&lt;br /&gt;
|log_seq_dep.dat&lt;br /&gt;
|-&lt;br /&gt;
|SA model with traps&lt;br /&gt;
|inputTRAP&lt;br /&gt;
|energy_trap.dat&lt;br /&gt;
|trajectory_trap.dat&lt;br /&gt;
|last_conf_trap.dat&lt;br /&gt;
|log_trap.dat&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Results ==&lt;br /&gt;
As mentioned in the [[#Introduction|Introduction]], temperature has been chosen so that the hairpin is near its melting temperature when simulated via SA model. Figure 1 shows the probability distribution histogram &amp;lt;math&amp;gt;P(U_{HB})&amp;lt;/math&amp;gt; for the hydrogen-bonding (HB) energy &amp;lt;math&amp;gt;U_{HB}&amp;lt;/math&amp;gt; of the system (in simulation units. Both the minimum in &amp;lt;math&amp;gt;P(U_{HB})&amp;lt;/math&amp;gt; and a direct inspection of the time series (inset) show that the hairpin is indeed near the melting temperature, since &amp;lt;math&amp;gt;U_{HB}&amp;lt;/math&amp;gt; oscillates between 0 (no HBs) and ~ -3.5, which corresponds to 4-5 hydrogen-bonded nucleotides. At this temperature the fraying effect is relevant, and therefore the last base-pair is not always formed~\cite{ouldridge_jcp}. This is clearly visible in the snapshot at the beginning of this document, in which 4 base-pairs are formed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align:center&amp;quot;&amp;gt;&lt;br /&gt;
http://kratos.phys.uniroma1.it/histo_MD.png&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h5&amp;gt;Figure 1: Probability of having a hydrogen-bonding interaction energy &amp;lt;math&amp;gt;U_{HB}&amp;lt;/math&amp;gt; for the SA model. Inset: time series of the hydrogen-bonding energy (stored in the fifth column of the energy file as a function of MD steps.&amp;lt;/h5&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Figure 2 shows &amp;lt;math&amp;gt;P(U_{HB})&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;U_{HB}&amp;lt;/math&amp;gt; for the SD hairpin. In this case, one expects a different melting temperature. Indeed, at this temperature the hairpin is nearly always in its folded conformation and the average value of &amp;lt;math&amp;gt;U_{HB}&amp;lt;/math&amp;gt; is lower than in the SA case. Although stacking interactions play a role, the major contribution to this effect is due to the presence of four &amp;lt;tt&amp;gt;GC&amp;lt;/tt&amp;gt; only two &amp;lt;tt&amp;gt;AT&amp;lt;/tt&amp;gt; base-pairs in the stem.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align:center&amp;quot;&amp;gt;&lt;br /&gt;
http://kratos.phys.uniroma1.it/histo_MD_seq_dep.png&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h5&amp;gt;Figure 2: Same as Figure 1, but for the SD model.&amp;lt;/h5&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If mutual traps between stem base-pairs are introduced, then the equilibrium properties of the hairpin are changed and, even if the SA model is employed, the hairpin is always (after the initial equilibration) in its folded conformation. The use of mutual traps can highly decrease the simulation time required by the folding of strands into target structures (like DNA origami or DNA constructs).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align:center&amp;quot;&amp;gt;&lt;br /&gt;
http://kratos.phys.uniroma1.it/histo_TRAP.png&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h5&amp;gt;Figure 3: Same as Figure 1, but for the system with mutual traps. Time is expressed in Monte Carlo sweeps.&amp;lt;/h5&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;/div&gt;</summary>
		<author><name>Rovigatti</name></author>
	</entry>
	<entry>
		<id>https://dna.physics.ox.ac.uk/index.php?title=Hairpin_formation&amp;diff=506</id>
		<title>Hairpin formation</title>
		<link rel="alternate" type="text/html" href="https://dna.physics.ox.ac.uk/index.php?title=Hairpin_formation&amp;diff=506"/>
		<updated>2012-04-19T15:21:10Z</updated>

		<summary type="html">&lt;p&gt;Rovigatti: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Examples]]&lt;br /&gt;
== Introduction ==&lt;br /&gt;
In this example, you will simulate a single strand of length 18 and sequence &amp;lt;tt&amp;gt;GCGTTGCTTCTCCAACGC&amp;lt;/tt&amp;gt; at 334 K (~61 °C) in three different ways:&lt;br /&gt;
* with a molecular dynamics (MD) simulation of the sequence-averaged (SA) model. The input file is &amp;lt;tt&amp;gt;inputMD&amp;lt;/tt&amp;gt;.&lt;br /&gt;
* with an MD simulation of the sequence-dependent (SD) model. The input file is &amp;lt;code&amp;gt;inputMD_seq_dep&amp;lt;/code&amp;gt;.&lt;br /&gt;
* with a Monte Carlo (MC) simulation of the SA model in which two base pairs are connected by mutual traps (i.e. additional attractive interactions between two nucleotides). The input file is &amp;lt;tt&amp;gt;inputTRAP&amp;lt;/tt&amp;gt;.&lt;br /&gt;
The traps act between the pairs depicted in blue and red in the sequence G&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;C&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;G&amp;lt;/span&amp;gt;TTGCTTCTCCAA&amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;C&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;G&amp;lt;/span&amp;gt;C. The details of the interaction associated to the traps can be changed in the file &amp;lt;tt&amp;gt;hairpin_forces.dat&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
This strand, if &#039;&#039;T&#039;&#039; is sufficiently low, tends to form an hairpin with a 6-base long stem and a 6-base long loop.&lt;br /&gt;
The temperature has been chosen to be close to the melting temperature of such a hairpin in the SA version of the  model&lt;br /&gt;
&lt;br /&gt;
This document explains how to prepare the &#039;&#039;hairpin&#039;&#039; example (see [[#Preparation|Preparation]]) and how to run it ([[#Running|Running]]). Section [[#Results|Results]] contains results and plots extracted from the simulation output. In the following, &amp;lt;tt&amp;gt;$EXEC&amp;lt;/tt&amp;gt; refers to the oxDNA executable.&lt;br /&gt;
&lt;br /&gt;
== Preparation ==&lt;br /&gt;
The script &amp;lt;tt&amp;gt;run.sh&amp;lt;/tt&amp;gt; generates the input files and runs all the three simulations, one after the other. With the default input files, each simulation, lasting &amp;lt;math&amp;gt;10^8&amp;lt;/math&amp;gt; steps by default, takes approximately one hour on a modern CPU. The default &amp;lt;tt&amp;gt;run.sh&amp;lt;/tt&amp;gt; expects &amp;lt;tt&amp;gt;$EXEC&amp;lt;/tt&amp;gt; to be in the &amp;lt;tt&amp;gt;../..&amp;lt;/tt&amp;gt; directory. If this is not the case, open &amp;lt;tt&amp;gt;run.sh&amp;lt;/tt&amp;gt; and change the variable &amp;lt;tt&amp;gt;CODEDIR&amp;lt;/tt&amp;gt; accordingly.&lt;br /&gt;
&lt;br /&gt;
If you only want to generate the initial configuration, you can issue &amp;lt;tt&amp;gt;./run.sh --generate-only&amp;lt;/tt&amp;gt;. Then you can run the simulations by yourself. The generated initial configuration files are &amp;lt;tt&amp;gt;initial.top&amp;lt;/tt&amp;gt; (which contains the topology) and &amp;lt;tt&amp;gt;initial.conf&amp;lt;/tt&amp;gt; (which contains positions and orientations of the nucleotides).&lt;br /&gt;
&lt;br /&gt;
== Running ==&lt;br /&gt;
In order to run the whole example, it is sufficient to issue the command &amp;lt;tt&amp;gt;./run.sh&amp;lt;/tt&amp;gt; (or &amp;lt;tt&amp;gt;bash run.sh&amp;lt;/tt&amp;gt;). As described in [[#Preparation|Preparation]], you can generate the initial configuration and then run the simulations by hand. The three simulations, described in [[#Introduction|Introduction]], can be performed issuing &amp;lt;tt&amp;gt;$EXEC input&amp;lt;/tt&amp;gt;, where &amp;lt;tt&amp;gt;input&amp;lt;/tt&amp;gt; is a text file that specifies the simulation configuration. For this example, three files have been prepared: &amp;lt;tt&amp;gt;inputMD&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;inputMD_seq_dep&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;inputTRAP&amp;lt;/tt&amp;gt;. Table~\ref{tbl:sim} report all the files associated to each simulations.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
! Type &lt;br /&gt;
! Input&lt;br /&gt;
! energy file&lt;br /&gt;
! trajectory file&lt;br /&gt;
! last configuration file&lt;br /&gt;
! log file&lt;br /&gt;
|-&lt;br /&gt;
|SA model&lt;br /&gt;
|inputMD&lt;br /&gt;
|energy.dat&lt;br /&gt;
|trajectory.dat&lt;br /&gt;
|last_conf.dat&lt;br /&gt;
|log.dat&lt;br /&gt;
|-&lt;br /&gt;
|SD model&lt;br /&gt;
|inputMD_seq_dep&lt;br /&gt;
|energy_seq_dep.dat&lt;br /&gt;
|trajectory_seq_dep.dat&lt;br /&gt;
|last_conf_seq_dep.dat&lt;br /&gt;
|log_seq_dep.dat&lt;br /&gt;
|-&lt;br /&gt;
|SA model with traps&lt;br /&gt;
|inputTRAP&lt;br /&gt;
|energy_trap.dat&lt;br /&gt;
|trajectory_trap.dat&lt;br /&gt;
|last_conf_trap.dat&lt;br /&gt;
|log_trap.dat&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Results ==&lt;br /&gt;
As mentioned in the [[#Introduction|Introduction]], temperature has been chosen so that the hairpin is near its melting temperature when simulated via SA model. Figure 1 shows the probability distribution histogram &amp;lt;math&amp;gt;P(U_{HB})&amp;lt;/math&amp;gt; for the hydrogen-bonding (HB) energy &amp;lt;math&amp;gt;U_{HB}&amp;lt;/math&amp;gt; of the system (in simulation units. Both the minimum in &amp;lt;math&amp;gt;P(U_{HB})&amp;lt;/math&amp;gt; and a direct inspection of the time series (inset) show that the hairpin is indeed near the melting temperature, since &amp;lt;math&amp;gt;U_{HB}&amp;lt;/math&amp;gt; oscillates between 0 (no HBs) and ~ -3.5, which corresponds to 4-5 hydrogen-bonded nucleotides. At this temperature the fraying effect is relevant, and therefore the last base-pair is not always formed~\cite{ouldridge_jcp}. This is clearly visible in the snapshot at the beginning of this document, in which 4 base-pairs are formed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align:center&amp;quot;&amp;gt;&lt;br /&gt;
http://kratos.phys.uniroma1.it/histo_MD.png&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h5&amp;gt;Figure 1: Probability of having a hydrogen-bonding interaction energy &amp;lt;math&amp;gt;U_{HB}&amp;lt;/math&amp;gt; for the SA model. Inset: time series of the hydrogen-bonding energy (stored in the fifth column of the energy file as a function of MD steps.&amp;lt;/h5&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Figure 2 shows &amp;lt;math&amp;gt;P(U_{HB})&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;U_{HB}&amp;lt;/math&amp;gt; for the SD hairpin. In this case, one expects a different melting temperature. Indeed, at this temperature the hairpin is nearly always in its folded conformation and the average value of &amp;lt;math&amp;gt;U_{HB}&amp;lt;/math&amp;gt; is lower than in the SA case. Although stacking interactions play a role, the major contribution to this effect is due to the presence of four &amp;lt;tt&amp;gt;GC&amp;lt;/tt&amp;gt; only two &amp;lt;tt&amp;gt;AT&amp;lt;/tt&amp;gt; base-pairs in the stem.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align:center&amp;quot;&amp;gt;&lt;br /&gt;
http://kratos.phys.uniroma1.it/histo_MD_seq_dep.png&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h5&amp;gt;Figure 2: Same as Figure 1, but for the SD model.&amp;lt;/h5&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If mutual traps between stem base-pairs are introduced, then the equilibrium properties of the hairpin are changed and, even if the SA model is employed, the hairpin is always (after the initial equilibration) in its folded conformation. The use of mutual traps can highly decrease the simulation time required by the folding of strands into target structures (like DNA origami or DNA constructs).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align:center&amp;quot;&amp;gt;&lt;br /&gt;
http://kratos.phys.uniroma1.it/histo_TRAP.png&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h5&amp;gt;Figure 3: Same as Figure 1, but for the system with mutual traps. Time is expressed in Monte Carlo sweeps.&amp;lt;/h5&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;/div&gt;</summary>
		<author><name>Rovigatti</name></author>
	</entry>
	<entry>
		<id>https://dna.physics.ox.ac.uk/index.php?title=Hairpin_formation&amp;diff=505</id>
		<title>Hairpin formation</title>
		<link rel="alternate" type="text/html" href="https://dna.physics.ox.ac.uk/index.php?title=Hairpin_formation&amp;diff=505"/>
		<updated>2012-04-19T15:19:51Z</updated>

		<summary type="html">&lt;p&gt;Rovigatti: /* Results */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Examples]]&lt;br /&gt;
== Introduction ==&lt;br /&gt;
In this example, you will simulate a single strand of length 18 and sequence &amp;lt;tt&amp;gt;GCGTTGCTTCTCCAACGC&amp;lt;/tt&amp;gt; at 334 K (~61 °C) in three different ways:&lt;br /&gt;
* with a molecular dynamics (MD) simulation of the sequence-averaged (SA) model. The input file is &amp;lt;tt&amp;gt;inputMD&amp;lt;/tt&amp;gt;.&lt;br /&gt;
* with an MD simulation of the sequence-dependent (SD) model. The input file is &amp;lt;code&amp;gt;inputMD_seq_dep&amp;lt;/code&amp;gt;.&lt;br /&gt;
* with a Monte Carlo (MC) simulation of the SA model in which two base pairs are connected by mutual traps (i.e. additional attractive interactions between two nucleotides). The input file is &amp;lt;tt&amp;gt;inputTRAP&amp;lt;/tt&amp;gt;.&lt;br /&gt;
The traps act between the pairs depicted in blue and red in the sequence G&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;C&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;G&amp;lt;/span&amp;gt;TTGCTTCTCCAA&amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;C&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;G&amp;lt;/span&amp;gt;C. The details of the interaction associated to the traps can be changed in the file &amp;lt;tt&amp;gt;hairpin_forces.dat&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
This strand, if &#039;&#039;T&#039;&#039; is sufficiently low, tends to form an hairpin with a 6-base long stem and a 6-base long loop.&lt;br /&gt;
The temperature has been chosen to be close to the melting temperature of such a hairpin in the SA version of the  model&lt;br /&gt;
&lt;br /&gt;
This document explains how to prepare the &#039;&#039;hairpin&#039;&#039; example (see [[#Preparation|Preparation]]) and how to run it ([[#Running|Running]]). Section [[#Results|Results]] contains results and plots extracted from the simulation output. In the following, &amp;lt;tt&amp;gt;$EXEC&amp;lt;/tt&amp;gt; refers to the oxDNA executable.&lt;br /&gt;
&lt;br /&gt;
== Preparation ==&lt;br /&gt;
The script &amp;lt;tt&amp;gt;run.sh&amp;lt;/tt&amp;gt; generates the input files and runs all the three simulations, one after the other. With the default input files, each simulation, lasting &amp;lt;math&amp;gt;10^8&amp;lt;/math&amp;gt; steps by default, takes approximately one hour on a modern CPU. The default &amp;lt;tt&amp;gt;run.sh&amp;lt;/tt&amp;gt; expects &amp;lt;tt&amp;gt;$EXEC&amp;lt;/tt&amp;gt; to be in the &amp;lt;tt&amp;gt;../..&amp;lt;/tt&amp;gt; directory. If this is not the case, open &amp;lt;tt&amp;gt;run.sh&amp;lt;/tt&amp;gt; and change the variable &amp;lt;tt&amp;gt;CODEDIR&amp;lt;/tt&amp;gt; accordingly.&lt;br /&gt;
&lt;br /&gt;
If you only want to generate the initial configuration, you can issue &amp;lt;tt&amp;gt;./run.sh --generate-only&amp;lt;/tt&amp;gt;. Then you can run the simulations by yourself. The generated initial configuration files are &amp;lt;tt&amp;gt;initial.top&amp;lt;/tt&amp;gt; (which contains the topology) and &amp;lt;tt&amp;gt;initial.conf&amp;lt;/tt&amp;gt; (which contains positions and orientations of the nucleotides).&lt;br /&gt;
&lt;br /&gt;
== Running ==&lt;br /&gt;
In order to run the whole example, it is sufficient to issue the command &amp;lt;tt&amp;gt;./run.sh&amp;lt;/tt&amp;gt; (or &amp;lt;tt&amp;gt;bash run.sh&amp;lt;/tt&amp;gt;). As described in [[#Preparation|Preparation]], you can generate the initial configuration and then run the simulations by hand. The three simulations, described in [[#Introduction|Introduction]], can be performed issuing &amp;lt;tt&amp;gt;$EXEC input&amp;lt;/tt&amp;gt;, where &amp;lt;tt&amp;gt;input&amp;lt;/tt&amp;gt; is a text file that specifies the simulation configuration. For this example, three files have been prepared: &amp;lt;tt&amp;gt;inputMD&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;inputMD_seq_dep&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;inputTRAP&amp;lt;/tt&amp;gt;. Table~\ref{tbl:sim} report all the files associated to each simulations.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
! Type &lt;br /&gt;
! Input&lt;br /&gt;
! energy file&lt;br /&gt;
! trajectory file&lt;br /&gt;
! last configuration file&lt;br /&gt;
! log file&lt;br /&gt;
|-&lt;br /&gt;
|SA model&lt;br /&gt;
|inputMD&lt;br /&gt;
|energy.dat&lt;br /&gt;
|trajectory.dat&lt;br /&gt;
|last_conf.dat&lt;br /&gt;
|log.dat&lt;br /&gt;
|-&lt;br /&gt;
|SD model&lt;br /&gt;
|inputMD_seq_dep&lt;br /&gt;
|energy_seq_dep.dat&lt;br /&gt;
|trajectory_seq_dep.dat&lt;br /&gt;
|last_conf_seq_dep.dat&lt;br /&gt;
|log_seq_dep.dat&lt;br /&gt;
|-&lt;br /&gt;
|SA model with traps&lt;br /&gt;
|inputTRAP&lt;br /&gt;
|energy_trap.dat&lt;br /&gt;
|trajectory_trap.dat&lt;br /&gt;
|last_conf_trap.dat&lt;br /&gt;
|log_trap.dat&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Results ==&lt;br /&gt;
As mentioned in the [[#Introduction|Introduction]], temperature has been chosen so that the hairpin is near its melting temperature when simulated via SA model. Figure 1 shows the probability distribution histogram $P(U_{HB})$ for the hydrogen-bonding (HB) energy $U_{HB}$ of the system (in simulation units~\cite{ouldridge_jcp}). Both the minimum in $P(U_{HB})$ and a direct inspection of the time series (inset) show that the hairpin is indeed near the melting temperature, since $U_{HB}$ oscillates between $0$ (no HBs) and ~ -3.5, which corresponds to 4-5 hydrogen-bonded nucleotides. At this temperature the fraying effect is relevant, and therefore the last base-pair is not always formed~\cite{ouldridge_jcp}. This is clearly visible in the snapshot at the beginning of this document, in which $4$ base-pairs are formed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align:center&amp;quot;&amp;gt;&lt;br /&gt;
http://kratos.phys.uniroma1.it/histo_MD.png&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h5&amp;gt;Figure 1: Probability of having a hydrogen-bonding interaction energy &amp;lt;math&amp;gt;U_{HB}&amp;lt;/math&amp;gt; for the SA model. Inset: time series of the hydrogen-bonding energy (stored in the fifth column of the energy file as a function of MD steps.&amp;lt;/h5&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Figure 2 shows $P(U_{HB})$ and $U_{HB}$ for the SD hairpin. In this case, one expects a different melting temperature. Indeed, at this temperature the hairpin is nearly always in its folded conformation and the average value of $U_{HB}$ is lower than in the SA case. Although stacking interactions play a role, the major contribution to this effect is due to the presence of four &amp;lt;tt&amp;gt;GC&amp;lt;/tt&amp;gt; only two &amp;lt;tt&amp;gt;AT&amp;lt;/tt&amp;gt; base-pairs in the stem.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align:center&amp;quot;&amp;gt;&lt;br /&gt;
http://kratos.phys.uniroma1.it/histo_MD_seq_dep.png&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h5&amp;gt;Figure 2: Same as Figure 1, but for the SD model.&amp;lt;/h5&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If mutual traps between stem base-pairs are introduced, then the equilibrium properties of the hairpin are changed and, even if the SA model is employed, the hairpin is always (after the initial equilibration) in its folded conformation. The use of mutual traps can highly decrease the simulation time required by the folding of strands into target structures (like DNA origami or DNA constructs).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align:center&amp;quot;&amp;gt;&lt;br /&gt;
http://kratos.phys.uniroma1.it/histo_TRAP.png&lt;br /&gt;
&lt;br /&gt;
&amp;lt;h5&amp;gt;Figure 3: Same as Figure 1, but for the system with mutual traps. Time is expressed in Monte Carlo sweeps.&amp;lt;/h5&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;/div&gt;</summary>
		<author><name>Rovigatti</name></author>
	</entry>
	<entry>
		<id>https://dna.physics.ox.ac.uk/index.php?title=Hairpin_formation&amp;diff=504</id>
		<title>Hairpin formation</title>
		<link rel="alternate" type="text/html" href="https://dna.physics.ox.ac.uk/index.php?title=Hairpin_formation&amp;diff=504"/>
		<updated>2012-04-19T15:13:19Z</updated>

		<summary type="html">&lt;p&gt;Rovigatti: /* Results */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Examples]]&lt;br /&gt;
== Introduction ==&lt;br /&gt;
In this example, you will simulate a single strand of length 18 and sequence &amp;lt;tt&amp;gt;GCGTTGCTTCTCCAACGC&amp;lt;/tt&amp;gt; at 334 K (~61 °C) in three different ways:&lt;br /&gt;
* with a molecular dynamics (MD) simulation of the sequence-averaged (SA) model. The input file is &amp;lt;tt&amp;gt;inputMD&amp;lt;/tt&amp;gt;.&lt;br /&gt;
* with an MD simulation of the sequence-dependent (SD) model. The input file is &amp;lt;code&amp;gt;inputMD_seq_dep&amp;lt;/code&amp;gt;.&lt;br /&gt;
* with a Monte Carlo (MC) simulation of the SA model in which two base pairs are connected by mutual traps (i.e. additional attractive interactions between two nucleotides). The input file is &amp;lt;tt&amp;gt;inputTRAP&amp;lt;/tt&amp;gt;.&lt;br /&gt;
The traps act between the pairs depicted in blue and red in the sequence G&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;C&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;G&amp;lt;/span&amp;gt;TTGCTTCTCCAA&amp;lt;span style=&amp;quot;color:blue&amp;quot;&amp;gt;C&amp;lt;/span&amp;gt;&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;G&amp;lt;/span&amp;gt;C. The details of the interaction associated to the traps can be changed in the file &amp;lt;tt&amp;gt;hairpin_forces.dat&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
This strand, if &#039;&#039;T&#039;&#039; is sufficiently low, tends to form an hairpin with a 6-base long stem and a 6-base long loop.&lt;br /&gt;
The temperature has been chosen to be close to the melting temperature of such a hairpin in the SA version of the  model&lt;br /&gt;
&lt;br /&gt;
This document explains how to prepare the &#039;&#039;hairpin&#039;&#039; example (see [[#Preparation|Preparation]]) and how to run it ([[#Running|Running]]). Section [[#Results|Results]] contains results and plots extracted from the simulation output. In the following, &amp;lt;tt&amp;gt;$EXEC&amp;lt;/tt&amp;gt; refers to the oxDNA executable.&lt;br /&gt;
&lt;br /&gt;
== Preparation ==&lt;br /&gt;
The script &amp;lt;tt&amp;gt;run.sh&amp;lt;/tt&amp;gt; generates the input files and runs all the three simulations, one after the other. With the default input files, each simulation, lasting &amp;lt;math&amp;gt;10^8&amp;lt;/math&amp;gt; steps by default, takes approximately one hour on a modern CPU. The default &amp;lt;tt&amp;gt;run.sh&amp;lt;/tt&amp;gt; expects &amp;lt;tt&amp;gt;$EXEC&amp;lt;/tt&amp;gt; to be in the &amp;lt;tt&amp;gt;../..&amp;lt;/tt&amp;gt; directory. If this is not the case, open &amp;lt;tt&amp;gt;run.sh&amp;lt;/tt&amp;gt; and change the variable &amp;lt;tt&amp;gt;CODEDIR&amp;lt;/tt&amp;gt; accordingly.&lt;br /&gt;
&lt;br /&gt;
If you only want to generate the initial configuration, you can issue &amp;lt;tt&amp;gt;./run.sh --generate-only&amp;lt;/tt&amp;gt;. Then you can run the simulations by yourself. The generated initial configuration files are &amp;lt;tt&amp;gt;initial.top&amp;lt;/tt&amp;gt; (which contains the topology) and &amp;lt;tt&amp;gt;initial.conf&amp;lt;/tt&amp;gt; (which contains positions and orientations of the nucleotides).&lt;br /&gt;
&lt;br /&gt;
== Running ==&lt;br /&gt;
In order to run the whole example, it is sufficient to issue the command &amp;lt;tt&amp;gt;./run.sh&amp;lt;/tt&amp;gt; (or &amp;lt;tt&amp;gt;bash run.sh&amp;lt;/tt&amp;gt;). As described in [[#Preparation|Preparation]], you can generate the initial configuration and then run the simulations by hand. The three simulations, described in [[#Introduction|Introduction]], can be performed issuing &amp;lt;tt&amp;gt;$EXEC input&amp;lt;/tt&amp;gt;, where &amp;lt;tt&amp;gt;input&amp;lt;/tt&amp;gt; is a text file that specifies the simulation configuration. For this example, three files have been prepared: &amp;lt;tt&amp;gt;inputMD&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;inputMD_seq_dep&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;inputTRAP&amp;lt;/tt&amp;gt;. Table~\ref{tbl:sim} report all the files associated to each simulations.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
! Type &lt;br /&gt;
! Input&lt;br /&gt;
! energy file&lt;br /&gt;
! trajectory file&lt;br /&gt;
! last configuration file&lt;br /&gt;
! log file&lt;br /&gt;
|-&lt;br /&gt;
|SA model&lt;br /&gt;
|inputMD&lt;br /&gt;
|energy.dat&lt;br /&gt;
|trajectory.dat&lt;br /&gt;
|last_conf.dat&lt;br /&gt;
|log.dat&lt;br /&gt;
|-&lt;br /&gt;
|SD model&lt;br /&gt;
|inputMD_seq_dep&lt;br /&gt;
|energy_seq_dep.dat&lt;br /&gt;
|trajectory_seq_dep.dat&lt;br /&gt;
|last_conf_seq_dep.dat&lt;br /&gt;
|log_seq_dep.dat&lt;br /&gt;
|-&lt;br /&gt;
|SA model with traps&lt;br /&gt;
|inputTRAP&lt;br /&gt;
|energy_trap.dat&lt;br /&gt;
|trajectory_trap.dat&lt;br /&gt;
|last_conf_trap.dat&lt;br /&gt;
|log_trap.dat&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Results ==&lt;br /&gt;
As mentioned in the [[#Introduction|Introduction]], temperature has been chosen so that the hairpin is near its melting temperature when simulated via SA model. The figure below shows the probability distribution histogram $P(U_{HB})$ for the hydrogen-bonding (HB) energy $U_{HB}$ of the system (in simulation units~\cite{ouldridge_jcp}). Both the minimum in $P(U_{HB})$ and a direct inspection of the time series (inset) show that the hairpin is indeed near the melting temperature, since $U_{HB}$ oscillates between $0$ (no HBs) and ~ -3.5, which corresponds to 4-5 hydrogen-bonded nucleotides. At this temperature the fraying effect is relevant, and therefore the last base-pair is not always formed~\cite{ouldridge_jcp}. This is clearly visible in the snapshot at the beginning of this document, in which $4$ base-pairs are formed.&lt;br /&gt;
&lt;br /&gt;
http://kratos.phys.uniroma1.it/histo_MD.png&lt;br /&gt;
&lt;br /&gt;
The figure below shows $P(U_{HB})$ and $U_{HB}$ for the SD hairpin. In this case, one expects a different melting temperature. Indeed, at this temperature the hairpin is nearly always in its folded conformation and the average value of $U_{HB}$ is lower than in the SA case. Although stacking interactions play a role, the major contribution to this effect is due to the presence of four &amp;lt;tt&amp;gt;GC&amp;lt;/tt&amp;gt; only two &amp;lt;tt&amp;gt;AT&amp;lt;/tt&amp;gt; base-pairs in the stem.&lt;br /&gt;
&lt;br /&gt;
http://kratos.phys.uniroma1.it/histo_MD_seq_dep.png&lt;br /&gt;
&lt;br /&gt;
If mutual traps between stem base-pairs are introduced, then the equilibrium properties of the hairpin are changed and, even if the SA model is employed, the hairpin is always (after the initial equilibration) in its folded conformation. The use of mutual traps can highly decrease the simulation time required by the folding of strands into target structures (like DNA origami or DNA constructs).&lt;br /&gt;
&lt;br /&gt;
http://kratos.phys.uniroma1.it/histo_TRAP.png&lt;/div&gt;</summary>
		<author><name>Rovigatti</name></author>
	</entry>
	<entry>
		<id>https://dna.physics.ox.ac.uk/index.php?title=File:Histo_MD.png&amp;diff=503</id>
		<title>File:Histo MD.png</title>
		<link rel="alternate" type="text/html" href="https://dna.physics.ox.ac.uk/index.php?title=File:Histo_MD.png&amp;diff=503"/>
		<updated>2012-04-19T10:55:41Z</updated>

		<summary type="html">&lt;p&gt;Rovigatti: uploaded a new version of &amp;quot;Image:Histo MD.png&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Rovigatti</name></author>
	</entry>
</feed>