[gmx-users] Error while running perl distances.pl

Vytautas Rakeviius vytautas1987 at yahoo.com
Wed Sep 6 11:41:03 CEST 2017


Well to better understand what is going on I suggest:* use strict; line tells to search for possible problems even if script can go on like it is.Maybe just remove it?
 * remove &>/dev/null or even better use other file instead of /dev/null like dump.txt
You will see it that system call is all OK from print to screen or to that file.
* Edit all open functions into open or die style. Example:open(OUT, ">>summary_distances.dat") or die "can not open summary_distances.dat";If that file open call fails you will see error like you wrote.* Examine all files mentioned in script, they might be bad or not exist, that may hint to possible issues.
    On Wednesday, September 6, 2017, 10:42:30 AM GMT+3, 가디 장데부 고라크스나트 <f07338 at kist.re.kr> wrote:  
 
 
Hello Vytautas,

I changed the script file to

gmx_mpi_d distance -s md_pull.tpr -f conf${i}.gro -n index.ndx -oall dist${i}.xvg -select \'com of group \"lig\" plus com of group \"protein\"\'

 

rest is same

but it showed the same error as previous one.
Error readline() on closed filehandle IN at distances.pl line 16 Use of uminitialized value $distance in concatanation (.) or string at distances.pl line 30.
 

Could you help me out to solve this issue.

Dr. Changdev G. Gadhe

Post-Doc Researcher,

Convergence Research Center for Diagnosis, Treatment and Care System of Dementia,

Korea Institute of Science and Technology, 

Hwarangno 14-gil 5, Seongbuk-gu, Seoul 136-791, Korea 

Ph.: +82-10-2779-1546 , Lab: +82-02-958-6850

Email: F07338 at kist.re.kr

 

 

 

 

-----------------------Original message-----------------------
From: "Vytautas Rakeviius "<vytautas1987 at yahoo.com>
To: gmx-users at gromacs.org,gromacs.org_gmx-users at maillist.sys.kth.se,가디 장데부 고라크스나트<f07338 at kist.re.kr>
Cc.: gadhe.changdev at gmail.com
Sent date: 2017-09-04 15:36:29 GMT +0900 (Asia/Seoul)
Title: Re: [gmx-users] Error while running perl distances.pl
 

 
Script assumes that variable $distance is the second row separated by space in the file dist{number}.xvg which appears after execution of system callgmx distance -s md_pull.tpr -f conf${i}.gro -n index.ndx -oall dist${i}.xvg -select \'com of group \"lig\" plus com of group \"protein\"\'I just think that dist{number}.xvg creation fails for you in first place because "gmx distance" in the script is not adjusted according to your system.You use _mpi_d in your post.   On Monday, September 4, 2017, 5:48:43 AM GMT+3, 가디 장데부 고라크스나트 <f07338 at kist.re.kr> wrote:   Hello Gmx user,  I would like to transport solute molecule from the ion channel (intracellular to extracellular site) using steered MD and umbrella sampling method to calculate the energy. I followed Dr. Lemkul's tutorial and it works fine upto equilibration step but in distance.pl it shows some errors. I used the distance of pulling along the Z-axis but still it do not work. I found when I use distance as a pull-geometry, solute moves away from the channel rather transporting through channel. Then I tried direction as a pull-geoetry, then solute transported from the chanel,and generated pullf.xvg but not pullx.xvg file. I separated the trajectory using trjconv command gmx_mpi_d -f recenter_traj.xtc -s md_pull.tpr -n pro-lig.ndx -o conf.gro -sep It generated conformations.    Now I would like to calculate the COM distance between ion channel (protein) and solute (lig) using perl distance.pl but I received following error. Error readline() on closed filehandle IN at distances.pl line 16 Use of uminitialized value $distance in concatanation (.) or string at distances.pl line 30.    Here is the distance.pl file which I used for this purpose which was downloaded from Dr. Lemkul's tutorial file. -----------------#!/usr/bin/perl -w use strict; # loop g_dist command - measure distance in each frame, write to a filefor (my $i=0; $i<=800; $i++) {    print "Processing configuration $i...\n";    system("gmx distance -s md_pull.tpr -f conf${i}.gro -n index.ndx -oall dist${i}.xvg -select \'com of group \"lig\" plus com of group \"protein\"\' &>/dev/null");} # write output to single fileopen(OUT, ">>summary_distances.dat"); for (my $j=0; $j<=800; $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 upprint "Cleaning up...\n"; for (my $k=0; $k<=800; $k++) {    unlink "dist${k}.xvg";} exit; ------------------------- this generated the summary_distances.dat with only frame numbers but there is no distance column in the file. Please help me to solve this issue    Regards, Dr. Changdev G. Gadhe  Post-Doc Researcher, Convergence Research Center for Diagnosis, Treatment and Care System of Dementia, Korea Institute of Science and Technology, Hwarangno 14-gil 5, Seongbuk-gu, Seoul 136-791, Korea Ph.: +82-10-2779-1546 , Lab: +82-02-958-6850 Email: F07338 at kist.re.kr--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 visithttps://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