int main(int argc,char *argv[])
{
const char *desc[] = {
"[TT]g_anadock[tt] analyses the results of an Autodock run and clusters the",
"structures together, based on distance or RMSD. The docked energy",
"and free energy estimates are analysed, and for each cluster the",
"energy statistics are printed.[PAR]",
"An alternative approach to this is to cluster the structures first",
"using [TT]g_cluster[tt] and then sort the clusters on either lowest",
"energy or average energy."
};
t_filenm fnm[] = {
{ efPDB, "-f", NULL, ffREAD },
{ efPDB, "-ox", "cluster", ffWRITE },
{ efXVG, "-od", "edocked", ffWRITE },
{ efXVG, "-of", "efree", ffWRITE },
{ efLOG, "-g", "anadock", ffWRITE }
};
output_env_t oenv;
#define NFILE asize(fnm)
static gmx_bool bFree=FALSE,bRMS=TRUE;
static real cutoff = 0.2;
t_pargs pa[] = {
{ "-free", FALSE, etBOOL, {&bFree},
"Use Free energy estimate from autodock for sorting the classes" },
{ "-rms", FALSE, etBOOL, {&bRMS},
"Cluster on RMS or distance" },
{ "-cutoff", FALSE, etREAL, {&cutoff},
"Maximum RMSD/distance for belonging to the same cluster" }
};
#define NPA asize(pa)
FILE *fp;
t_pdbfile **pdbf=NULL;
int npdbf;
CopyRight(stderr,argv[0]);
parse_common_args(&argc,argv,0,NFILE,fnm,NPA,pa, asize(desc),desc,0,
NULL,&oenv);
fp = ffopen(opt2fn("-g",NFILE,fnm),"w");
please_cite(stdout,"Hetenyi2002b");
please_cite(fp,"Hetenyi2002b");
pdbf = read_em_all(opt2fn("-f",NFILE,fnm),&npdbf);
analyse_em_all(npdbf,pdbf,opt2fn("-od",NFILE,fnm),opt2fn("-of",NFILE,fnm),
oenv);
cluster_em_all(fp,npdbf,pdbf,opt2fn("-ox",NFILE,fnm),
bFree,bRMS,cutoff);
thanx(fp);
ffclose(fp);
thanx(stdout);
return 0;
}
static void vdw_warning(FILE *fp)
{
if (NULL != fp)
{
fprintf(fp, "NOTE: From version 5.0 %s uses the Van der Waals radii\n",
gmx::getProgramContext().displayName());
fprintf(fp, "from the source below. This means the results may be different\n");
fprintf(fp, "compared to previous GROMACS versions.\n");
please_cite(fp, "Bondi1964a");
}
}
int gmx_dos(int argc, char *argv[])
{
const char *desc[] = {
"[TT]g_dos[tt] computes the Density of States from a simulations.",
"In order for this to be meaningful the velocities must be saved",
"in the trajecotry with sufficiently high frequency such as to cover",
"all vibrations. For flexible systems that would be around a few fs",
"between saving. Properties based on the DoS are printed on the",
"standard output."
};
const char *bugs[] = {
"This program needs a lot of memory: total usage equals the number of atoms times 3 times number of frames times 4 (or 8 when run in double precision)."
};
FILE *fp, *fplog;
t_topology top;
int ePBC = -1;
t_trxframe fr;
matrix box;
int gnx;
char title[256];
real t0, t1, m;
t_trxstatus *status;
int nV, nframes, n_alloc, i, j, k, l, fftcode, Nmol, Natom;
double rho, dt, V2sum, Vsum, V, tmass, dostot, dos2, dosabs;
real **c1, **dos, mi, beta, bfac, *nu, *tt, stddev, c1j;
output_env_t oenv;
gmx_fft_t fft;
double cP, S, A, E, DiffCoeff, Delta, f, y, z, sigHS, Shs, Sig, DoS0, recip_fac;
double wCdiff, wSdiff, wAdiff, wEdiff;
static gmx_bool bVerbose = TRUE, bAbsolute = FALSE, bNormalize = FALSE;
static gmx_bool bRecip = FALSE, bDump = FALSE;
static real Temp = 298.15, toler = 1e-6;
t_pargs pa[] = {
{ "-v", FALSE, etBOOL, {&bVerbose},
"Be loud and noisy." },
{ "-recip", FALSE, etBOOL, {&bRecip},
"Use cm^-1 on X-axis instead of 1/ps for DoS plots." },
{ "-abs", FALSE, etBOOL, {&bAbsolute},
"Use the absolute value of the Fourier transform of the VACF as the Density of States. Default is to use the real component only" },
{ "-normdos", FALSE, etBOOL, {&bNormalize},
"Normalize the DoS such that it adds up to 3N. This is a hack that should not be necessary." },
{ "-T", FALSE, etREAL, {&Temp},
"Temperature in the simulation" },
{ "-toler", FALSE, etREAL, {&toler},
"[HIDDEN]Tolerance when computing the fluidicity using bisection algorithm" },
{ "-dump", FALSE, etBOOL, {&bDump},
"[HIDDEN]Dump the y/fy plot corresponding to Fig. 2 inLin2003a and the and the weighting functions corresponding to Fig. 1 in Berens1983a." }
};
t_filenm fnm[] = {
{ efTRN, "-f", NULL, ffREAD },
{ efTPX, "-s", NULL, ffREAD },
{ efNDX, NULL, NULL, ffOPTRD },
{ efXVG, "-vacf", "vacf", ffWRITE },
{ efXVG, "-mvacf", "mvacf", ffWRITE },
{ efXVG, "-dos", "dos", ffWRITE },
{ efLOG, "-g", "dos", ffWRITE },
};
#define NFILE asize(fnm)
int npargs;
t_pargs *ppa;
const char *DoSlegend[] = {
"DoS(v)", "DoS(v)[Solid]", "DoS(v)[Diff]"
};
npargs = asize(pa);
ppa = add_acf_pargs(&npargs, pa);
parse_common_args(&argc, argv, PCA_CAN_VIEW | PCA_CAN_TIME | PCA_BE_NICE,
NFILE, fnm, npargs, ppa, asize(desc), desc,
asize(bugs), bugs, &oenv);
beta = 1/(Temp*BOLTZ);
if (bDump)
{
printf("Dumping reference figures. Thanks for your patience.\n");
dump_fy(oenv, toler);
dump_w(oenv, beta);
exit(0);
}
fplog = gmx_fio_fopen(ftp2fn(efLOG, NFILE, fnm), "w");
fprintf(fplog, "Doing density of states analysis based on trajectory.\n");
please_cite(fplog, "Pascal2011a");
please_cite(fplog, "Caleman2011b");
read_tps_conf(ftp2fn(efTPX, NFILE, fnm), title, &top, &ePBC, NULL, NULL, box,
TRUE);
V = det(box);
tmass = 0;
for (i = 0; (i < top.atoms.nr); i++)
{
tmass += top.atoms.atom[i].m;
}
Natom = top.atoms.nr;
Nmol = top.mols.nr;
gnx = Natom*DIM;
/* Correlation stuff */
//.........这里部分代码省略.........
int gmx_dielectric(int argc, char *argv[])
{
const char *desc[] = {
"[THISMODULE] calculates frequency dependent dielectric constants",
"from the autocorrelation function of the total dipole moment in",
"your simulation. This ACF can be generated by [gmx-dipoles].",
"The functional forms of the available functions are:[PAR]",
"One parameter: y = [EXP]-a[SUB]1[sub] x[exp],[BR]",
"Two parameters: y = a[SUB]2[sub] [EXP]-a[SUB]1[sub] x[exp],[BR]",
"Three parameters: y = a[SUB]2[sub] [EXP]-a[SUB]1[sub] x[exp] + (1 - a[SUB]2[sub]) [EXP]-a[SUB]3[sub] x[exp].[BR]",
"Start values for the fit procedure can be given on the command line.",
"It is also possible to fix parameters at their start value, use [TT]-fix[tt]",
"with the number of the parameter you want to fix.",
"[PAR]",
"Three output files are generated, the first contains the ACF,",
"an exponential fit to it with 1, 2 or 3 parameters, and the",
"numerical derivative of the combination data/fit.",
"The second file contains the real and imaginary parts of the",
"frequency-dependent dielectric constant, the last gives a plot",
"known as the Cole-Cole plot, in which the imaginary",
"component is plotted as a function of the real component.",
"For a pure exponential relaxation (Debye relaxation) the latter",
"plot should be one half of a circle."
};
t_filenm fnm[] = {
{ efXVG, "-f", "dipcorr", ffREAD },
{ efXVG, "-d", "deriv", ffWRITE },
{ efXVG, "-o", "epsw", ffWRITE },
{ efXVG, "-c", "cole", ffWRITE }
};
#define NFILE asize(fnm)
output_env_t oenv;
int i, j, nx, ny, nxtail, eFitFn, nfitparm;
real dt, integral, fitintegral, *fitparms, fac, rffac;
double **yd;
real **y;
const char *legend[] = { "Correlation", "Std. Dev.", "Fit", "Combined", "Derivative" };
static int fix = 0, bFour = 0, bX = 1, nsmooth = 3;
static real tendInt = 5.0, tbegin = 5.0, tend = 500.0;
static real A = 0.5, tau1 = 10.0, tau2 = 1.0, eps0 = 80, epsRF = 78.5, tail = 500.0;
real lambda;
t_pargs pa[] = {
{ "-fft", FALSE, etBOOL, {&bFour},
"use fast fourier transform for correlation function" },
{ "-x1", FALSE, etBOOL, {&bX},
"use first column as [IT]x[it]-axis rather than first data set" },
{ "-eint", FALSE, etREAL, {&tendInt},
"Time to end the integration of the data and start to use the fit"},
{ "-bfit", FALSE, etREAL, {&tbegin},
"Begin time of fit" },
{ "-efit", FALSE, etREAL, {&tend},
"End time of fit" },
{ "-tail", FALSE, etREAL, {&tail},
"Length of function including data and tail from fit" },
{ "-A", FALSE, etREAL, {&A},
"Start value for fit parameter A" },
{ "-tau1", FALSE, etREAL, {&tau1},
"Start value for fit parameter [GRK]tau[grk]1" },
{ "-tau2", FALSE, etREAL, {&tau2},
"Start value for fit parameter [GRK]tau[grk]2" },
{ "-eps0", FALSE, etREAL, {&eps0},
"[GRK]epsilon[grk]0 of your liquid" },
{ "-epsRF", FALSE, etREAL, {&epsRF},
"[GRK]epsilon[grk] of the reaction field used in your simulation. A value of 0 means infinity." },
{ "-fix", FALSE, etINT, {&fix},
"Fix parameters at their start values, A (2), tau1 (1), or tau2 (4)" },
{ "-ffn", FALSE, etENUM, {s_ffn},
"Fit function" },
{ "-nsmooth", FALSE, etINT, {&nsmooth},
"Number of points for smoothing" }
};
if (!parse_common_args(&argc, argv, PCA_CAN_TIME | PCA_CAN_VIEW | PCA_BE_NICE,
NFILE, fnm, asize(pa), pa, asize(desc), desc, 0, NULL, &oenv))
{
return 0;
}
please_cite(stdout, "Spoel98a");
printf("WARNING: non-polarizable models can never yield an infinite\n"
"dielectric constant that is different from 1. This is incorrect\n"
"in the reference given above (Spoel98a).\n\n");
nx = read_xvg(opt2fn("-f", NFILE, fnm), &yd, &ny);
dt = yd[0][1] - yd[0][0];
nxtail = min(tail/dt, nx);
printf("Read data set containing %d colums and %d rows\n", ny, nx);
printf("Assuming (from data) that timestep is %g, nxtail = %d\n",
dt, nxtail);
snew(y, 6);
for (i = 0; (i < ny); i++)
{
snew(y[i], max(nx, nxtail));
}
for (i = 0; (i < nx); i++)
{
y[0][i] = yd[0][i];
for (j = 1; (j < ny); j++)
{
//.........这里部分代码省略.........
请发表评论