* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
* Copyright (c) 2012,2013,2014,2015,2017 by the GROMACS development team.
- * Copyright (c) 2018,2019,2020, by the GROMACS development team, led by
+ * Copyright (c) 2018,2019,2020,2021, by the GROMACS development team, led by
* Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://www.gromacs.org.
#if HAVE_PIPES || GMX_NATIVE_WINDOWS
sprintf(dssp, "%s -i %s %s", strings.dptr.c_str(), strings.pdbfile.c_str(), redirectionString.c_str());
#else
- sprintf(dssp, "%s -i %s -o %s > %s %s", strings.dptr.c_str(), strings.pdbfile.c_str(),
- strings.tmpfile.c_str(), NULL_DEVICE, redirectionString.c_str());
+ sprintf(dssp,
+ "%s -i %s -o %s > %s %s",
+ strings.dptr.c_str(),
+ strings.pdbfile.c_str(),
+ strings.tmpfile.c_str(),
+ NULL_DEVICE,
+ redirectionString.c_str());
#endif
}
int average_area[],
const gmx_output_env_t* oenv)
{
- static gmx_bool bFirst = TRUE;
- static char* ssbuf;
- char buf[STRLEN + 1];
- char SSTP;
- int nr, iacc, nresidues;
- int naccf, naccb; /* Count hydrophobic and hydrophilic residues */
- real iaccf, iaccb;
+ static gmx_bool bFirst = TRUE;
+ static std::string ssbuf;
+ char buf[STRLEN + 1];
+ char SSTP;
+ int nr, iacc, nresidues;
+ int naccf, naccb; /* Count hydrophobic and hydrophilic residues */
+ real iaccf, iaccb;
/* Skip header */
* we allocate 2*nres-1, since for each chain there is a
* separating line in the temp file. (At most each residue
* could have been defined as a separate chain.) */
- snew(ssbuf, 2 * nres - 1);
+ ssbuf.resize(2 * nres - 1);
}
iaccb = iaccf = 0;
{
if (nullptr != acc)
{
- fprintf(stderr, "%d residues were classified as hydrophobic and %d as hydrophilic.\n",
- naccb, naccf);
+ fprintf(stderr, "%d residues were classified as hydrophobic and %d as hydrophilic.\n", naccb, naccf);
}
mat->title = "Secondary structure";
if (i != j)
{
fprintf(stderr,
- "Not all residues were recognized (%d from %d), the result may be inaccurate!\n", j, i);
+ "Not all residues were recognized (%d from %d), the result may be inaccurate!\n",
+ j,
+ i);
}
for (i = 0; (i < n_surf); i++)
static void check_oo(t_atoms* atoms)
{
- char* OOO;
+ char* OOO = gmx_strdup("O");
- int i;
-
- OOO = gmx_strdup("O");
-
- for (i = 0; (i < atoms->nr); i++)
+ for (int i = 0; (i < atoms->nr); i++)
{
if ((std::strcmp(*(atoms->atomname[i]), "OXT") == 0)
|| (std::strcmp(*(atoms->atomname[i]), "O1") == 0)
- || (std::strcmp(*(atoms->atomname[i]), "OC1") == 0))
+ || (std::strcmp(*(atoms->atomname[i]), "OC1") == 0)
+ || (std::strcmp(*(atoms->atomname[i]), "OT1") == 0))
{
*atoms->atomname[i] = OOO;
}
}
else
{
- fprintf(stderr, "Residue %s not found in surface database (%s)\n",
- *atoms->resinfo[i].name, surffn);
+ fprintf(stderr, "Residue %s not found in surface database (%s)\n", *atoms->resinfo[i].name, surffn);
}
}
}
}
fp = gmx_ffopen(fn, "w");
nlev = static_cast<int>(hi - lo + 1);
- write_xpm(fp, 0, "Solvent Accessible Surface", "Surface (A^2)", "Time", "Residue Index",
- nframe, nres, mat->axis_x.data(), mat->axis_y.data(), accr, lo, hi, rlo, rhi, &nlev);
+ write_xpm(fp,
+ 0,
+ "Solvent Accessible Surface",
+ "Surface (A^2)",
+ "Time",
+ "Residue Index",
+ nframe,
+ nres,
+ mat->axis_x.data(),
+ mat->axis_y.data(),
+ accr,
+ lo,
+ hi,
+ rlo,
+ rhi,
+ &nlev);
gmx_ffclose(fp);
}
}
leg.emplace_back(m.desc);
}
- fp = xvgropen(outfile, "Secondary Structure", output_env_get_xvgr_tlabel(oenv),
- "Number of Residues", oenv);
+ fp = xvgropen(
+ outfile, "Secondary Structure", output_env_get_xvgr_tlabel(oenv), "Number of Residues", oenv);
if (output_env_get_print_xvgr_codes(oenv))
{
fprintf(fp, "@ subtitle \"Structure = ");
int gmx_do_dssp(int argc, char* argv[])
{
const char* desc[] = {
- "[THISMODULE] ", "reads a trajectory file and computes the secondary structure for",
- "each time frame ", "calling the dssp program. If you do not have the dssp program,",
- "get it from http://swift.cmbi.ru.nl/gv/dssp. [THISMODULE] assumes ",
+ "[THISMODULE] ",
+ "reads a trajectory file and computes the secondary structure for",
+ "each time frame ",
+ "calling the dssp program. If you do not have the dssp program,",
+ "get it from https://swift.cmbi.umcn.nl/gv/dssp. [THISMODULE] assumes ",
"that the dssp executable is located in ",
// NOLINTNEXTLINE(bugprone-suspicious-missing-comma)
"[TT]" GMX_DSSP_PROGRAM_PATH "[tt]. If this is not the case, then you should",
- "set an environment variable [TT]DSSP[tt] pointing to the dssp", "executable, e.g.: [PAR]",
+ "set an environment variable [TT]DSSP[tt] pointing to the dssp",
+ "executable, e.g.: [PAR]",
"[TT]setenv DSSP /opt/dssp/bin/dssp[tt][PAR]",
"Since version 2.0.0, dssp is invoked with a syntax that differs",
"from earlier versions. If you have an older version of dssp,",
"[REF].xpm[ref] matrix file. This file can be visualized with for instance",
"[TT]xv[tt] and can be converted to postscript with [TT]xpm2ps[tt].",
"Individual chains are separated by light grey lines in the [REF].xpm[ref] and",
- "postscript files.", "The number of residues with each secondary structure type and the",
+ "postscript files.",
+ "The number of residues with each secondary structure type and the",
"total secondary structure ([TT]-sss[tt]) count as a function of",
"time are also written to file ([TT]-sc[tt]).[PAR]",
"Solvent accessible surface (SAS) per residue can be calculated, both in",
};
#define NFILE asize(fnm)
- if (!parse_common_args(&argc, argv, PCA_CAN_TIME | PCA_CAN_VIEW | PCA_TIME_UNIT, NFILE, fnm,
- asize(pa), pa, asize(desc), desc, 0, nullptr, &oenv))
+ if (!parse_common_args(&argc,
+ argv,
+ PCA_CAN_TIME | PCA_CAN_VIEW | PCA_TIME_UNIT,
+ NFILE,
+ fnm,
+ asize(pa),
+ pa,
+ asize(desc),
+ desc,
+ 0,
+ nullptr,
+ &oenv))
{
return 0;
}
if (fnTArea)
{
- fTArea = xvgropen(fnTArea, "Solvent Accessible Surface Area",
- output_env_get_xvgr_tlabel(oenv), "Area (nm\\S2\\N)", oenv);
+ fTArea = xvgropen(fnTArea,
+ "Solvent Accessible Surface Area",
+ output_env_get_xvgr_tlabel(oenv),
+ "Area (nm\\S2\\N)",
+ oenv);
xvgr_legend(fTArea, 2, leg, oenv);
}
else