Collection of simple perl scripts

amber2namd.pl

Have run a simulation with AMBER and want to continue with NAMD? That's what you need:

Usage:

perl amber2namd.pl amber_topology_file amber_restart_file root_namd_files

It creates a NAMD configuration file with all the needed periodic boundary definitions (assumes for truncated octahedron) + a velocities PDB file (needs ambpdb) to do a proper restart.

Note that:

1) there may be some difference in the kinetic energy due to the 3 decimals limit in the velocities PDB file

2) the vdw energies will not be identical because for periodic systems AMBER introduces a correction term for the van der Waals that is a function of preassure and energy (vdwmeth=1), while NAMD does not. See this link for further details:

http://www.ks.uiuc.edu/Research/namd/mailing_list/namd-l/10483.html

 

 

 

jar_combi.pl

Given N work profiles from Jarzinky simulations (with amber) obtain the average free energy and associated std.dev.

Takes as input the "j_contactenated_out.txt" produced by jarzi2.f

Usage:

perl jar_combi.pl j_contactenated_out.txt M N

where M is the number of sets and N the set size.

If N is equal to the total number of simulations the output will be identical to "jarz_estimator_out.txt" from jarzi2.f.

The program makes M random combinations of N profiles. For every combination, it calculates the free energy at every point in the reaction coordinate, ouputing the corresponding average and Std. dev. values.

This other program (very slow!) does the same thing, but also gives the normalized weight for each simulation at each point along the reaction coordinate. This can be used to obtain weighted averages of properties along the simulation:

Xjar = SUM ( Xi * Wi)

where Xi is the property you are monitoring (distance, RMSD values, etc) for simulation i and Wi is the weight of simulation i at that point.