Package: restrained-ESP-fit
restrained-ESP-fitThis is a fork of therespprogram commonly used in computational chemistry for fitting partial atomic charges to values of the provided molecular Electrostatic Potential (ESP) field around a molecule.
The method was first described by Bayly et al.¹ using the MK mesh of sampling the ESP field² but the program can generally fit charges to any mesh of points.
The mesh needs to be produced independently; see thejszopi/repESPrepo for some helpers, including extracting ESP fitting points from the output of the Gaussian program and wrapping the calls to therespprogram in a Python library.
The program can also be used to fit partial charges to the ESP without any restraints.VersioningThe purpose of this fork is twofold: easier distribution of the originalrespprogram as well as evolution independent from it.Relation torespMultiple versions ofresphave appeared over the years and this project aims to make available the code for the newer versions.
Versions2.y.zof this project will wrap the correspondingresp 2.ycode without even a trivial modification.
The patch version (thez) will be incremented upon changes to the wrapping code and CI/CD pipeline.
If therespprogram ever comes to use a patch version, the changes will be included in the next patch version of this project.
While this will cause the version number to no longer have verbatim correspondence, this state should be acceptable, as users the upstream project should never introduce significant changes in a patch release and clients shouldn't have to pin a patch version.OriginalrespcodeCode history prior tov2.2was not preserved (or rather, reconstructed, considering lack of a version controlled repo).
The original code forv2.2andv2.4can be found verbatim in the first two git commits of this repo.
They can be accessed through the corresponding git tags, namelyhere forv2.2andhere forv2.4.
Also see the corresponding Releases for details on how the code was retrieved (v2.2,v2.4)Later iterations of this project moved the originalrespcode into therespsubdirectory.
As the wrapping code evolves, packages will continue to be produced for versions2.2.z,2.4.zand any futurerespversions from upstream.Independent evolutionIn order to allow for independent evolution of the program, the name of the project,restrained-ESP-fitis different fromresp.
The version numbering of the project will reflect the separation from therespversion numbers, most likely by using a new major version, i.e. starting from3.0.0.
These versions of the project may alter the calculation logic (the results should be identical, barring potential bug fixes) and the interface to the program.
I am hoping to rewrite this program in Python in order to encourage users to experiment with their own fitting methods and constraints.UsageInstallIn addition to a publicly available source code, this project is available on the Python Package Index (PyPI).
This is partly due to the planned rewrite in Python.
I also found the binary distribution format for Python ("wheels") a simpler alternative to distributing the project over each operating system's package manager.
The project is currently available for most Linux distributions and macOS X.
It should be possible for the Windows binaries to be available too; please open an issue if that would be useful to you.In order to install this project, you only have to run:pip3installrestrained-ESP-fitpip3will prefer installing from a binary distribution, if one compatible with your operating system is available.
If one is not available,pip3will attempt to compile the Fortran code locally.
This may or may not work, depending on whether the build dependencies can be found on your system.Request compatible binariesOne of the aims of this projects is for local compilation not be necessary.
If installation failed, please open an issue including the output ofpip3 -v install restrained-ESP-fitand the version numbers of your operating system, Python installation andpip3.
Hopefully, all that's required is the project maintainer adding your operating system to the CI/CD pipeline without requiring any changes on your side.Compile from sourceIf you don't want to wait for compatible binaries to be provided, you can try to get the compilation from source working on your end.
One reason why the compilation may have failed is thatgfortranis not in your$PATH.
You may need to use a different compiler by setting theRESP_COMPILERenvironment variable prior to invoking pip.
Refer to theCI/CD recipefor what value may be suitable for your operating system.
For example, on macOS X:RESP_COMPILER=/usr/local/bin/gfortran-11pip3installrestrained-ESP-fitFor the sake of producing portable binaries, therespprogram can be linked statically by settingRESP_STATICenvironment variable to "1".
The libraries linked statically arelibgfortranandlibquadmath.
You are required to provide the path to where these static libraries can be found by setting theRESP_VPATHvariable.
Notice that linking statically uses a different Makefile, and its default compiler isgccinstead ofgfortran.Install alternate versionFor reproducibility, you may need to install another version ofrestrained-ESP-fit.
For example, there are some input format differences betweenrespversions2.2and2.4.
To install the latest patch version of2.2, run:pip3install'restrained-ESP-fit>=2.2.0,<2.3.0'RunCurrently, the only interface to the program is invoking therestrained-ESP-fitscript.
Its interface is identical to that of the correspondingrespprogram, e.g. forv2.4.z:restrained-ESP-fit [-O] -i input -e espot [-o output -p punch -q qin -t qout -w qwts -s esout -j espdb -y esqpotpdb -z esmpotpdb]More detailed usage instructions are only available for v2.2 and are hosted athttps://upjv.q4md-forcefieldtools.org/RED/resp/(if link is down, get your browser to displaythe repo version).
The usage of v2.4 is likely very similar, but so far I have identified at least one discrepancy in the expected input format.
v2.4 was also distributed with theREADME-2.4.txtfilefile.Subsequent patch versions may introduce Python bindings, at first with arguments corresponding directly to the command line options and subsequently a more Pythonic interface.Contributingresphas been the effort of multiple people; this fork is merely a spare time project of one developer.
Due to the maturity ofresp, the maintenance workload should be manageable, but any new features may come slowly.
If you'd like to help out, please get in touch.
The design of a Pythonic API and a later Python rewrite are interesting challenges that would definitely benefit from more help.DevelopmentDevelopment takes place on themasterbranch.
Therespversion currently being wrapped onmasteris2.4, but this may change to a newer minor version if one is released upstream.
To continue producing packages wrapping multiplerespversions, branchesv2.2.zandv2.4.zwill be updated with any new developments frommaster.
These will likely cease to be supported when the development of version3.0starts.¹ C. I. Bayly, P. Cieplak, W. D. Cornell and P. A. Kollman,J. Phys. Chem., 1993,97, 10269–10280² U. C. Singh and P. A. Kollman,J. Comput. Chem., 1984,5, 129–145