From 464c680c6caba06331dd58203dc6aec334a6b833 Mon Sep 17 00:00:00 2001 From: Lester Hedges Date: Wed, 24 Jul 2024 15:40:55 +0100 Subject: [PATCH 01/13] Exclude OpenMMPMEFEP.pypp.cpp when OpenMM is missing. [closes #213] [ci skip] --- wrapper/Move/CMakeNoOpenMM.txt | 1 + wrapper/Move/CMakeNoOpenMMFile.txt | 1 + wrapper/Move/CMakeOpenMM.txt | 1 + wrapper/Move/CMakeOpenMMFile.txt | 1 + 4 files changed, 4 insertions(+) diff --git a/wrapper/Move/CMakeNoOpenMM.txt b/wrapper/Move/CMakeNoOpenMM.txt index 833386a2a..1f5c40eac 100644 --- a/wrapper/Move/CMakeNoOpenMM.txt +++ b/wrapper/Move/CMakeNoOpenMM.txt @@ -3,4 +3,5 @@ set ( SIRE_OPENMM_WRAPPERS NoOpenMM/OpenMMFrEnergyST.pypp.cpp NoOpenMM/OpenMMFrEnergyDT.pypp.cpp NoOpenMM/OpenMMMDIntegrator.pypp.cpp + NoOpenMM/OpenMMPMEFEP.pypp.cpp ) diff --git a/wrapper/Move/CMakeNoOpenMMFile.txt b/wrapper/Move/CMakeNoOpenMMFile.txt index 11f644756..c4fd3a780 100644 --- a/wrapper/Move/CMakeNoOpenMMFile.txt +++ b/wrapper/Move/CMakeNoOpenMMFile.txt @@ -3,6 +3,7 @@ set ( PYPP_OPENMM_SOURCES NoOpenMM/OpenMMFrEnergyST.pypp.cpp NoOpenMM/OpenMMFrEnergyDT.pypp.cpp NoOpenMM/OpenMMMDIntegrator.pypp.cpp + NoOpenMM/OpenMMPMEFEP.pypp.cpp ) set( SIRE_OPENMM_LIBRARIES "" ) diff --git a/wrapper/Move/CMakeOpenMM.txt b/wrapper/Move/CMakeOpenMM.txt index a4dc0fd98..5d72e5a88 100644 --- a/wrapper/Move/CMakeOpenMM.txt +++ b/wrapper/Move/CMakeOpenMM.txt @@ -3,4 +3,5 @@ set ( SIRE_OPENMM_WRAPPERS OpenMMFrEnergyST.pypp.cpp OpenMMFrEnergyDT.pypp.cpp OpenMMMDIntegrator.pypp.cpp + OpenMMPMEFEP.pypp.cpp ) diff --git a/wrapper/Move/CMakeOpenMMFile.txt b/wrapper/Move/CMakeOpenMMFile.txt index cb3d0ff95..00cb8fd84 100644 --- a/wrapper/Move/CMakeOpenMMFile.txt +++ b/wrapper/Move/CMakeOpenMMFile.txt @@ -3,4 +3,5 @@ set ( PYPP_OPENMM_SOURCES OpenMMMDIntegrator.pypp.cpp OpenMMFrEnergyDT.pypp.cpp OpenMMFrEnergyST.pypp.cpp + OpenMMPMEFEP.pypp.cpp ) From 8b8a8d9f01cb505fa991d0d4ae82fe9f7cb39ecf Mon Sep 17 00:00:00 2001 From: Lester Hedges Date: Wed, 24 Jul 2024 16:45:33 +0100 Subject: [PATCH 02/13] Add missing NoOpenMM/OpenMMPMEFEP wrappers. --- wrapper/Move/NoOpenMM/OpenMMPMEFEP.pycpp.cpp | 108 +++++++++++++++++++ wrapper/Move/NoOpenMM/OpenMMPMEFEP.pycpp.hpp | 10 ++ 2 files changed, 118 insertions(+) create mode 100644 wrapper/Move/NoOpenMM/OpenMMPMEFEP.pycpp.cpp create mode 100644 wrapper/Move/NoOpenMM/OpenMMPMEFEP.pycpp.hpp diff --git a/wrapper/Move/NoOpenMM/OpenMMPMEFEP.pycpp.cpp b/wrapper/Move/NoOpenMM/OpenMMPMEFEP.pycpp.cpp new file mode 100644 index 000000000..864d0bb09 --- /dev/null +++ b/wrapper/Move/NoOpenMM/OpenMMPMEFEP.pycpp.cpp @@ -0,0 +1,108 @@ +// This file has been generated by Py++. + +// (C) Christopher Woods, GPL >= 3 License + +#include "boost/python.hpp" +#include "OpenMMPMEFEP.pypp.hpp" + +namespace bp = boost::python; + +#include "SireFF/forcetable.h" + +#include "SireIO/amber.h" + +#include "SireMM/atomljs.h" + +#include "SireMM/internalff.h" + +#include "SireMM/internalperturbation.h" + +#include "SireMaths/constants.h" + +#include "SireMaths/rangenerator.h" + +#include "SireMaths/vector.h" + +#include "SireMol/amberparameters.h" + +#include "SireMol/atomcharges.h" + +#include "SireMol/atomcoords.h" + +#include "SireMol/atommasses.h" + +#include "SireMol/bondid.h" + +#include "SireMol/connectivity.h" + +#include "SireMol/mgname.h" + +#include "SireMol/molecule.h" + +#include "SireMol/core.h" + +#include "SireMol/moleculegroup.h" + +#include "SireMol/moleditor.h" + +#include "SireMol/partialmolecule.h" + +#include "SireMol/perturbation.h" + +#include "SireMove/flexibility.h" + +#include "SireStream/datastream.h" + +#include "SireStream/shareddatastream.h" + +#include "SireSystem/system.h" + +#include "SireUnits/convert.h" + +#include "SireUnits/temperature.h" + +#include "SireUnits/units.h" + +#include "SireVol/periodicbox.h" + +#include "ensemble.h" + +#include "openmmfrenergyst.h" + +#include + +#include + +#include + +#include "openmmfrenergyst.h" + +SireMove::OpenMMPMEFEP __copy__(const SireMove::OpenMMPMEFEP &other){ return SireMove::OpenMMPMEFEP(other); } + +const char* pvt_get_name(const SireMove::OpenMMPMEFEP&){ return "SireMove::OpenMMPMEFEP";} + +void register_OpenMMPMEFEP_class(){ + + { //::SireMove::OpenMMPMEFEP + typedef bp::class_< SireMove::OpenMMPMEFEP > OpenMMPMEFEP_exposer_t; + OpenMMPMEFEP_exposer_t OpenMMPMEFEP_exposer = OpenMMPMEFEP_exposer_t( "OpenMMPMEFEP", bp::init< >() ); + bp::scope OpenMMPMEFEP_scope( OpenMMPMEFEP_exposer ); + { //::SireMove::OpenMMPMEFEP::typeName + + typedef char const * ( *typeName_function_type )( ); + typeName_function_type typeName_function_value( &::SireMove::OpenMMPMEFEP::typeName ); + + OpenMMPMEFEP_exposer.def( + "typeName" + , typeName_function_value ); + + } + OpenMMPMEFEP_exposer.staticmethod( "typeName" ); + OpenMMPMEFEP_exposer.def( "__copy__", &__copy__); + OpenMMPMEFEP_exposer.def( "__deepcopy__", &__copy__); + OpenMMPMEFEP_exposer.def( "clone", &__copy__); + OpenMMPMEFEP_exposer.def( "__str__", &pvt_get_name); + OpenMMPMEFEP_exposer.def( "__repr__", &pvt_get_name); + } + +} diff --git a/wrapper/Move/NoOpenMM/OpenMMPMEFEP.pycpp.hpp b/wrapper/Move/NoOpenMM/OpenMMPMEFEP.pycpp.hpp new file mode 100644 index 000000000..3b3ee9cdc --- /dev/null +++ b/wrapper/Move/NoOpenMM/OpenMMPMEFEP.pycpp.hpp @@ -0,0 +1,10 @@ +// This file has been generated by Py++. + +// (C) Christopher Woods, GPL >= 3 License + +#ifndef OpenMMPMEFEP_hpp__pyplusplus_wrapper +#define OpenMMPMEFEP_hpp__pyplusplus_wrapper + +void register_OpenMMPMEFEP_class(); + +#endif//OpenMMPMEFEP_hpp__pyplusplus_wrapper From 629ad4e48247c7123815c6a4cba5a8d00f8eb475 Mon Sep 17 00:00:00 2001 From: Lester Hedges Date: Wed, 24 Jul 2024 16:49:34 +0100 Subject: [PATCH 03/13] Use IFBOX=3 for general triclinic space. [closes #215] --- corelib/src/libs/SireIO/amberprm.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/corelib/src/libs/SireIO/amberprm.cpp b/corelib/src/libs/SireIO/amberprm.cpp index e3a1071d2..21a926d63 100644 --- a/corelib/src/libs/SireIO/amberprm.cpp +++ b/corelib/src/libs/SireIO/amberprm.cpp @@ -2181,7 +2181,16 @@ QStringList toLines(const QVector ¶ms, const Space &space, int if (has_periodic_box) { - pointers[27] = 1; + // Orthorhombic box. + if (space.isA()) + { + pointers[27] = 1; + } + // General triclinic box. + else if (space.isA()) + { + pointers[27] = 3; + } } // here is the number of solvent molecules, and the index of the last From 2a5c9e4652fe50f04d3615c308cc2c8b139eb8a3 Mon Sep 17 00:00:00 2001 From: Lester Hedges Date: Wed, 24 Jul 2024 16:51:16 +0100 Subject: [PATCH 04/13] Update CHANGELOG. --- doc/source/changelog.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/source/changelog.rst b/doc/source/changelog.rst index b55abf931..8c63444f3 100644 --- a/doc/source/changelog.rst +++ b/doc/source/changelog.rst @@ -19,6 +19,8 @@ organisation on `GitHub `__. * Print residue indices of perturbed water molecules to SOMD1 log. * Add support for creating Na+ and Cl- ions. * Fix ``sire.morph.merge`` function when one molecule is a monatomic ion. +* Remove ``sire.move.OpenMMPMEFEP`` wrappers from build when OpenMM is not available. +* Set ``IFBOX`` pointer to 3 for general triclinic boxes in ``sire.IO.AmberPrm`` parser. `2024.2.0 `__ - June 2024 ----------------------------------------------------------------------------------------- From 5030be924126a59efdd475af49794de05d02eef0 Mon Sep 17 00:00:00 2001 From: Lester Hedges Date: Thu, 25 Jul 2024 13:40:17 +0100 Subject: [PATCH 05/13] Headers are now part of librdkit-dev package. --- requirements_build.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements_build.txt b/requirements_build.txt index a9ea6f100..9389de249 100644 --- a/requirements_build.txt +++ b/requirements_build.txt @@ -14,7 +14,7 @@ sysroot_linux-64==2.17 ; sys_platform == "linux" # These packages are needed to compile # the SireRDKit plugin rdkit >=2023.0.0 -rdkit-dev >=2023.0.0 +librdkit-dev >=2023.0.0 # These packages are needed to compile # the SireGemmi plugin From 7185ec62f772a0bd98105f0dcd699b9db174235e Mon Sep 17 00:00:00 2001 From: Lester Hedges Date: Thu, 25 Jul 2024 13:59:46 +0100 Subject: [PATCH 06/13] Move librdkit-dev to host section. --- requirements_build.txt | 5 ----- requirements_host.txt | 2 +- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/requirements_build.txt b/requirements_build.txt index 9389de249..1ab5d8a1a 100644 --- a/requirements_build.txt +++ b/requirements_build.txt @@ -11,11 +11,6 @@ make ; sys_platform == "linux" libtool ; sys_platform == "linux" sysroot_linux-64==2.17 ; sys_platform == "linux" -# These packages are needed to compile -# the SireRDKit plugin -rdkit >=2023.0.0 -librdkit-dev >=2023.0.0 - # These packages are needed to compile # the SireGemmi plugin gemmi >=0.6.4 diff --git a/requirements_host.txt b/requirements_host.txt index 9b0e2a797..a431aacc9 100644 --- a/requirements_host.txt +++ b/requirements_host.txt @@ -12,7 +12,7 @@ qt-main rich tbb tbb-devel -rdkit >=2023.0.0 +librdkit-dev >=2023.0.0 gemmi >=0.6.4 # kartograf on Windows pulls in an openfe that has an old / incompatble From 09a0879f6b33157f1f790a0fc6ce18db67b24fa8 Mon Sep 17 00:00:00 2001 From: Lester Hedges Date: Thu, 25 Jul 2024 14:56:14 +0100 Subject: [PATCH 07/13] Handle IFBOX pointer values other than 1. --- corelib/src/libs/SireIO/amber.cpp | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/corelib/src/libs/SireIO/amber.cpp b/corelib/src/libs/SireIO/amber.cpp index 4f6c824e4..f42ffe5d2 100644 --- a/corelib/src/libs/SireIO/amber.cpp +++ b/corelib/src/libs/SireIO/amber.cpp @@ -2151,7 +2151,7 @@ tuple Amber::readCrdTop(const QString &crdfile, const Q // Now the box information SpacePtr spce; - if (pointers[IFBOX] == 1) + if (pointers[IFBOX] == 1 or pointers[IFBOX] == 2 or pointers[IFBOX] == 3) { /** Rectangular box, dimensions read from the crd file */ Vector dimensions(crd_box[0], crd_box[1], crd_box[2]); @@ -2173,12 +2173,6 @@ tuple Amber::readCrdTop(const QString &crdfile, const Q // spce = PeriodicBox( Vector ( crdBox[0], crdBox[1], crdBox[2] ) ).asA() ; // qDebug() << " periodic box " << spce.toString() ; } - else if (pointers[IFBOX] == 2) - { - /** Truncated Octahedral box*/ - throw SireError::incompatible_error(QObject::tr("Sire does not yet support a truncated octahedral box"), - CODELOC); - } else { /** Default is a non periodic system */ From 890ae4e59abba13c120159373c18377283004744 Mon Sep 17 00:00:00 2001 From: Lester Hedges Date: Mon, 29 Jul 2024 16:05:39 +0100 Subject: [PATCH 08/13] Only exclude from/to ghost nonbonded interactions in the same molecule. [closes #219] [ci skip] --- .../SireOpenMM/sire_to_openmm_system.cpp | 23 +++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/wrapper/Convert/SireOpenMM/sire_to_openmm_system.cpp b/wrapper/Convert/SireOpenMM/sire_to_openmm_system.cpp index 03e2ad242..684b9a58b 100644 --- a/wrapper/Convert/SireOpenMM/sire_to_openmm_system.cpp +++ b/wrapper/Convert/SireOpenMM/sire_to_openmm_system.cpp @@ -1576,14 +1576,29 @@ OpenMMMetaData SireOpenMM::sire_to_openmm_system(OpenMM::System &system, // between from_ghosts and to_ghosts for (const auto &from_ghost_idx : from_ghost_idxs) { + // work out the molecule index for the from ghost atom + int mol_from = 0; + while (start_indexes[mol_from] <= from_ghost_idx) + mol_from++; + for (const auto &to_ghost_idx : to_ghost_idxs) { + // work out the molecule index for the to ghost atom + int mol_to = 0; + while (start_indexes[mol_to] <= to_ghost_idx) + mol_to++; + if (not excluded_ghost_pairs.contains(IndexPair(from_ghost_idx, to_ghost_idx))) { - ghost_ghostff->addExclusion(from_ghost_idx, to_ghost_idx); - ghost_nonghostff->addExclusion(from_ghost_idx, to_ghost_idx); - cljff->addException(from_ghost_idx, to_ghost_idx, - 0.0, 1e-9, 1e-9, true); + // only exclude if we haven't already excluded this pair + // and if the two atoms are in the same molecule + if (mol_from == mol_to) + { + ghost_ghostff->addExclusion(from_ghost_idx, to_ghost_idx); + ghost_nonghostff->addExclusion(from_ghost_idx, to_ghost_idx); + cljff->addException(from_ghost_idx, to_ghost_idx, + 0.0, 1e-9, 1e-9, true); + } } } } From dc0e6dd7333790630cc1b2338ddfae53e4cff8dd Mon Sep 17 00:00:00 2001 From: Lester Hedges Date: Mon, 29 Jul 2024 16:12:39 +0100 Subject: [PATCH 09/13] Update the CHANGELOG. [ci skip] --- doc/source/changelog.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/source/changelog.rst b/doc/source/changelog.rst index 8c63444f3..ef66695cc 100644 --- a/doc/source/changelog.rst +++ b/doc/source/changelog.rst @@ -21,6 +21,8 @@ organisation on `GitHub `__. * Fix ``sire.morph.merge`` function when one molecule is a monatomic ion. * Remove ``sire.move.OpenMMPMEFEP`` wrappers from build when OpenMM is not available. * Set ``IFBOX`` pointer to 3 for general triclinic boxes in ``sire.IO.AmberPrm`` parser. +* Only excluded nonbonded interactions between from_ghost and to_ghost atoms if they are in the same molecule. + `2024.2.0 `__ - June 2024 ----------------------------------------------------------------------------------------- From 2c0aa2648f12760fee92698c0f238ad74a40a8df Mon Sep 17 00:00:00 2001 From: Lester Hedges Date: Thu, 1 Aug 2024 12:24:39 +0100 Subject: [PATCH 10/13] Trying previous RDKit packages. --- requirements_host.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/requirements_host.txt b/requirements_host.txt index a431aacc9..112eadb3f 100644 --- a/requirements_host.txt +++ b/requirements_host.txt @@ -12,7 +12,8 @@ qt-main rich tbb tbb-devel -librdkit-dev >=2023.0.0 +rdkit <=2024.03.4 +rdkit-dev <=2024.03.4 gemmi >=0.6.4 # kartograf on Windows pulls in an openfe that has an old / incompatble From 29c995f52d067caa5aaa3c0ee224a1ef8e7def9b Mon Sep 17 00:00:00 2001 From: Lester Hedges Date: Thu, 1 Aug 2024 12:49:24 +0100 Subject: [PATCH 11/13] Don't duplicate RDKit requirement. --- requirements_bss.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/requirements_bss.txt b/requirements_bss.txt index 98a166778..d63d7087a 100644 --- a/requirements_bss.txt +++ b/requirements_bss.txt @@ -32,7 +32,6 @@ py3dmol pydot pygtail pyyaml -rdkit >=2023.0.0 gemmi >=0.6.4 # The below are packages that aren't available on all From bc785d241c512a6885c505ad4e46433f3108acd8 Mon Sep 17 00:00:00 2001 From: Lester Hedges Date: Thu, 1 Aug 2024 12:52:36 +0100 Subject: [PATCH 12/13] Don't duplicate gemmi requirement either. --- requirements_bss.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/requirements_bss.txt b/requirements_bss.txt index d63d7087a..3b622a2ab 100644 --- a/requirements_bss.txt +++ b/requirements_bss.txt @@ -32,7 +32,6 @@ py3dmol pydot pygtail pyyaml -gemmi >=0.6.4 # The below are packages that aren't available on all # platforms/OSs and so need to be conditionally included From 4768ff7ded67aa5f9ef658b0b9844e126751bd2a Mon Sep 17 00:00:00 2001 From: Lester Hedges Date: Thu, 1 Aug 2024 12:52:56 +0100 Subject: [PATCH 13/13] Try librdkit-dev again. --- requirements_host.txt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/requirements_host.txt b/requirements_host.txt index 112eadb3f..40e3ecf8d 100644 --- a/requirements_host.txt +++ b/requirements_host.txt @@ -5,6 +5,7 @@ gsl lazy_import libcblas libnetcdf +librdkit-dev openmm pandas python @@ -12,8 +13,6 @@ qt-main rich tbb tbb-devel -rdkit <=2024.03.4 -rdkit-dev <=2024.03.4 gemmi >=0.6.4 # kartograf on Windows pulls in an openfe that has an old / incompatble