[gmx-users] umbrella sampling

rose rahmani rose.rhmn93 at gmail.com
Sat Nov 25 11:05:56 CET 2017


Hi,

i'm using umbrella sampling and i'm a beginner in GROMACS.

as an example i got 5 dist.xvg files and then:

>>command: perl  distances.pl

this is distances.pl:
#!/usr/bin/perl -w
  use strict;


          # write output to single file
          open(OUT, ">>summary_distances.dat");

          for (my $j=0; $j<=5; $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<=5; $k++) {

                         unlink "dist${k}.xvg";

                         }


                        exit;

but summary-distances.dat:

0       0.382
1       0.382
0       0.382
1       0.382
2       0.382
3       0.382
4       0.382
5       0.382
~
~
~

0.382 is just the first number in dist.xvg files;

for example dist0.xvg is:

# This file was created Sat Nov 25 04:47:25 2017
# Created by:
#                 :-) GROMACS - gmx distance, VERSION 5.1.4 (-:
#
# Executable:   /usr/local/gromacs/bin/gmx
# Data prefix:  /usr/local/gromacs
# Command line:
#   gmx distance -s pull.tpr -f conf0.gro -n index.ndx -oall dist0.xvg
# gmx distance is part of G R O M A C S:
#
#
¸­°<88><96><91><98>ò<90><91><8c><8b><9a><8d><8c>þ<91><9b>ü<93><90><91><96><91><98>ì<97><8d><96><92><8f><8c>
#
@    title "Distance"
@    xaxis  label "Time (ps)"
@    yaxis  label "Distance (nm)"
@TYPE xy
      0.000    0.382    0.382    0.383    0.383    0.383    0.383    1.178
  0.382    0.382    0.383    0.383    0.383    0.383    0.383    0.382
0.818    0.382    0.382    0.382    0.382    0.541    0.541    0.541
0.541    0.541    0.541    0.541    0.541    0.541    0.541    0.541
0.541    0.541    0.541    0.541    0.541    0.541    0.541    0.541
0.541    0.541    0.541    0.541    0.541    0.541    0.541    0.541
0.541    0.541    0.541    0.541    0.541    0.541    0.541    0.541
0.541    0.541    0.541    0.541    0.541    0.541    0.541    0.541
0.541    0.541    0.541    0.541    0.541    0.541    0.541    0.541
0.541    0.541    0.541    0.541    0.541    0.541    0.541    0.541
0.541    0.541    0.541    0.541    0.541    0.541    0.541    0.541
0.541    0.541    0.541    0.541    0.541    0.541    0.541    0.541
0.541    0.541    0.541    0.541    0.541    0.541    0.541    0.541
0.541    0.541    0.541    0.541    0.541    0.541    0.541    0.541
0.541    0.541    0.541    0.541    0.541    0.541    0.541    0.541
0.541    0.541    0.541    0.541    0.541    0.541    0.541    0.541
0.541    0.541    0.541    0.541    0.541    0.541    0.541    0.541
0.541    0.541    0.541    0.541    0.541    0.382    0.382    0.383
0.383    0.383    0.383    1.178    0.382    0.382    0.383    0.383
0.383    0.383    0.383    0.382    0.818    0.382    0.382    0.382
0.382    0.541    0.541    0.541    0.541    0.541    0.541    0.541
0.541    0.541    0.541    0.541    0.541    0.541    0.541    0.541
0.541    0.541    0.541    0.541    0.541    0.541    0.541    0.541
0.541    0.541    0.541    0.541    0.541    0.541    0.541    0.541
0.541    0.541    0.541    0.541    0.541    0.541    0.541    0.541
0.541    0.541    0.541    0.541    0.541    0.541    0.541    0.541
0.541    0.541    0.541    0.541    0.541    0.541    0.541    0.541
0.541    0.541    0.541    0.541    0.541    0.541    0.541    0.541
0.541    0.541    0.541    0.541    0.541    0.541    0.541    0.541
0.541    0.541    0.541    0.541    0.541    0.541    0.541    0.541
0.541    0.541    0.541    0.541    0.541    0.541    0.541    0.541
0.541    0.541    0.541    0.541    0.541    0.541    0.541    0.541
0.541    0.541    0.541    0.541    0.541    0.541    0.541    0.541
0.541    0.541    0.541    0.541    0.541    0.541    0.541    0.541
0.541    0.541    0.541    0.541    0.541    0.541    0.541    0.541
0.541    0.151    0.237    0.160    0.242    0.123    0.147
~
~

what is my mistake?is that perl script or?! or because of i selected very
close conf.gro files (0-5)?
i selected them just for testing my script and to tell the truth i didn't
know how use gmx distance to get all 718 (configuration's) xvg files with
just ONE command so i have to get .xvg files one by one.(would you please
tell me?)


- it's much similar to tutorial's(by Mr Lemkul) perl script but not as same
as it because i got some errors so i had to use gmx distance separately.

Best Regards

Rose


More information about the gromacs.org_gmx-users mailing list