[gmx-users] Distance.dat file in umbrella sampling
Justin Lemkul
jalemkul at vt.edu
Mon Jun 17 02:47:53 CEST 2013
On 6/16/13 7:47 PM, Kieu Thu Nguyen wrote:
> Dear Justin,
>
> I am testing a umbrella simulation basing on your tutorial. But after using
> your distances.pl script, i do not have the file "summary_distances.dat".
> It only makes many xvg files.
> I post the script below:
>
> #!/usr/bin/perl -w
>
> use strict;
>
> # loop g_dist command - measure distance in each frame, write to a file
> for (my $i=0; $i<=500; $i++) {
> print "Processing configuration $i...\n";
> system("g_dist_mpi_d -s pull.tpr -f conf${i}.gro -n index.ndx -o
> dist${i}.xvg < groups.txt &>/dev/null");
> }
>
> # write output to single file
> open(OUT, ">>summary_distances.dat");
>
> for (my $j=0; $j<=500; $j++) {
> open(IN, "<dist${j}.xvg");
> my @array = <IN>;
>
> my $distance;
>
> foreach $_ (@array) {
> if ($_ =~ /[#@]/) {
> # do nothing, it's a comment or formatting line
> } else {
> my @line = split(" ", $_);
> $distance = $line[1];
> }
> }
>
> close(IN);
> print OUT "$j\t$distance\n";
> }
>
> close(OUT);
>
> # clean up
> print "Cleaning up...\n";
>
> for (my $k=0; $k<=500; $k++) {
> unlink "dist${k}.xvg";
> }
>
> exit;
>
>
> Do i have to modify the script ?
>
You already have. My script doesn't use a double-precision/MPI version of
g_dist. MPI has no effect for anything except mdrun, FYI. In principle, this
isn't a big deal, unless the MPI compilation has rendered g_dist damaged in some
way.
Run one invocation of g_dist manually. There's got to be some error occurring
somewhere, but the script won't tell you that. If you have .xvg files when the
script is done, that's also wrong, since all of them should be deleted by the
last for-loop.
-Justin
--
========================================
Justin A. Lemkul, Ph.D.
Research Scientist
Department of Biochemistry
Virginia Tech
Blacksburg, VA
jalemkul[at]vt.edu | (540) 231-9080
http://www.bevanlab.biochem.vt.edu/Pages/Personal/justin
========================================
More information about the gromacs.org_gmx-users
mailing list