In this example we perform  molecular dynamics (MD) 
simulation of a DNA fragment with the following 
sequence: (3')AATTCGCGTTTACG(5'). 

We use "12GC" coarse-grained model described in: 
"Heat conductivity of the DNA double helix", by Savin A., et al.


First, we have to create initial coordinates using "famb" program. 
(Fortran files, famb.f and conmin.f,  are in "famb" folder):
To compile it: 

ifort famb.f conmin.f -o famb.out

The executable is famb.out. 

Also it's necessary to edit famb.nam file to specify your sequence. 
The file contains the following information (# is a comment) :

14 10                # N-number of base pairs, Nconmin - number of conmin interation (usually it's 10..20)
11224343222143       # sequence of the first strand (1 for A, 2 for T, 3 for G, 4 for C): AATTCGCGTTTACG       
22113434111234       # sequence of second complementary strand (mismatches can also be considered) 

Another file which is needed, famb.prm, contains parameters of 
the interaction potential. 
Files (famb.nam, famb.prm) are also in "famb" folder.

Now we can execute famb.out. Output of this program is energy and  
residual error for each step of  the minimization process of Nconmin (10) iterations. Minimization can take some time especially for long sequences.

Executing of famb.out creates three output files: famb.pdb, famb_.pdb and famb.crd. First two of them are pdb files of minimizated structure. famb.pdb contains only model grains, while famb_.pdb contains coarse-grained backbone and all-atomic bases. The file famb.crd contains coordinates and (zero) velocities of all particles in special format. This file is very important because it can be used as a start point for molecular dynamics(MD) simulation.

MD simulation is performed by  "namb" program (see "namb" folder).
To compile it, one needs Fortran files namb.f - the program and rand.f -a random number generator. 

compiling in INTEL FORTRAN
Windows:
ifort -O namb.f rand.f
Linux:
ifort -O -o namb.out namb.f rand.f

The namb program needs 4 input files: namb.prm, namb.nam, namb.crd, svblk. The last one is for random number generator, user does not need to edit it manually.  namb.prm contains interaction parameters and normally shouldn't be edited.
namb.nam contains information about MD simulation (time step, number of the steps and so on, see list.txt).
For example, the following text:

0.0005D0 2000  20   1     1  1.D0  300.D0   1     2
#  DT,    NDT,  NG, ngt,  INT, TR,   TMP,  IRAND, imt

says that simulation will contain NG=20 steps of DT*NDT=0.0005*2000=1ps (very short 20ps simulation), output will be each ngt=1 step. Temperature (in thermostate) is 300K. 


The file namb.crd contains coordinates and velocities. Normally, these
 can be obtained  either from a previous MD simulation or via "famb" program. 
So, we can get "namb.crd" from "famb.crd":

cp famb.crd namb.crd

After that namb.out can be executed.


Output files are: namb.crd, namb.pdb, namb_.pdb, namb_r_order.pdb, namb.trj.

The file namb.crd contains coordinates and velocities of the last snapshot, 
so it can be used as input for another run. 
namb.pdb, namb_.pdb, namb_r_order.pdb are pdb files corresponding to 
the last snapshot. 
namb.pdb contains only model grains, while namb_.pdb contains 
coarse-grained backbone and all-atomic bases. 
namb_r_order.pdb differs from the namb.pdb in the order of the atoms: the order in the namb_r_order.pdb is the same as in .crd and .trj files. 
The file namb.trj contains trajectory (written every ngt step) in the usual AMBER coordinate file format. So one can, for example,  easily visualize dynamics in VMD program loading namb_r_order.pdb and then namb.trj file.



The "kamb" program is used for finding ground state of a 
finite homogeneous DNA poly(C)-poly(G)
double-helix. It uses amber base-base potentials.  In this program the only input file kamb.prm contains not only interaction parameters but also initial point(coordinates of one  site, z-step,twist ) for minimization. (it's analogous to "famb", but considers only homogenious double helix).
  
Output:
"kamb.pdb" - pdb file of the ground state of double-helix
             (only grains of coarse-grained model)
"kamb_.pdb" - pdb file of the ground state of double-helix
              (with all-atomic representation of nitrogen bases)
"kamb.int" - coordinate file of the ground state of double-helix
             (can be used for creating a start point for thermal
              conductivity simulating by tamb.f program)
"kamb.crd" - coordinate file of one site of the ground state of
             DNA poly(C)-poly(G) double-helix + twist and
             rise parameters


PROGRAM tamb.f performs simulation of heat conductivity of finite homogeneous DNA (CG)_n
double-helix. It uses AMBER base-base potentials (mpi version). 
It requires files tamb.prm, which contains interaction potential parameters (just like a namb.prm), but also it has an additional line which contains parameters of simulation: integration step, numer of steps,  
method of integration, etc.      
Another input file is tamb.crd. The first line contains 
the following parameters:
N - base pairs number
ING - number of the large step corresponding to the current
      coordinate set (for the initial point ING=0)
T - current time value (for the initial point T=0)
NT - number of end base pairs which are in Langevin's thermostate
TMP1 - thermostate temperature on the left end
TMP2 - thermostate temperature on the right end
TR - relaxation time of Langevin thermostate
After the first line all atom's coordinates and velocities (in the same format as files famb.crd, namb.crd)are written. Initial coordinates can be generated from one site ground state by translating and rotating.
End coordinate are re-written in the same file when a simulation is finished.
"svblk" - file for random number generating.

Output files are 
"tamb.rez" - a file in which simulation results are saved
             (distribution of temperature and thermul flux
              along the double helix)
"tamb.tmp" - file with last large step simulation results 
"tamb.pdb" - pdb-file of the last frame

  

