* 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 "gmxpre.h"
#include <math.h>
+#include <string.h>
#include "gromacs/fileio/confio.h"
-#include "gmx_fatal.h"
#include "fitahx.h"
-#include "gromacs/fileio/futil.h"
+#include "gromacs/utility/futil.h"
#include "gstat.h"
-#include "gromacs/fileio/g87io.h"
#include "hxprops.h"
-#include "macros.h"
+#include "gromacs/legacyheaders/macros.h"
#include "gromacs/math/utilities.h"
-#include "pbc.h"
#include "gromacs/fileio/tpxio.h"
#include "gromacs/fileio/trxio.h"
-#include "physics.h"
-#include "index.h"
-#include "smalloc.h"
-#include "gromacs/commandline/pargs.h"
-#include <string.h>
-#include "sysstuff.h"
-#include "txtdump.h"
-#include "typedefs.h"
-#include "vec.h"
-#include "xvgr.h"
+#include "gromacs/utility/smalloc.h"
+#include "gromacs/legacyheaders/txtdump.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/viewit.h"
#include "gmx_ana.h"
-void dump_otrj(FILE *otrj, int natoms, atom_id all_index[], rvec x[],
- real fac, rvec xav[])
-{
- static FILE *fp = NULL;
- static real fac0 = 1.0;
-
- int i, ai, m;
- real xa, xm;
-
- if (fp == NULL)
- {
- fp = ffopen("WEDGAMMA10.DAT", "w");
- fac0 = fac;
- }
- fac /= fac0;
-
- fprintf(fp, "%10g\n", fac);
-
- for (i = 0; (i < natoms); i++)
- {
- ai = all_index[i];
- for (m = 0; (m < DIM); m++)
- {
- xa = xav[ai][m];
- xm = x[ai][m]*fac;
- xav[ai][m] = xa+xm;
- x[ai][m] = xm;
- }
- }
- write_g87_ndx(otrj, natoms, all_index, x, NULL);
-}
+#include "gromacs/commandline/pargs.h"
+#include "gromacs/fileio/xvgr.h"
+#include "gromacs/pbcutil/rmpbc.h"
+#include "gromacs/utility/fatalerror.h"
int gmx_helix(int argc, char *argv[])
{
"[BB]9.[bb] Ellipticity at 222 nm according to Hirst and Brooks.",
"[PAR]"
};
- static const char *ppp[efhNR+2] = {
- NULL, "RAD", "TWIST", "RISE", "LEN", "NHX", "DIP", "RMS", "CPHI",
- "RMSA", "PHI", "PSI", "HB3", "HB4", "HB5", "CD222", NULL
- };
static gmx_bool bCheck = FALSE, bFit = TRUE, bDBG = FALSE, bEV = FALSE;
static int rStart = 0, rEnd = 0, r0 = 1;
t_pargs pa [] = {
"Toggle fit to a perfect helix" },
{ "-db", FALSE, etBOOL, {&bDBG},
"Print debug info" },
- { "-prop", FALSE, etENUM, {ppp},
- "Select property to weight eigenvectors with. WARNING experimental stuff" },
{ "-ev", FALSE, etBOOL, {&bEV},
"Write a new 'trajectory' file for ED" },
{ "-ahxstart", FALSE, etINT, {&rStart},
};
output_env_t oenv;
- FILE *otrj;
- char buf[54], prop[256];
+ char buf[54];
t_trxstatus *status;
int natoms, nre, nres;
t_bb *bb;
- int i, j, ai, m, nall, nbb, nca, teller, nSel = 0;
+ int i, j, m, nall, nbb, nca, teller, nSel = 0;
atom_id *bbindex, *caindex, *allindex;
t_topology *top;
int ePBC;
- rvec *x, *xref, *xav;
+ rvec *x, *xref;
real t;
- real rms, fac;
+ real rms;
matrix box;
gmx_rmpbc_t gpbc = NULL;
gmx_bool bRange;
t_filenm fnm[] = {
- { efTPX, NULL, NULL, ffREAD },
+ { efTPR, NULL, NULL, ffREAD },
{ efNDX, NULL, NULL, ffREAD },
{ efTRX, "-f", NULL, ffREAD },
- { efG87, "-to", NULL, ffOPTWR },
{ efSTO, "-cz", "zconf", ffWRITE },
- { efSTO, "-co", "waver", ffWRITE }
};
#define NFILE asize(fnm)
- if (!parse_common_args(&argc, argv, PCA_CAN_VIEW | PCA_CAN_TIME | PCA_BE_NICE,
+ if (!parse_common_args(&argc, argv, PCA_CAN_VIEW | PCA_CAN_TIME,
NFILE, fnm, asize(pa), pa, asize(desc), desc, 0, NULL, &oenv))
{
return 0;
bRange = (opt2parg_bSet("-ahxstart", asize(pa), pa) &&
opt2parg_bSet("-ahxend", asize(pa), pa));
- top = read_top(ftp2fn(efTPX, NFILE, fnm), &ePBC);
+ top = read_top(ftp2fn(efTPR, NFILE, fnm), &ePBC);
natoms = read_first_x(oenv, &status, opt2fn("-f", NFILE, fnm), &t, &x, box);
- if (opt2bSet("-to", NFILE, fnm))
- {
- otrj = opt2FILE("-to", NFILE, fnm, "w");
- strcpy(prop, ppp[0]);
- fprintf(otrj, "%s Weighted Trajectory: %d atoms, NO box\n", prop, natoms);
- }
- else
- {
- otrj = NULL;
- }
-
if (natoms != top->atoms.nr)
{
gmx_fatal(FARGS, "Sorry can only run when the number of atoms in the run input file (%d) is equal to the number in the trajectory (%d)",
{
sprintf(buf, "%s.out", xf[i].filenm);
remove(buf);
- xf[i].fp2 = ffopen(buf, "w");
+ xf[i].fp2 = gmx_ffopen(buf, "w");
}
}
/* Read reference frame from tpx file to compute helix length */
snew(xref, top->atoms.nr);
- read_tpx(ftp2fn(efTPX, NFILE, fnm),
+ read_tpx(ftp2fn(efTPR, NFILE, fnm),
NULL, NULL, &natoms, xref, NULL, NULL, NULL);
calc_hxprops(nres, bb, xref);
do_start_end(nres, bb, &nbb, bbindex, &nca, caindex, bRange, rStart, rEnd);
gpbc = gmx_rmpbc_init(&top->idef, ePBC, natoms);
- snew(xav, natoms);
teller = 0;
do
{
xf[efhHB4].fp, xf[efhHB4].fp2,
xf[efhHB5].fp, xf[efhHB5].fp2,
t, nres, bb);
-
- if (otrj)
- {
- dump_otrj(otrj, nall, allindex, x, xf[nSel].val, xav);
- }
}
}
while (read_next_x(oenv, status, &t, x, box));
close_trj(status);
- if (otrj)
- {
- ffclose(otrj);
- fac = 1.0/teller;
- for (i = 0; (i < nall); i++)
- {
- ai = allindex[i];
- for (m = 0; (m < DIM); m++)
- {
- xav[ai][m] *= fac;
- }
- }
- write_sto_conf_indexed(opt2fn("-co", NFILE, fnm),
- "Weighted and Averaged conformation",
- &(top->atoms), xav, NULL, ePBC, box, nall, allindex);
- }
-
for (i = 0; (i < nres); i++)
{
if (bb[i].nrms > 0)
for (i = 0; (i < efhNR); i++)
{
- ffclose(xf[i].fp);
+ gmx_ffclose(xf[i].fp);
if (xf[i].bfp2)
{
- ffclose(xf[i].fp2);
+ gmx_ffclose(xf[i].fp2);
}
do_view(oenv, xf[i].filenm, "-nxy");
}