GROMACS version: 2023
GROMACS modification: No
Hi @ericirrgang, question about GMXAPI. Does the python component allow granular editing of a system (topology + coordinates) to do things like removing or placing individual molecules, combining systems or pieces of systems (e.g. replacing a protein with a homolog after superposition outside of GROMACS), etc. I wouldn’t expect the latter functionality to be available out of the box, but would the API allow me to implement this in python?
Thanks!
Roman
The short answer is “no”.
Unfortunately, the C++ library data structures related to the molecular topologies are a bit of a mess and not ready for a C++ API (or python bindings). The pdb2gmx
and grompp
tools are also not API friendly.
A big part of the chicken-and-egg situation is that there is no central System object, and the various data structures that hold related/interdependent data do not have a formal mechanism for communicating with each other. There are a small number of specific cases of code that modify a valid molecular system and keep it valid, but I don’t think generalization is a near-term possibility.
I think the prevailing (or at least tacit) consensus is that there are a number of project external to GROMACS that provide such editing features in terms of file-backed representations of molecular systems (like pdb files), and GROMACS doesn’t really want to commit to supporting any new interfaces (including a GROMACS-specific versioned data structure or C++ interface) at this time, or to encapsulating a MolecularSystem within the library.
There have been some attempts at clean-up throught NB-Lib project and, separately, with respect to the Trajectory Analysis Framework, but I don’t believe there is anyone currently taking the lead on trying to refine the topology-related data structures or library interfaces right now. If you are interested, a requirements-gathering discussion could be started as a thread in the Developers discussions - GROMACS forums
That’s unfortunate, though I completely understand the reasoning. What about, more specifically, the solvate and genion functionality for identifying overlapping molecules – is that exposed via the python api? Obviously that can be implemented using tools outside of GROMACS, but I am not aware of such functionality already being available outside of scripts (e.g. Justin’s perl script http://www.mdtutorials.com/gmx/membrane_protein/Files/water_deletor.pl) and, probably, solvation tools from other packages (AMBER, NAMD, etc). Do you have any recommendations?
Along the same lines, it would be really nice to be able to identify empty spaces into which waters can / should be inserted – e.g. when a side chain is mutated, freeing up space that was previously occupied. Is this functionality in GROMACS?
None of those tools provide or are written in terms of a public C++ API, so there is nothing to bind Python to.
Pure molecular mechanics calculations are not really a goal for libgromacs, which decomposes systems to perform as many MD integration steps as possible between API calls, isolating the MM from the calling code.
You may find what you’re looking for in the NB-Lib API. If so, it would be interesting to consider adding Python bindings to that library.