[gmx-users] umbrella sampling

rose rahmani rose.rhmn93 at gmail.com
Sat Nov 25 18:57:27 CET 2017


On Sat, Nov 25, 2017 at 7:01 PM, Justin Lemkul <jalemkul at vt.edu> wrote:

>
>
> On 11/25/17 5:05 AM, rose rahmani wrote:
>
>> 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)?
>>
>
> My Perl script expects each file to have *one* value in it, the COM
> distance between two chosen groups. Your output seems to be something else
> entirely, suggesting you didn't choose appropriate groups.
>
> 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?)
>>
>
> You don't. Run have to calculate each separately (trivial in a shell or
> other script loop), or otherwise just analyze the trajectory, get one time
> series, and do your own parsing.
>
>
>> - 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.
>>
>
> If you can tell me what the actual error are, I can help sort those out.
>> As I said before, I have often heard "your script doesn't work" and then no
>> one actually follows up to tell me why. If you're getting errors, I'd like
>> to know so I can actually provide a solution.
>
>
>
first, when you open script file in browser ,then copy it and paste it to
Linux, all lines will be started with "#" which makes all scripts
inactive.That was a carelessness personally from me ;)))

- When i use your script,
a)  i need to change 1-Chain_A  2-Chain_B  3- number"500"
b)  perl distances.pl
c) Processing configuration 0...
Processing configuration 1...
Processing configuration 2...
Processing configuration 3...
Processing configuration 4...
Processing configuration 5...
readline() on closed filehandle IN at distances.pl line 14.
Use of uninitialized value $distance in concatenation (.) or string at
distances.pl line 28.
readline() on closed filehandle IN at distances.pl line 14.
Use of uninitialized value $distance in concatenation (.) or string at
distances.pl line 28.
readline() on closed filehandle IN at distances.pl line 14.
Use of uninitialized value $distance in concatenation (.) or string at
distances.pl line 28.
readline() on closed filehandle IN at distances.pl line 14.
Use of uninitialized value $distance in concatenation (.) or string at
distances.pl line 28.
readline() on closed filehandle IN at distances.pl line 14.
Use of uninitialized value $distance in concatenation (.) or string at
distances.pl line 28.
readline() on closed filehandle IN at distances.pl line 14.
Use of uninitialized value $distance in concatenation (.) or string at
distances.pl line 28.

i think this is the common error for most of us.Because of this, as i said
i had to run gmx distance separately and delete these lines from perl
scripts( which you suggested).it worked,but my problem is why my
summarydistances.dat is like this:
0       0.382
1       0.382
2       0.382
3       0.382
4       0.382
5       0.382
~

Oh!!!! yes you're right. Although i choose groups which i need to calculate
distances,BUT they didn't actually move as i expected and i've been
intending and looking for from the first!

?-if you remember yesterday i told that the protein in getting closer to
wall instead of ZnO!! (protein is between ZnO and wall) ,while i'm trying
to calculate different distances between ZnO and Protein!!!! and i asked
which part of my work may be wrong?it means that protein tends to wall more
than ZnO????

?- and what i don't undrstand is that how perl script calculate just "one"
value from xvg file which contain many values?i cant understand.


These are questions that are really important for me


Thank you so much Justin from your attentions




-Justin
>
> --
> ==================================================
>
> Justin A. Lemkul, Ph.D.
> Assistant Professor
> Virginia Tech Department of Biochemistry
>
> 303 Engel Hall
> 340 West Campus Dr.
> Blacksburg, VA 24061
>
> jalemkul at vt.edu | (540) 231-3129
> http://www.biochem.vt.edu/people/faculty/JustinLemkul.html
>
> ==================================================
>
> --
> Gromacs Users mailing list
>
> * Please search the archive at http://www.gromacs.org/Support
> /Mailing_Lists/GMX-Users_List before posting!
>
> * Can't post? Read http://www.gromacs.org/Support/Mailing_Lists
>
> * For (un)subscribe requests visit
> https://maillist.sys.kth.se/mailman/listinfo/gromacs.org_gmx-users or
> send a mail to gmx-users-request at gromacs.org.


More information about the gromacs.org_gmx-users mailing list