2 * This file is part of the GROMACS molecular simulation package.
4 * Copyright (c) 2012,2013,2014,2015,2016,2017, by the GROMACS development team, led by
5 * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
6 * and including many others, as listed in the AUTHORS file in the
7 * top-level source directory and at http://www.gromacs.org.
9 * GROMACS is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public License
11 * as published by the Free Software Foundation; either version 2.1
12 * of the License, or (at your option) any later version.
14 * GROMACS is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * Lesser General Public License for more details.
19 * You should have received a copy of the GNU Lesser General Public
20 * License along with GROMACS; if not, see
21 * http://www.gnu.org/licenses, or write to the Free Software Foundation,
22 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
24 * If you want to redistribute modifications to GROMACS, please
25 * consider that scientific software is very special. Version
26 * control is crucial - bugs must be traceable. We will be happy to
27 * consider code for inclusion in the official distribution, but
28 * derived work must not be called official GROMACS. Details are found
29 * in the README & COPYING files - if they are missing, get the
30 * official version at http://www.gromacs.org.
32 * To help us fund GROMACS development, we humbly ask that you cite
33 * the research papers on the package. Check out http://www.gromacs.org.
36 * Registers command-line modules for pre-5.0 binaries.
38 * \author Teemu Murtola <teemu.murtola@gmail.com>
42 #include "legacymodules.h"
46 #include "gromacs/commandline/cmdlinemodule.h"
47 #include "gromacs/commandline/cmdlinemodulemanager.h"
48 #include "gromacs/commandline/cmdlineoptionsmodule.h"
49 #include "gromacs/gmxana/gmx_ana.h"
50 #include "gromacs/gmxpreprocess/genconf.h"
51 #include "gromacs/gmxpreprocess/grompp.h"
52 #include "gromacs/gmxpreprocess/insert-molecules.h"
53 #include "gromacs/gmxpreprocess/pdb2gmx.h"
54 #include "gromacs/gmxpreprocess/solvate.h"
55 #include "gromacs/gmxpreprocess/x2top.h"
56 #include "gromacs/tools/check.h"
57 #include "gromacs/tools/convert_tpr.h"
58 #include "gromacs/tools/dump.h"
60 #include "mdrun/mdrun_main.h"
61 #include "view/view.h"
67 * Command line module that provides information about obsolescence.
69 * Prints a message directing the user to a wiki page describing replacement
72 class ObsoleteToolModule
: public gmx::ICommandLineModule
75 //! Creates an obsolete tool module for a tool with the given name.
76 explicit ObsoleteToolModule(const char *name
)
81 virtual const char *name() const
85 virtual const char *shortDescription() const
90 virtual void init(gmx::CommandLineModuleSettings
* /*settings*/)
93 virtual int run(int /*argc*/, char * /*argv*/[])
98 virtual void writeHelp(const gmx::CommandLineHelpContext
& /*context*/) const
104 void printMessage() const
107 "This tool is no longer present in GROMACS. Please see\n"
108 " http://jenkins.gromacs.org/job/Documentation_Nightly_master/javadoc/user-guide/cmdline.html#command-changes\n"
109 "for ideas how to perform the same tasks with the "
116 //! Initializer for a module that defaults to nice level zero.
117 void initSettingsNoNice(gmx::CommandLineModuleSettings
*settings
)
119 settings
->setDefaultNiceLevel(0);
123 * Convenience function for creating and registering a module.
125 * \param[in] manager Module manager to which to register the module.
126 * \param[in] mainFunction Main function to wrap.
127 * \param[in] name Name for the new module.
128 * \param[in] shortDescription One-line description for the new module.
130 void registerModule(gmx::CommandLineModuleManager
*manager
,
131 gmx::CommandLineModuleManager::CMainFunction mainFunction
,
132 const char *name
, const char *shortDescription
)
134 manager
->addModuleCMain(name
, shortDescription
, mainFunction
);
138 * Convenience function for creating and registering a module that defaults to
141 * \param[in] manager Module manager to which to register the module.
142 * \param[in] mainFunction Main function to wrap.
143 * \param[in] name Name for the new module.
144 * \param[in] shortDescription One-line description for the new module.
146 void registerModuleNoNice(gmx::CommandLineModuleManager
*manager
,
147 gmx::CommandLineModuleManager::CMainFunction mainFunction
,
148 const char *name
, const char *shortDescription
)
150 manager
->addModuleCMainWithSettings(name
, shortDescription
, mainFunction
,
151 &initSettingsNoNice
);
155 * Convenience function for registering a module for an obsolete tool.
157 * \param[in] manager Module manager to which to register the module.
158 * \param[in] name Name for the obsolete tool.
160 void registerObsoleteTool(gmx::CommandLineModuleManager
*manager
,
163 gmx::CommandLineModulePointer
module(new ObsoleteToolModule(name
));
164 manager
->addModule(std::move(module
));
169 void registerLegacyModules(gmx::CommandLineModuleManager
*manager
)
171 // Modules from this directory (were in src/kernel/).
172 registerModule(manager
, &gmx_check
, "check",
173 "Check and compare files");
174 registerModule(manager
, &gmx_dump
, "dump",
175 "Make binary files human readable");
176 registerModule(manager
, &gmx_grompp
, "grompp",
177 "Make a run input file");
178 registerModule(manager
, &gmx_pdb2gmx
, "pdb2gmx",
179 "Convert coordinate files to topology and FF-compliant coordinate files");
180 registerModule(manager
, &gmx_convert_tpr
, "convert-tpr",
181 "Make a modifed run-input file");
182 registerObsoleteTool(manager
, "tpbconv");
183 registerModule(manager
, &gmx_x2top
, "x2top",
184 "Generate a primitive topology from coordinates");
186 registerModuleNoNice(manager
, &gmx_mdrun
, "mdrun",
187 "Perform a simulation, do a normal mode analysis or an energy minimization");
189 gmx::ICommandLineOptionsModule::registerModuleFactory(
190 manager
, gmx::InsertMoleculesInfo::name
,
191 gmx::InsertMoleculesInfo::shortDescription
,
192 &gmx::InsertMoleculesInfo::create
);
194 // Modules from gmx_ana.h.
195 registerModule(manager
, &gmx_do_dssp
, "do_dssp",
196 "Assign secondary structure and calculate solvent accessible surface area");
197 registerModule(manager
, &gmx_editconf
, "editconf",
198 "Convert and manipulates structure files");
199 registerModule(manager
, &gmx_eneconv
, "eneconv",
200 "Convert energy files");
201 registerModule(manager
, &gmx_solvate
, "solvate",
203 registerObsoleteTool(manager
, "genbox");
204 registerModule(manager
, &gmx_genconf
, "genconf",
205 "Multiply a conformation in 'random' orientations");
206 registerModule(manager
, &gmx_genion
, "genion",
207 "Generate monoatomic ions on energetically favorable positions");
208 registerModule(manager
, &gmx_genpr
, "genrestr",
209 "Generate position restraints or distance restraints for index groups");
210 registerModule(manager
, &gmx_make_edi
, "make_edi",
211 "Generate input files for essential dynamics sampling");
212 registerModule(manager
, &gmx_make_ndx
, "make_ndx",
214 registerModule(manager
, &gmx_mk_angndx
, "mk_angndx",
215 "Generate index files for 'gmx angle'");
216 registerModule(manager
, &gmx_trjcat
, "trjcat",
217 "Concatenate trajectory files");
218 registerModule(manager
, &gmx_trjconv
, "trjconv",
219 "Convert and manipulates trajectory files");
220 registerModule(manager
, &gmx_trjorder
, "trjorder",
221 "Order molecules according to their distance to a group");
222 registerModule(manager
, &gmx_xpm2ps
, "xpm2ps",
223 "Convert XPM (XPixelMap) matrices to postscript or XPM");
225 registerModule(manager
, &gmx_anadock
, "anadock",
226 "Cluster structures from Autodock runs");
227 registerModule(manager
, &gmx_anaeig
, "anaeig",
228 "Analyze eigenvectors/normal modes");
229 registerModule(manager
, &gmx_analyze
, "analyze",
230 "Analyze data sets");
231 registerModule(manager
, &gmx_g_angle
, "angle",
232 "Calculate distributions and correlations for angles and dihedrals");
233 registerModule(manager
, &gmx_awh
, "awh",
234 "Extract data from an accelerated weight histogram (AWH) run");
235 registerModule(manager
, &gmx_bar
, "bar",
236 "Calculate free energy difference estimates through Bennett's acceptance ratio");
237 registerObsoleteTool(manager
, "bond");
238 registerObsoleteTool(manager
, "dist");
239 registerObsoleteTool(manager
, "sas");
240 registerObsoleteTool(manager
, "sgangle");
242 registerModule(manager
, &gmx_bundle
, "bundle",
243 "Analyze bundles of axes, e.g., helices");
244 registerModule(manager
, &gmx_chi
, "chi",
245 "Calculate everything you want to know about chi and other dihedrals");
246 registerModule(manager
, &gmx_cluster
, "cluster",
247 "Cluster structures");
248 registerModule(manager
, &gmx_clustsize
, "clustsize",
249 "Calculate size distributions of atomic clusters");
250 registerModule(manager
, &gmx_confrms
, "confrms",
251 "Fit two structures and calculates the RMSD");
252 registerModule(manager
, &gmx_covar
, "covar",
253 "Calculate and diagonalize the covariance matrix");
254 registerModule(manager
, &gmx_current
, "current",
255 "Calculate dielectric constants and current autocorrelation function");
256 registerModule(manager
, &gmx_density
, "density",
257 "Calculate the density of the system");
258 registerModule(manager
, &gmx_densmap
, "densmap",
259 "Calculate 2D planar or axial-radial density maps");
260 registerModule(manager
, &gmx_densorder
, "densorder",
261 "Calculate surface fluctuations");
262 registerModule(manager
, &gmx_dielectric
, "dielectric",
263 "Calculate frequency dependent dielectric constants");
264 registerModule(manager
, &gmx_dipoles
, "dipoles",
265 "Compute the total dipole plus fluctuations");
266 registerModule(manager
, &gmx_disre
, "disre",
267 "Analyze distance restraints");
268 registerModule(manager
, &gmx_dos
, "dos",
269 "Analyze density of states and properties based on that");
270 registerModule(manager
, &gmx_dyecoupl
, "dyecoupl",
271 "Extract dye dynamics from trajectories");
272 registerModule(manager
, &gmx_dyndom
, "dyndom",
273 "Interpolate and extrapolate structure rotations");
274 registerModule(manager
, &gmx_enemat
, "enemat",
275 "Extract an energy matrix from an energy file");
276 registerModule(manager
, &gmx_energy
, "energy",
277 "Writes energies to xvg files and display averages");
278 registerModule(manager
, &gmx_filter
, "filter",
279 "Frequency filter trajectories, useful for making smooth movies");
280 registerModule(manager
, &gmx_gyrate
, "gyrate",
281 "Calculate the radius of gyration");
282 registerModule(manager
, &gmx_h2order
, "h2order",
283 "Compute the orientation of water molecules");
284 registerModule(manager
, &gmx_hbond
, "hbond",
285 "Compute and analyze hydrogen bonds");
286 registerModule(manager
, &gmx_helix
, "helix",
287 "Calculate basic properties of alpha helices");
288 registerModule(manager
, &gmx_helixorient
, "helixorient",
289 "Calculate local pitch/bending/rotation/orientation inside helices");
290 registerModule(manager
, &gmx_hydorder
, "hydorder",
291 "Compute tetrahedrality parameters around a given atom");
292 registerModule(manager
, &gmx_lie
, "lie",
293 "Estimate free energy from linear combinations");
294 registerModule(manager
, &gmx_mdmat
, "mdmat",
295 "Calculate residue contact maps");
296 registerModule(manager
, &gmx_mindist
, "mindist",
297 "Calculate the minimum distance between two groups");
298 registerModule(manager
, &gmx_morph
, "morph",
299 "Interpolate linearly between conformations");
300 registerModule(manager
, &gmx_msd
, "msd",
301 "Calculates mean square displacements");
302 registerModule(manager
, &gmx_nmeig
, "nmeig",
303 "Diagonalize the Hessian for normal mode analysis");
304 registerModule(manager
, &gmx_nmens
, "nmens",
305 "Generate an ensemble of structures from the normal modes");
306 registerModule(manager
, &gmx_nmr
, "nmr",
307 "Analyze nuclear magnetic resonance properties from an energy file");
308 registerModule(manager
, &gmx_nmtraj
, "nmtraj",
309 "Generate a virtual oscillating trajectory from an eigenvector");
310 registerModule(manager
, &gmx_order
, "order",
311 "Compute the order parameter per atom for carbon tails");
312 registerModule(manager
, &gmx_pme_error
, "pme_error",
313 "Estimate the error of using PME with a given input file");
314 registerModule(manager
, &gmx_polystat
, "polystat",
315 "Calculate static properties of polymers");
316 registerModule(manager
, &gmx_potential
, "potential",
317 "Calculate the electrostatic potential across the box");
318 registerModule(manager
, &gmx_principal
, "principal",
319 "Calculate principal axes of inertia for a group of atoms");
320 registerModule(manager
, &gmx_rama
, "rama",
321 "Compute Ramachandran plots");
322 registerModule(manager
, &gmx_rms
, "rms",
323 "Calculate RMSDs with a reference structure and RMSD matrices");
324 registerModule(manager
, &gmx_rmsdist
, "rmsdist",
325 "Calculate atom pair distances averaged with power -2, -3 or -6");
326 registerModule(manager
, &gmx_rmsf
, "rmsf",
327 "Calculate atomic fluctuations");
328 registerModule(manager
, &gmx_rotacf
, "rotacf",
329 "Calculate the rotational correlation function for molecules");
330 registerModule(manager
, &gmx_rotmat
, "rotmat",
331 "Plot the rotation matrix for fitting to a reference structure");
332 registerModule(manager
, &gmx_saltbr
, "saltbr",
333 "Compute salt bridges");
334 registerModule(manager
, &gmx_sans
, "sans",
335 "Compute small angle neutron scattering spectra");
336 registerModule(manager
, &gmx_saxs
, "saxs",
337 "Compute small angle X-ray scattering spectra");
338 registerModule(manager
, &gmx_sham
, "sham",
339 "Compute free energies or other histograms from histograms");
340 registerModule(manager
, &gmx_sigeps
, "sigeps",
341 "Convert c6/12 or c6/cn combinations to and from sigma/epsilon");
342 registerModule(manager
, &gmx_sorient
, "sorient",
343 "Analyze solvent orientation around solutes");
344 registerModule(manager
, &gmx_spatial
, "spatial",
345 "Calculate the spatial distribution function");
346 registerModule(manager
, &gmx_spol
, "spol",
347 "Analyze solvent dipole orientation and polarization around solutes");
348 registerModule(manager
, &gmx_tcaf
, "tcaf",
349 "Calculate viscosities of liquids");
350 registerModule(manager
, &gmx_traj
, "traj",
351 "Plot x, v, f, box, temperature and rotational energy from trajectories");
352 registerModule(manager
, &gmx_tune_pme
, "tune_pme",
353 "Time mdrun as a function of PME ranks to optimize settings");
354 registerModule(manager
, &gmx_vanhove
, "vanhove",
355 "Compute Van Hove displacement and correlation functions");
356 registerModule(manager
, &gmx_velacc
, "velacc",
357 "Calculate velocity autocorrelation functions");
358 registerModule(manager
, &gmx_wham
, "wham",
359 "Perform weighted histogram analysis after umbrella sampling");
360 registerModule(manager
, &gmx_wheel
, "wheel",
361 "Plot helical wheels");
362 registerModuleNoNice(manager
, &gmx_view
, "view",
363 "View a trajectory on an X-Windows terminal");
366 gmx::CommandLineModuleGroup group
=
367 manager
->addModuleGroup("Generating topologies and coordinates");
368 group
.addModuleWithDescription("editconf", "Edit the box and write subgroups");
369 group
.addModule("x2top");
370 group
.addModule("solvate");
371 group
.addModule("insert-molecules");
372 group
.addModule("genconf");
373 group
.addModule("genion");
374 group
.addModule("genrestr");
375 group
.addModule("pdb2gmx");
378 gmx::CommandLineModuleGroup group
=
379 manager
->addModuleGroup("Running a simulation");
380 group
.addModule("grompp");
381 group
.addModule("mdrun");
382 group
.addModule("convert-tpr");
385 gmx::CommandLineModuleGroup group
=
386 manager
->addModuleGroup("Viewing trajectories");
387 group
.addModule("nmtraj");
388 group
.addModule("view");
391 gmx::CommandLineModuleGroup group
=
392 manager
->addModuleGroup("Processing energies");
393 group
.addModule("enemat");
394 group
.addModule("energy");
395 group
.addModuleWithDescription("mdrun", "(Re)calculate energies for trajectory frames with -rerun");
398 gmx::CommandLineModuleGroup group
=
399 manager
->addModuleGroup("Converting files");
400 group
.addModule("editconf");
401 group
.addModule("eneconv");
402 group
.addModule("sigeps");
403 group
.addModule("trjcat");
404 group
.addModule("trjconv");
405 group
.addModule("xpm2ps");
408 gmx::CommandLineModuleGroup group
=
409 manager
->addModuleGroup("Tools");
410 group
.addModule("analyze");
411 group
.addModule("awh");
412 group
.addModule("dyndom");
413 group
.addModule("filter");
414 group
.addModule("lie");
415 group
.addModule("morph");
416 group
.addModule("pme_error");
417 group
.addModule("sham");
418 group
.addModule("spatial");
419 group
.addModule("traj");
420 group
.addModule("tune_pme");
421 group
.addModule("wham");
422 group
.addModule("check");
423 group
.addModule("dump");
424 group
.addModule("make_ndx");
425 group
.addModule("mk_angndx");
426 group
.addModule("trjorder");
427 group
.addModule("xpm2ps");
430 gmx::CommandLineModuleGroup group
=
431 manager
->addModuleGroup("Distances between structures");
432 group
.addModule("cluster");
433 group
.addModule("confrms");
434 group
.addModule("rms");
435 group
.addModule("rmsf");
438 gmx::CommandLineModuleGroup group
=
439 manager
->addModuleGroup("Distances in structures over time");
440 group
.addModule("mindist");
441 group
.addModule("mdmat");
442 group
.addModule("polystat");
443 group
.addModule("rmsdist");
446 gmx::CommandLineModuleGroup group
=
447 manager
->addModuleGroup("Mass distribution properties over time");
448 group
.addModule("gyrate");
449 group
.addModule("msd");
450 group
.addModule("polystat");
451 group
.addModule("rdf");
452 group
.addModule("rotacf");
453 group
.addModule("rotmat");
454 group
.addModule("sans");
455 group
.addModule("saxs");
456 group
.addModule("traj");
457 group
.addModule("vanhove");
460 gmx::CommandLineModuleGroup group
=
461 manager
->addModuleGroup("Analyzing bonded interactions");
462 group
.addModule("angle");
463 group
.addModule("mk_angndx");
466 gmx::CommandLineModuleGroup group
=
467 manager
->addModuleGroup("Structural properties");
468 group
.addModule("anadock");
469 group
.addModule("bundle");
470 group
.addModule("clustsize");
471 group
.addModule("disre");
472 group
.addModule("hbond");
473 group
.addModule("order");
474 group
.addModule("principal");
475 group
.addModule("rdf");
476 group
.addModule("saltbr");
477 group
.addModule("sorient");
478 group
.addModule("spol");
481 gmx::CommandLineModuleGroup group
=
482 manager
->addModuleGroup("Kinetic properties");
483 group
.addModule("bar");
484 group
.addModule("current");
485 group
.addModule("dos");
486 group
.addModule("dyecoupl");
487 group
.addModule("principal");
488 group
.addModule("tcaf");
489 group
.addModule("traj");
490 group
.addModule("vanhove");
491 group
.addModule("velacc");
494 gmx::CommandLineModuleGroup group
=
495 manager
->addModuleGroup("Electrostatic properties");
496 group
.addModule("current");
497 group
.addModule("dielectric");
498 group
.addModule("dipoles");
499 group
.addModule("potential");
500 group
.addModule("spol");
501 group
.addModule("genion");
504 gmx::CommandLineModuleGroup group
=
505 manager
->addModuleGroup("Protein-specific analysis");
506 group
.addModule("do_dssp");
507 group
.addModule("chi");
508 group
.addModule("helix");
509 group
.addModule("helixorient");
510 group
.addModule("rama");
511 group
.addModule("wheel");
514 gmx::CommandLineModuleGroup group
=
515 manager
->addModuleGroup("Interfaces");
516 group
.addModule("bundle");
517 group
.addModule("density");
518 group
.addModule("densmap");
519 group
.addModule("densorder");
520 group
.addModule("h2order");
521 group
.addModule("hydorder");
522 group
.addModule("order");
523 group
.addModule("potential");
526 gmx::CommandLineModuleGroup group
=
527 manager
->addModuleGroup("Covariance analysis");
528 group
.addModuleWithDescription("anaeig", "Analyze the eigenvectors");
529 group
.addModule("covar");
530 group
.addModule("make_edi");
533 gmx::CommandLineModuleGroup group
=
534 manager
->addModuleGroup("Normal modes");
535 group
.addModuleWithDescription("anaeig", "Analyze the normal modes");
536 group
.addModule("nmeig");
537 group
.addModule("nmtraj");
538 group
.addModule("nmens");
539 group
.addModule("grompp");
540 group
.addModuleWithDescription("mdrun", "Find a potential energy minimum and calculate the Hessian");