From: Erik Lindahl Date: Fri, 28 Dec 2012 19:26:57 +0000 (+0100) Subject: Remove broken g_dih tool X-Git-Url: http://biod.pnpi.spb.ru/gitweb/?a=commitdiff_plain;h=0618d4b10bd985cc5f581d733a7e835764ffe5e0;p=alexxy%2Fgromacs.git Remove broken g_dih tool Per the redmine discussion for #1094, g_dih was broken due to hardcoded atom names while the documentation claimed dihedrals were assigned from the topology. For now it is better to use g_angle and manually define the dihedrals. We plan to reimplement g_dih from scratch for 5.0. Fixes #1094. Change-Id: I57e0614e4d98bb5d4bbb3aaa1d3ba4377a93f988 --- diff --git a/admin/programs.txt b/admin/programs.txt index bee575792f..fc35a7dde6 100644 --- a/admin/programs.txt +++ b/admin/programs.txt @@ -87,7 +87,6 @@ END HEAD|Analyzing bonded interactions g_angle|calculates distributions and correlations for angles and dihedrals g_bond|calculates bond length distributions -g_dih|analyzes dihedral transitions mk_angndx|generates index files for g_angle END diff --git a/include/gmx_ana.h b/include/gmx_ana.h index 9e2fd91b5c..dd26ff1fd7 100644 --- a/include/gmx_ana.h +++ b/include/gmx_ana.h @@ -108,10 +108,6 @@ GMX_LIBGMXANA_EXPORT int gmx_dielectric(int argc,char *argv[]); -GMX_LIBGMXANA_EXPORT -int -gmx_dih(int argc,char *argv[]); - GMX_LIBGMXANA_EXPORT int gmx_dipoles(int argc,char *argv[]); diff --git a/share/html/online.html b/share/html/online.html index fea72694c7..7655758f51 100644 --- a/share/html/online.html +++ b/share/html/online.html @@ -66,7 +66,6 @@ Thu 26 Aug 2010
g_density
g_densmap
g_dielectric -
g_dih
g_dipoles
g_disre
g_dist @@ -283,7 +282,6 @@ Thu 26 Aug 2010 g_bondcalculates bond length distributions mk_angndxgenerates index files for g_angle g_anglecalculates distributions and correlations for angles and dihedrals -g_dihanalyzes dihedral transitions diff --git a/share/html/online/g_dih.html b/share/html/online/g_dih.html deleted file mode 100644 index e61741b377..0000000000 --- a/share/html/online/g_dih.html +++ /dev/null @@ -1,53 +0,0 @@ - - -g_dih - - - -
- - - -
-

g_dih

Main Table of Contents

VERSION 4.5
-Thu 26 Aug 2010

-
-

Description

-

-g_dih can do two things. The default is to analyze dihedral transitions -by merely computing all the dihedral angles defined in your topology -for the whole trajectory. When a dihedral flips over to another minimum -an angle/time plot is made.

-The opther option is to discretize the dihedral space into a number of -bins, and group each conformation in dihedral space in the -appropriate bin. The output is then given as a number of dihedral -conformations sorted according to occupancy. -

-

Files

- - - - - -
optionfilenametypedescription
-f traj.xtc Input Trajectory: xtc trr trj gro g96 pdb cpt
-s topol.tpr Input Run input file: tpr tpb tpa
-o hello.out Output Generic output file
-

-

Other options

- - - - - - - - - - - -
optiontypedefaultdescription
-[no]h gmx_bool no Print help info and quit
-[no]version gmx_bool no Print version info and quit
-nice int 19 Set the nicelevel
-b time 0 First frame (ps) to read from trajectory
-e time 0 Last frame (ps) to read from trajectory
-dt time 0 Only use frame when t MOD dt = first time (ps)
-[no]w gmx_bool no View output xvg, xpm, eps and pdb files
-[no]sa gmx_bool no Perform cluster analysis in dihedral space instead of analysing dihedral transitions.
-mult int -1 mulitiplicity for dihedral angles (by default read from topology)
-

-


-
-http://www.gromacs.org
-gromacs@gromacs.org
-
- diff --git a/share/top/links.dat b/share/top/links.dat index 4a2a7d9817..443f1f9f24 100644 --- a/share/top/links.dat +++ b/share/top/links.dat @@ -22,7 +22,6 @@ g_coord g_covar g_density g_dielectric -g_dih g_dipoles g_disre g_dist diff --git a/src/tools/CMakeLists.txt b/src/tools/CMakeLists.txt index ab2b2e814d..a158b5e081 100644 --- a/src/tools/CMakeLists.txt +++ b/src/tools/CMakeLists.txt @@ -43,7 +43,7 @@ add_library(gmxana gmx_analyze.c gmx_anaeig.c gmx_angle.c gmx_bond.c gmx_bundle.c gmx_chi.c gmx_cluster.c gmx_confrms.c gmx_covar.c gmx_current.c - gmx_density.c gmx_densmap.c gmx_dih.c + gmx_density.c gmx_densmap.c gmx_dielectric.c gmx_kinetics.c gmx_spatial.c gmx_tune_pme.c gmx_dipoles.c gmx_disre.c gmx_dist.c gmx_dyndom.c @@ -82,7 +82,7 @@ set(GMX_TOOLS_PROGRAMS make_ndx mk_angndx trjcat trjconv trjorder g_wheel xpm2ps genion g_anadock make_edi g_analyze g_anaeig g_angle g_bond g_bundle g_chi g_cluster g_confrms g_covar - g_current g_density g_densmap g_dih g_dielectric + g_current g_density g_densmap g_dielectric g_helixorient g_principal g_dipoles g_disre g_dist g_dyndom g_enemat g_energy g_lie g_filter g_gyrate g_h2order g_hbond g_helix g_mindist g_msd g_morph g_nmeig diff --git a/src/tools/g_dih.c b/src/tools/g_dih.c deleted file mode 100644 index 5b6b448438..0000000000 --- a/src/tools/g_dih.c +++ /dev/null @@ -1,57 +0,0 @@ -/* - * This file is part of the GROMACS molecular simulation package. - * - * Copyright (c) 1991-2000, University of Groningen, The Netherlands. - * Copyright (c) 2001-2004, The GROMACS development team, - * check out http://www.gromacs.org for more information. - * Copyright (c) 2012, by the GROMACS development team, led by - * David van der Spoel, Berk Hess, Erik Lindahl, and including many - * others, as listed in the AUTHORS file in the top-level source - * directory and at http://www.gromacs.org. - * - * GROMACS is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation; either version 2.1 - * of the License, or (at your option) any later version. - * - * GROMACS is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with GROMACS; if not, see - * http://www.gnu.org/licenses, or write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * If you want to redistribute modifications to GROMACS, please - * consider that scientific software is very special. Version - * control is crucial - bugs must be traceable. We will be happy to - * consider code for inclusion in the official distribution, but - * derived work must not be called official GROMACS. Details are found - * in the README & COPYING files - if they are missing, get the - * official version at http://www.gromacs.org. - * - * To help us fund GROMACS development, we humbly ask that you cite - * the research papers on the package. Check out http://www.gromacs.org. - */ -#ifdef HAVE_CONFIG_H -#include -#endif - -#include - - -/* This is just a wrapper binary. -* The code that used to be in g_dih.c is now in gmx_dih.c, -* where the old main function is called gmx_dih(). -*/ -int -main(int argc, char *argv[]) -{ - gmx_dih(argc,argv); - return 0; -} - - - diff --git a/src/tools/gmx_dih.c b/src/tools/gmx_dih.c deleted file mode 100644 index 795621064d..0000000000 --- a/src/tools/gmx_dih.c +++ /dev/null @@ -1,372 +0,0 @@ -/* - * This file is part of the GROMACS molecular simulation package. - * - * Copyright (c) 1991-2000, University of Groningen, The Netherlands. - * Copyright (c) 2001-2004, The GROMACS development team, - * check out http://www.gromacs.org for more information. - * Copyright (c) 2012, by the GROMACS development team, led by - * David van der Spoel, Berk Hess, Erik Lindahl, and including many - * others, as listed in the AUTHORS file in the top-level source - * directory and at http://www.gromacs.org. - * - * GROMACS is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation; either version 2.1 - * of the License, or (at your option) any later version. - * - * GROMACS is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with GROMACS; if not, see - * http://www.gnu.org/licenses, or write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - * If you want to redistribute modifications to GROMACS, please - * consider that scientific software is very special. Version - * control is crucial - bugs must be traceable. We will be happy to - * consider code for inclusion in the official distribution, but - * derived work must not be called official GROMACS. Details are found - * in the README & COPYING files - if they are missing, get the - * official version at http://www.gromacs.org. - * - * To help us fund GROMACS development, we humbly ask that you cite - * the research papers on the package. Check out http://www.gromacs.org. - */ -#ifdef HAVE_CONFIG_H -#include -#endif -#include - -#include "sysstuff.h" -#include "string2.h" -#include "copyrite.h" -#include "futil.h" -#include "smalloc.h" -#include "statutil.h" -#include "nrama.h" -#include "physics.h" -#include "macros.h" -#include "xvgr.h" -#include "vec.h" -#include "gmx_ana.h" - - -#define NOMIN 'X' - -static void ana_dih(FILE *out,char *index,int nframes,real dih[],t_dih *dd) -{ - int i; - real mind,maxd,sum,av,var,prev,width; - gmx_bool bTrans; - - mind=5400,maxd=-5400,sum=0,av=0,var=0; - - prev=dih[0]; - for(i=0; (i 180) { - /* PBC.. */ - dih[i]-=360; - } - else if ((dih[i]-prev) < -180) - dih[i]+=360; - prev=dih[i]; - - sum+=dih[i]; - mind=min(mind,dih[i]); - maxd=max(maxd,dih[i]); - } - av=sum/nframes; - for(i=0; (imult); - bTrans=((maxd - mind) > width); - - fprintf(out,"%-10s %10.3f %10.3f %10.3f %10.3f %10.3f %-10s%3.0f\n", - index,mind,av,maxd,var,sqrt(var), - bTrans ? "Yep" : "",width); -} - -static int find_min(real phi,int ntab,real phitab[]) -{ - int i,imin; - real mind,mm; - real width; - - /* Set closest minimum to the first one */ - width=360.0/ntab; - mind=fabs(phi-phitab[0]); - imin=0; - for(i=1; (iphi0); - while (phiref < 0) - phiref+=360; - while (phiref > 360) - phiref-=360; - - switch(mult) { - case 2: - vpp=find_min(phiref,2,m2); - break; - case 3: - vpp=find_min(phiref,3,m3); - break; - case 4: - vpp=find_min(phiref,4,m4); - break; - case 6: - vpp=find_min(phiref,6,m6); - break; - default: - gmx_fatal(FARGS,"No such multiplicity %d",dih->mult); - } - - if (vpp == -1) - return NOMIN; - else - return vpp+'0'; -} - -typedef struct t_cluster { - int ndih; - int freq; - char *minimum; - struct t_cluster *next; -} t_cluster; - -static t_cluster *search_cluster(t_cluster *cl,char *minimum) -{ - t_cluster *ccl=cl; - - while (ccl != NULL) { - if (strcmp(minimum,ccl->minimum)==0) - return ccl; - ccl=ccl->next; - } - return NULL; -} - -static void add_cluster(t_cluster **cl,int ndih,char *minimum) -{ - t_cluster *loper; - t_cluster *ccl; - - snew(ccl,1); - ccl->ndih=ndih; - ccl->freq=1; - ccl->minimum=strdup(minimum); - ccl->next=NULL; - - if (*cl == NULL) - *cl=ccl; - else { - loper=*cl; - while (loper->next != NULL) - loper=loper->next; - loper->next=ccl; - } -} - -static void p_cluster(FILE *out,t_cluster *cl) -{ - t_cluster *loper; - - fprintf(out,"* * * C L U S T E R A N A L Y S I S * * *\n\n"); - fprintf(out," Frequency Dihedral minima\n"); - loper=cl; - while (loper != NULL) { - fprintf(out,"%10d %s\n",loper->freq,loper->minimum); - loper=loper->next; - } -} - -static void ana_cluster(FILE *out, t_xrama *xr,real **dih,real time[], - t_topology *top,int nframes,int mult) -{ - t_cluster *cl=NULL,*scl; - char *minimum; - int i,j,nx; - - /* Number of dihedrals + terminating NULL - * this allows for using string routines - */ - snew(minimum,xr->ndih+1); - - for(i=0; (indih); j++) { - minimum[j] = vphi(&xr->dih[j],dih[j][i], - mult == -1 ? xr->dih[j].mult : mult); - if (minimum[j] == NOMIN) - nx++; - } - if (nx == 0) { - if ((scl=search_cluster(cl,minimum)) == NULL) - add_cluster(&cl,xr->ndih,minimum); - else - scl->freq++; - } - } - p_cluster(out,cl); - - sfree(minimum); -} - -static void ana_trans(FILE *out, t_xrama *xr,real **dih,real time[], - t_topology *top,int nframes, const output_env_t oenv) -{ - FILE *outd; - real prev_phi,prev_psi; - int i,j,phi,psi; - char buf[10]; - - fprintf(out,"\n\t* * * D I H E D R A L S T A T I S T I C S * * *\n\n"); - fprintf(out,"%-10s %10s %10s %10s %10s %10s %10s\n", - "index","minimum","average","maximum","variance","std.dev", - "transition"); - for(i=0; (indih); i++) { - sprintf(buf,"dih-%d",i); - ana_dih(out,buf,nframes,dih[i],&(xr->dih[i])); - } - for(i=0; (inpp); i++) { - sprintf(buf,"%s",xr->pp[i].label); - outd=xvgropen(buf,"Dihedral Angles","Time (ps)","Degrees",oenv); - - phi=xr->pp[i].iphi; - psi=xr->pp[i].ipsi; - prev_phi=dih[phi][0]; - prev_psi=dih[psi][0]; - for(j=0; (j 180) - dih[phi][j]-=360; - else if ((dih[phi][j]-prev_phi) < -180) - dih[phi][j]+=360; - prev_phi=dih[phi][j]; - if ((dih[psi][j]-prev_psi) > 180) - dih[psi][j]-=360; - else if ((dih[psi][j]-prev_psi) < -180) - dih[psi][j]+=360; - prev_psi=dih[psi][j]; - fprintf(outd,"%10g %10g %10g\n",time[j],prev_phi,prev_psi); - } - ffclose(outd); - } -} - -int gmx_dih(int argc,char *argv[]) -{ - const char *desc[] = { - "[TT]g_dih[tt] can do two things. The default is to analyze dihedral transitions", - "by merely computing all the dihedral angles defined in your topology", - "for the whole trajectory. When a dihedral flips over to another minimum", - "an angle/time plot is made.[PAR]", - "The opther option is to discretize the dihedral space into a number of", - "bins, and group each conformation in dihedral space in the", - "appropriate bin. The output is then given as a number of dihedral", - "conformations sorted according to occupancy." - }; - static int mult = -1; - static gmx_bool bSA = FALSE; - t_pargs pa[] = { - { "-sa", FALSE, etBOOL, {&bSA}, - "Perform cluster analysis in dihedral space instead of analysing dihedral transitions." }, - { "-mult", FALSE, etINT, {&mult}, - "mulitiplicity for dihedral angles (by default read from topology)" } - }; - FILE *out; - t_xrama *xr; - t_topology *top; - real **dih,*time; - real dd; - int i,nframes,maxframes=1000; - output_env_t oenv; - t_filenm fnm[] = { - { efTRX, "-f", NULL, ffREAD }, - { efTPX, NULL, NULL, ffREAD }, - { efOUT, NULL, NULL, ffWRITE } - }; -#define NFILE asize(fnm) - - CopyRight(stderr,argv[0]); - parse_common_args(&argc,argv,PCA_CAN_VIEW | PCA_CAN_TIME | PCA_BE_NICE, - NFILE,fnm,asize(pa),pa,asize(desc),desc,0,NULL,&oenv); - - if (mult != -1) - fprintf(stderr,"Using %d for dihedral multiplicity rather than topology values\n",mult); - - snew(xr,1); - init_rama(oenv,ftp2fn(efTRX,NFILE,fnm), - ftp2fn(efTPX,NFILE,fnm),xr,3); - top=read_top(ftp2fn(efTPX,NFILE,fnm),NULL); - - /* Brute force malloc, may be too big... */ - snew(dih,xr->ndih); - for(i=0; (indih); i++) - snew(dih[i],maxframes); - snew(time,maxframes); - - fprintf(stderr,"\n"); - nframes = 0; - while (new_data(xr)) { - for(i=0; (indih); i++) { - dd=xr->dih[i].ang*RAD2DEG; - while (dd < 0) - dd+=360; - while (dd > 360) - dd-=360; - dih[i][nframes]=dd; - } - time[nframes]=xr->t; - nframes++; - if (nframes > maxframes) { - maxframes += 1000; - for(i=0; (indih); i++) - srenew(dih[i],maxframes); - srenew(time,maxframes); - } - } - - fprintf(stderr,"\nCalculated all dihedrals, now analysing...\n"); - - out=ftp2FILE(efOUT,NFILE,fnm,"w"); - - if (bSA) { - /* Cluster and structure analysis */ - ana_cluster(out,xr,dih,time,top,nframes,mult); - } - else { - /* Analyse transitions... */ - ana_trans(out,xr,dih,time,top,nframes,oenv); - } - ffclose(out); - - thanx(stderr); - - return 0; -}