Moved ngmx to C++, renamed it to view.
[alexxy/gromacs.git] / src / programs / gmx / legacymodules.cpp
1 /*
2  * This file is part of the GROMACS molecular simulation package.
3  *
4  * Copyright (c) 2012,2013, by the GROMACS development team, led by
5  * David van der Spoel, Berk Hess, Erik Lindahl, and including many
6  * others, as listed in the AUTHORS file in the top-level source
7  * directory and at http://www.gromacs.org.
8  *
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.
13  *
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.
18  *
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.
23  *
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.
31  *
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.
34  */
35 /*! \internal \brief
36  * Registers command-line modules for pre-5.0 binaries.
37  *
38  * \author Teemu Murtola <teemu.murtola@gmail.com>
39  */
40 #include "legacymodules.h"
41
42 #include "gromacs/commandline/cmdlinemodule.h"
43 #include "gromacs/commandline/cmdlinemodulemanager.h"
44 #include "gromacs/onlinehelp/helpwritercontext.h"
45 #include "gromacs/utility/exceptions.h"
46
47 #include "gromacs/gmxana/gmx_ana.h"
48
49 #include "../view/view.h"
50 #include "../mdrun/mdrun_main.h"
51
52 extern "C"
53 {
54
55 int gmx_gmxcheck(int argc, char *argv[]);
56 int gmx_gmxdump(int argc, char *argv[]);
57 int gmx_grompp(int argc, char *argv[]);
58 int gmx_pdb2gmx(int argc, char *argv[]);
59 int gmx_protonate(int argc, char *argv[]);
60 int gmx_tpbconv(int argc, char *argv[]);
61 int gmx_x2top(int argc, char *argv[]);
62
63 }
64
65 namespace
66 {
67
68 /*! \brief
69  * Convenience function for creating and registering a module.
70  *
71  * \param[in] manager          Module manager to which to register the module.
72  * \param[in] mainFunction     Main function to wrap.
73  * \param[in] name             Name for the new module.
74  * \param[in] shortDescription One-line description for the new module.
75  */
76 void registerModule(gmx::CommandLineModuleManager                *manager,
77                     gmx::CommandLineModuleManager::CMainFunction  mainFunction,
78                     const char *name, const char *shortDescription)
79 {
80     manager->addModuleCMain(name, shortDescription, mainFunction);
81 }
82
83 } // namespace
84
85 void registerLegacyModules(gmx::CommandLineModuleManager *manager)
86 {
87     // Modules from this directory (were in src/kernel/).
88     registerModule(manager, &gmx_gmxcheck, "gmxcheck",
89                    "Check and compare files");
90     registerModule(manager, &gmx_gmxdump, "gmxdump",
91                    "Make binary files human readable");
92     registerModule(manager, &gmx_grompp, "grompp",
93                    "Make a run input file");
94     registerModule(manager, &gmx_pdb2gmx, "pdb2gmx",
95                    "Convert coordinate files to topology and FF-compliant coordinate files");
96     registerModule(manager, &gmx_tpbconv, "tpbconv",
97                    "Make a run input file for restarting a crashed run");
98
99     registerModule(manager, &gmx_protonate, "protonate",
100                    "Protonate structures");
101     registerModule(manager, &gmx_x2top, "x2top",
102                    "Generate a primitive topology from coordinates");
103
104     registerModule(manager, &gmx_mdrun, "mdrun",
105                    "Perform a simulation, do a normal mode analysis or an energy minimization");
106
107     // Modules from gmx_ana.h.
108     registerModule(manager, &gmx_do_dssp, "do_dssp",
109                    "Assign secondary structure and calculate solvent accessible surface area");
110     registerModule(manager, &gmx_editconf, "editconf",
111                    "Convert and manipulates structure files");
112     registerModule(manager, &gmx_eneconv, "eneconv",
113                    "Convert energy files");
114     registerModule(manager, &gmx_genbox, "genbox",
115                    "Solvate a system");
116     registerModule(manager, &gmx_genconf, "genconf",
117                    "Multiply a conformation in 'random' orientations");
118     registerModule(manager, &gmx_genion, "genion",
119                    "Generate monoatomic ions on energetically favorable positions");
120     registerModule(manager, &gmx_genpr, "genrestr",
121                    "Generate position restraints or distance restraints for index groups");
122     registerModule(manager, &gmx_make_edi, "make_edi",
123                    "Generate input files for essential dynamics sampling");
124     registerModule(manager, &gmx_make_ndx, "make_ndx",
125                    "Make index files");
126     registerModule(manager, &gmx_mk_angndx, "mk_angndx",
127                    "Generate index files for 'gmx angle'");
128     registerModule(manager, &gmx_trjcat, "trjcat",
129                    "Concatenate trajectory files");
130     registerModule(manager, &gmx_trjconv, "trjconv",
131                    "Convert and manipulates trajectory files");
132     registerModule(manager, &gmx_trjorder, "trjorder",
133                    "Order molecules according to their distance to a group");
134     registerModule(manager, &gmx_xpm2ps, "xpm2ps",
135                    "Convert XPM (XPixelMap) matrices to postscript or XPM");
136
137     registerModule(manager, &gmx_anadock, "anadock",
138                    "Cluster structures from Autodock runs");
139     registerModule(manager, &gmx_anaeig, "anaeig",
140                    "Analyze eigenvectors/normal modes");
141     registerModule(manager, &gmx_analyze, "analyze",
142                    "Analyze data sets");
143     registerModule(manager, &gmx_g_angle, "angle",
144                    "Calculate distributions and correlations for angles and dihedrals");
145     registerModule(manager, &gmx_bar, "bar",
146                    "Calculate free energy difference estimates through Bennett's acceptance ratio");
147     registerModule(manager, &gmx_bond, "bond",
148                    "Calculate distances between atoms and bond length distributions");
149     registerModule(manager, &gmx_bundle, "bundle",
150                    "Analyze bundles of axes, e.g., helices");
151     registerModule(manager, &gmx_chi, "chi",
152                    "Calculate everything you want to know about chi and other dihedrals");
153     registerModule(manager, &gmx_cluster, "cluster",
154                    "Cluster structures");
155     registerModule(manager, &gmx_clustsize, "clustsize",
156                    "Calculate size distributions of atomic clusters");
157     registerModule(manager, &gmx_confrms, "confrms",
158                    "Fit two structures and calculates the RMSD");
159     registerModule(manager, &gmx_covar, "covar",
160                    "Calculate and diagonalize the covariance matrix");
161     registerModule(manager, &gmx_current, "current",
162                    "Calculate dielectric constants and charge autocorrelation function");
163     registerModule(manager, &gmx_density, "density",
164                    "Calculate the density of the system");
165     registerModule(manager, &gmx_densmap, "densmap",
166                    "Calculate 2D planar or axial-radial density maps");
167     registerModule(manager, &gmx_densorder, "densorder",
168                    "Calculate surface fluctuations");
169     registerModule(manager, &gmx_dielectric, "dielectric",
170                    "Calculate frequency dependent dielectric constants");
171     registerModule(manager, &gmx_dipoles, "dipoles",
172                    "Compute the total dipole plus fluctuations");
173     registerModule(manager, &gmx_disre, "disre",
174                    "Analyze distance restraints");
175     registerModule(manager, &gmx_dist, "dist",
176                    "Calculate distances between centers of mass of two groups");
177     registerModule(manager, &gmx_dos, "dos",
178                    "Analyze density of states and properties based on that");
179     registerModule(manager, &gmx_dyecoupl, "dyecoupl",
180                    "Extract dye dynamics from trajectories");
181     registerModule(manager, &gmx_dyndom, "dyndom",
182                    "Interpolate and extrapolate structure rotations");
183     registerModule(manager, &gmx_enemat, "enemat",
184                    "Extract an energy matrix from an energy file");
185     registerModule(manager, &gmx_energy, "energy",
186                    "Writes energies to xvg files and display averages");
187     registerModule(manager, &gmx_filter, "filter",
188                    "Frequency filter trajectories, useful for making smooth movies");
189     registerModule(manager, &gmx_gyrate, "gyrate",
190                    "Calculate the radius of gyration");
191     registerModule(manager, &gmx_h2order, "h2order",
192                    "Compute the orientation of water molecules");
193     registerModule(manager, &gmx_hbond, "hbond",
194                    "Compute and analyze hydrogen bonds");
195     registerModule(manager, &gmx_helix, "helix",
196                    "Calculate basic properties of alpha helices");
197     registerModule(manager, &gmx_helixorient, "helixorient",
198                    "Calculate local pitch/bending/rotation/orientation inside helices");
199     registerModule(manager, &gmx_hydorder, "hydorder",
200                    "Compute tetrahedrality parameters around a given atom");
201     registerModule(manager, &gmx_kinetics, "kinetics",
202                    "Analyze kinetic constants from properties based on the Eyring model");
203     registerModule(manager, &gmx_lie, "lie",
204                    "Estimate free energy from linear combinations");
205     registerModule(manager, &gmx_mdmat, "mdmat",
206                    "Calculate residue contact maps");
207     registerModule(manager, &gmx_mindist, "mindist",
208                    "Calculate the minimum distance between two groups");
209     registerModule(manager, &gmx_morph, "morph",
210                    "Interpolate linearly between conformations");
211     registerModule(manager, &gmx_msd, "msd",
212                    "Calculates mean square displacements");
213     registerModule(manager, &gmx_nmeig, "nmeig",
214                    "Diagonalize the Hessian for normal mode analysis");
215     registerModule(manager, &gmx_nmens, "nmens",
216                    "Generate an ensemble of structures from the normal modes");
217     registerModule(manager, &gmx_nmtraj, "nmtraj",
218                    "Generate a virtual oscillating trajectory from an eigenvector");
219     registerModule(manager, &gmx_options, "options", NULL);
220     registerModule(manager, &gmx_order, "order",
221                    "Compute the order parameter per atom for carbon tails");
222     registerModule(manager, &gmx_pme_error, "pme_error",
223                    "Estimate the error of using PME with a given input file");
224     registerModule(manager, &gmx_polystat, "polystat",
225                    "Calculate static properties of polymers");
226     registerModule(manager, &gmx_potential, "potential",
227                    "Calculate the electrostatic potential across the box");
228     registerModule(manager, &gmx_principal, "principal",
229                    "Calculate principal axes of inertia for a group of atoms");
230     registerModule(manager, &gmx_rama, "rama",
231                    "Compute Ramachandran plots");
232     registerModule(manager, &gmx_rdf, "rdf",
233                    "Calculate radial distribution functions");
234     registerModule(manager, &gmx_rms, "rms",
235                    "Calculate RMSDs with a reference structure and RMSD matrices");
236     registerModule(manager, &gmx_rmsdist, "rmsdist",
237                    "Calculate atom pair distances averaged with power -2, -3 or -6");
238     registerModule(manager, &gmx_rmsf, "rmsf",
239                    "Calculate atomic fluctuations");
240     registerModule(manager, &gmx_rotacf, "rotacf",
241                    "Calculate the rotational correlation function for molecules");
242     registerModule(manager, &gmx_rotmat, "rotmat",
243                    "Plot the rotation matrix for fitting to a reference structure");
244     registerModule(manager, &gmx_saltbr, "saltbr",
245                    "Compute salt bridges");
246     registerModule(manager, &gmx_sans, "sans",
247                    "Compute the small angle neutron scattering spectra");
248     registerModule(manager, &gmx_sas, "sas",
249                    "Compute solvent accessible surface area");
250     registerModule(manager, &gmx_saxs, "saxs",
251                    "Calculates SAXS structure factors based on Cromer's method");
252     registerModule(manager, &gmx_sgangle, "sgangle",
253                    "Compute the angle and distance between two groups");
254     registerModule(manager, &gmx_sham, "sham",
255                    "Compute free energies or other histograms from histograms");
256     registerModule(manager, &gmx_sigeps, "sigeps",
257                    "Convert c6/12 or c6/cn combinations to and from sigma/epsilon");
258     registerModule(manager, &gmx_sorient, "sorient",
259                    "Analyze solvent orientation around solutes");
260     registerModule(manager, &gmx_spatial, "spatial",
261                    "Calculate the spatial distribution function");
262     registerModule(manager, &gmx_spol, "spol",
263                    "Analyze solvent dipole orientation and polarization around solutes");
264     registerModule(manager, &gmx_tcaf, "tcaf",
265                    "Calculate viscosities of liquids");
266     registerModule(manager, &gmx_traj, "traj",
267                    "Plot x, v, f, box, temperature and rotational energy from trajectories");
268     registerModule(manager, &gmx_tune_pme, "tune_pme",
269                    "Time mdrun as a function of PME nodes to optimize settings");
270     registerModule(manager, &gmx_vanhove, "vanhove",
271                    "Compute Van Hove correlation functions");
272     registerModule(manager, &gmx_velacc, "velacc",
273                    "Calculate velocity autocorrelation functions");
274     registerModule(manager, &gmx_wham, "wham",
275                    "Perform weighted histogram analysis after umbrella sampling");
276     registerModule(manager, &gmx_wheel, "wheel",
277                    "Plot helical wheels");
278     registerModule(manager, &gmx_view, "view",
279                    "View a trajectory on an X-Windows terminal");
280
281     // TODO: Also include binaries from other directories than src/tools/:
282     //        "g_xrama|Show animated Ramachandran plots");
283     //        "mdrun|finds a potential energy minimum and calculates the Hessian");
284     //        "mdrun|with -rerun (re)calculates energies for trajectory frames");
285 }