[gmx-users] umbrella sampling

rose rahmani rose.rhmn93 at gmail.com
Sat Nov 25 21:12:55 CET 2017


Oh sorry this is .mdp file:

DEFINE                   = -DPOSRES
integrator               = md
dt                       = 0.001
nsteps                   = 2000000
nstxout                  = 0
nstvout                  = 0
nstfout                  = 0
nstlog                   = 500
nstenergy                = 1000
nstxtcout                = 1000
rlist                    = 1.5
rcoulomb                 = 1.5
rvdw                     = 1.2
coulombtype              = pme
cutoff-scheme            = group
vdwtype                  = Switch
rvdw_switch              = 1.0
pcoupl                   = no
gen-vel                  = yes
gen-temp                 = 0
gen-seed                 = 173529
constraints              = h-bonds
pbc                      = xy
freezegrps               = WAL ZnO
freezedim                = Y Y Y Y Y Y
energygrp-excl           = WAL WAL ZnO ZnO
energygrps               = SOL WAL ZnO Protein NA CL
nwall                    = 2
wall-atomtype            = C C
wall-type                = 9-3
wall-density             = 150 150
wall-ewald-zfac          = 3
ewald-geometry           = 3dc
fourierspacing           = 0.12
tcoupl                   = v-rescale
tc-grps                  = System
tau-t                    = 0.1
ref-t                    = 300
pull                    = yes
pull_ngroups            = 2
pull_ncoords            = 1
pull_group1_name        = ZnS
pull_group2_name        = Protein-H
pull_coord1_type        = umbrella      ; harmonic biasing force
pull_coord1_geometry    = distance      ; simple distance increase
pull_coord1_groups      = 1 2
pull_coord1_dim         = N N Y
pull_coord1_rate        = 0.001
pull_coord1_k           = 5000          ; kJ mol^-1 nm^-2
pull_coord1_start       = yes           ; define initial COM distance > 0




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

>
>
> On 11/25/17 12:57 PM, rose rahmani wrote:
>
>> 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 ;)))
>>
>
> Right-click, save as. Don't open or manipulate the script in a browser.
>
> - 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.
>>
>
> This and the errors that follow mean the script can't find a file to open.
> I'm not sure all of what you've changed in the script, because if truly you
> are only trying to process six files (indices 0-5), then this shouldn't
> happen.
>
>
> 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!
>>
>
> This is the first problem you should solve. Running these post-processing
> scripts is a waste of time if your si
> <https://maps.google.com/?q=ng+scripts+is+a+waste+of+time+if+your+si&entry=gmail&source=g>mulation
> didn't act as you expected it.
>
> ?-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????
>>
>
> More likely, your .mdp settings were wrong. Please post (do not attach)
> the contents of your .mdp file.
>
> ?- 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.
>>
>
> When gmx distance is executed properly on a single coordinate file, there
> can (by definition) be only one COM distance between two groups. If you're
> getting anything else, you're using gmx distance wrong. Run it
> interactively to be sure you understand the syntax and can execute the
> command and get a sensible result before layering on the complexity of my
> processing script.
>
>
> -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