Refactor pdb2gmx into c++ framework
In order to have better with external callers (e.g. python API) having pdb2gmx implemented as a real c++ class structure will be beneficial. The first step is to re-implement pdb2gmx as an ICommandLineOptionsModule. Ideally, this should be coupled with a move away from pointers and towards references. Eventually I have some interest in taking this in a direction similar to the IForceProvider framework where there would be a sort of [structureFileFormat]2gmx functionality that can accommodate heterogeneous data and maybe handle some basic modeling tasks like combining pdbs or adding a few missing residues. Before that can happen though, a number of changes will be necessary.
- Ensure variables have only as much scope as needed
- turn pointers into references where possible
- better naming of variables
- decide which functions should be members of class pdb2gmx
- turn some redundant functions into template functions
- (hard maybe on this) think about how to handle reading in of forcefield information
Replacement for pdb2gmx tests
This test directly asserts upon the .top and .gro files that are
written out, using fragments of the
regressiontests/complex/aminoacids/conf.gro because these cover all
basic amino acid types. It also adds testing for hydrogen vsites for
amber and charmm.
We now omit doing an energy minimization after the string checks,
which was always a doubtful way to test pdb2gmx. These tests are still
too slow to run with other pre- and post-submit testing, so a new
CTest category has been made for them, and that category is excluded
from Jenkins builds by default. Developers will still run these by
default with "make check" or "ctest" but that should be fast enough on
a workstation. Later we can probably refactor them to use in-memory
buffers and be fast enough to put with the other tests.
Modified pdb2gmx to avoid writing fractional charges for every atom in
the [atoms] output, which isn't very useful for users and makes
writing tests more difficult.
Fixed unstable sorting of dihedrals whose parameters are strings that
Added new capability for refdata tests to filter out lines that vary
at run time by supplying a regex that matches the lines to skip.
That's not ideal, but useful for now. Better would be to refactor
tools so that e.g. header output can go to a different stream, but
first we should have basic tests in place.
Added tests for Regex. Fixed minor bug in c++ stdlib regex
implementation of Regex. Noted the remaining reason why we have
Regex supported by two different implementations.
Minor updates to use compat::make_unique
Extended functionality of CommandLine for convenient use.