Remove broken g_dih tool
authorErik Lindahl <erik@kth.se>
Fri, 28 Dec 2012 19:26:57 +0000 (20:26 +0100)
committerGerrit Code Review <gerrit@gerrit.gromacs.org>
Thu, 10 Jan 2013 15:30:24 +0000 (16:30 +0100)
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

admin/programs.txt
include/gmx_ana.h
share/html/online.html
share/html/online/g_dih.html [deleted file]
share/top/links.dat
src/tools/CMakeLists.txt
src/tools/g_dih.c [deleted file]
src/tools/gmx_dih.c [deleted file]

index bee575792fffe20763105ac73012e34ee624bc4c..fc35a7dde6a6fe6ef7c6dc1f743c921ad758ff56 100644 (file)
@@ -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
 
index 9e2fd91b5c90aaf254aeac7991f349c24a61155f..dd26ff1fd77af5b61a2d5a448a0aee0bc382f2b9 100644 (file)
@@ -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[]);
index fea72694c7824b5be192fafbb31a1c50e2c9dc91..7655758f51bda31af990ae4807f3cf01363daedb 100644 (file)
@@ -66,7 +66,6 @@ Thu 26 Aug 2010</B></td>
 <br><a href=online/g_density.html>g_density</a>
 <br><a href=online/g_densmap.html>g_densmap</a>
 <br><a href=online/g_dielectric.html>g_dielectric</a>
-<br><a href=online/g_dih.html>g_dih</a>
 <br><a href=online/g_dipoles.html>g_dipoles</a>
 <br><a href=online/g_disre.html>g_disre</a>
 <br><a href=online/g_dist.html>g_dist</a>
@@ -283,7 +282,6 @@ Thu 26 Aug 2010</B></td>
 <TR><TD><A HREF="online/g_bond.html">g_bond</A></TD><TD>calculates bond length distributions</TD>
 <TR><TD><A HREF="online/mk_angndx.html">mk_angndx</A></TD><TD>generates index files for g_angle</TD>
 <TR><TD><A HREF="online/g_angle.html">g_angle</A></TD><TD>calculates distributions and correlations for angles and dihedrals</TD>
-<TR><TD><A HREF="online/g_dih.html">g_dih</A></TD><TD>analyzes dihedral transitions</TD>
 </TABLE>
 
 <A NAME="HNR11">
diff --git a/share/html/online/g_dih.html b/share/html/online/g_dih.html
deleted file mode 100644 (file)
index e61741b..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-<HTML>
-<HEAD>
-<TITLE>g_dih</TITLE>
-<LINK rel=stylesheet href="style.css" type="text/css">
-<BODY text="#000000" bgcolor="#FFFFFF" link="#0000FF" vlink="#990000" alink="#FF0000">
-<TABLE WIDTH="98%" NOBORDER >
-<TR><TD WIDTH=400>
-<TABLE WIDTH=400 NOBORDER>
-<TD WIDTH=116>
-<a href="http://www.gromacs.org/"><img SRC="../images/gmxlogo_small.png"BORDER=0 </a></td>
-<td ALIGN=LEFT VALIGN=TOP WIDTH=280><br><h2>g_dih</h2><font size=-1><A HREF="../online.html">Main Table of Contents</A></font><br><br></td>
-</TABLE></TD><TD WIDTH="*" ALIGN=RIGHT VALIGN=BOTTOM><p><B>VERSION 4.5<br>
-Thu 26 Aug 2010</B></td></tr></TABLE>
-<HR>
-<H3>Description</H3>
-<p>
-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.<p>
-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.
-<P>
-<H3>Files</H3>
-<TABLE BORDER=1 CELLSPACING=0 CELLPADDING=2>
-<TR><TH>option</TH><TH>filename</TH><TH>type</TH><TH>description</TH></TR>
-<TR><TD ALIGN=RIGHT> <b><tt>-f</tt></b> </TD><TD ALIGN=RIGHT> <tt><a href="files.html">    traj.xtc</a></tt> </TD><TD> Input </TD><TD> Trajectory: <a href="xtc.html">xtc</a> <a href="trr.html">trr</a> <a href="trj.html">trj</a> <a href="gro.html">gro</a> <a href="g96.html">g96</a> <a href="pdb.html">pdb</a> cpt </TD></TR>
-<TR><TD ALIGN=RIGHT> <b><tt>-s</tt></b> </TD><TD ALIGN=RIGHT> <tt><a href="files.html">   topol.tpr</a></tt> </TD><TD> Input </TD><TD> Run input file: <a href="tpr.html">tpr</a> <a href="tpb.html">tpb</a> <a href="tpa.html">tpa</a> </TD></TR>
-<TR><TD ALIGN=RIGHT> <b><tt>-o</tt></b> </TD><TD ALIGN=RIGHT> <tt><a href="out.html">   hello.out</a></tt> </TD><TD> Output </TD><TD> Generic output file </TD></TR>
-</TABLE>
-<P>
-<H3>Other options</H3>
-<TABLE BORDER=1 CELLSPACING=0 CELLPADDING=2>
-<TR><TH>option</TH><TH>type</TH><TH>default</TH><TH>description</TH></TR>
-<TR><TD ALIGN=RIGHT> <b><tt>-[no]h</tt></b> </TD><TD ALIGN=RIGHT> gmx_bool </TD><TD ALIGN=RIGHT> <tt>no    </tt> </TD><TD> Print help info and quit </TD></TD>
-<TR><TD ALIGN=RIGHT> <b><tt>-[no]version</tt></b> </TD><TD ALIGN=RIGHT> gmx_bool </TD><TD ALIGN=RIGHT> <tt>no    </tt> </TD><TD> Print version info and quit </TD></TD>
-<TR><TD ALIGN=RIGHT> <b><tt>-nice</tt></b> </TD><TD ALIGN=RIGHT> int </TD><TD ALIGN=RIGHT> <tt>19</tt> </TD><TD> Set the nicelevel </TD></TD>
-<TR><TD ALIGN=RIGHT> <b><tt>-b</tt></b> </TD><TD ALIGN=RIGHT> time </TD><TD ALIGN=RIGHT> <tt>0     </tt> </TD><TD> First frame (ps) to read from trajectory </TD></TD>
-<TR><TD ALIGN=RIGHT> <b><tt>-e</tt></b> </TD><TD ALIGN=RIGHT> time </TD><TD ALIGN=RIGHT> <tt>0     </tt> </TD><TD> Last frame (ps) to read from trajectory </TD></TD>
-<TR><TD ALIGN=RIGHT> <b><tt>-dt</tt></b> </TD><TD ALIGN=RIGHT> time </TD><TD ALIGN=RIGHT> <tt>0     </tt> </TD><TD> Only use frame when t MOD dt = first time (ps) </TD></TD>
-<TR><TD ALIGN=RIGHT> <b><tt>-[no]w</tt></b> </TD><TD ALIGN=RIGHT> gmx_bool </TD><TD ALIGN=RIGHT> <tt>no    </tt> </TD><TD> View output <a href="xvg.html">xvg</a>, <a href="xpm.html">xpm</a>, <a href="eps.html">eps</a> and <a href="pdb.html">pdb</a> files </TD></TD>
-<TR><TD ALIGN=RIGHT> <b><tt>-[no]sa</tt></b> </TD><TD ALIGN=RIGHT> gmx_bool </TD><TD ALIGN=RIGHT> <tt>no    </tt> </TD><TD> Perform cluster analysis in dihedral space instead of analysing dihedral transitions. </TD></TD>
-<TR><TD ALIGN=RIGHT> <b><tt>-mult</tt></b> </TD><TD ALIGN=RIGHT> int </TD><TD ALIGN=RIGHT> <tt>-1</tt> </TD><TD> mulitiplicity for dihedral angles (by default read from topology) </TD></TD>
-</TABLE>
-<P>
-<hr>
-<div ALIGN=RIGHT>
-<font size="-1"><a href="http://www.gromacs.org">http://www.gromacs.org</a></font><br>
-<font size="-1"><a href="mailto:gromacs@gromacs.org">gromacs@gromacs.org</a></font><br>
-</div>
-</BODY>
index 4a2a7d9817c713c771d88f412f36ca44b976bcf2..443f1f9f2453562a17e71f1aa2cb942adec29247 100644 (file)
@@ -22,7 +22,6 @@ g_coord
 g_covar
 g_density
 g_dielectric
-g_dih
 g_dipoles
 g_disre
 g_dist
index ab2b2e814dbb28278be23926f7c7995d359c9272..a158b5e0811a39dca01d6c77ddab89ffb716b37b 100644 (file)
@@ -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 (file)
index 5b6b448..0000000
+++ /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 <config.h>
-#endif
-
-#include <gmx_ana.h>
-
-
-/* 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 (file)
index 7956210..0000000
+++ /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 <config.h>
-#endif
-#include <math.h>
-
-#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<nframes); i++) {
-    if ((dih[i]-prev) > 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; (i<nframes); i++)
-    var+=sqr(dih[i]-av);
-  var/=nframes;
-  width=(360.0/dd->mult);
-  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; (i<ntab); i++) {
-    mm=fabs(phi-phitab[i]);
-    if (mm < mind) {
-      imin=i;
-      mind=mm;
-    }
-  }
-  if (mind < width*0.5 )
-    return imin;
-  else
-    return -1;
-}
-
-static int vphi(t_dih *dih,real phi,int mult)
-{
-  static real m2[] = { 90, 270 };
-  static real m3[] = { 60, 180, 300 };
-  static real m4[] = { 45, 135, 225, 315 };
-  static real m6[] = { 30, 90, 150, 210, 270, 330 };
-
-  real phiref;
-  int  vpp=0;
-  
-  phiref=RAD2DEG*(phi-dih->phi0);
-  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; (i<nframes); i++) {
-    nx=0;
-    for(j=0; (j<xr->ndih); 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; (i<xr->ndih); i++) {
-    sprintf(buf,"dih-%d",i);
-    ana_dih(out,buf,nframes,dih[i],&(xr->dih[i]));
-  }
-  for(i=0; (i<xr->npp); 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<nframes); j++) {
-      /* PBC.. */
-      if ((dih[phi][j]-prev_phi) > 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; (i<xr->ndih); i++)
-    snew(dih[i],maxframes);
-  snew(time,maxframes);
-
-  fprintf(stderr,"\n");
-  nframes = 0;
-  while (new_data(xr)) {
-    for(i=0; (i<xr->ndih); 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; (i<xr->ndih); 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;
-}