Skip to content

Commit d120cf2

Browse files
authored
Merge pull request #220 from OpenBioSim/fix_213_215_219
Fix issues 213, 215, and 219
2 parents 762f244 + 4768ff7 commit d120cf2

13 files changed

+157
-20
lines changed

corelib/src/libs/SireIO/amber.cpp

+1-7
Original file line numberDiff line numberDiff line change
@@ -2151,7 +2151,7 @@ tuple<MoleculeGroup, SpacePtr> Amber::readCrdTop(const QString &crdfile, const Q
21512151
// Now the box information
21522152
SpacePtr spce;
21532153

2154-
if (pointers[IFBOX] == 1)
2154+
if (pointers[IFBOX] == 1 or pointers[IFBOX] == 2 or pointers[IFBOX] == 3)
21552155
{
21562156
/** Rectangular box, dimensions read from the crd file */
21572157
Vector dimensions(crd_box[0], crd_box[1], crd_box[2]);
@@ -2173,12 +2173,6 @@ tuple<MoleculeGroup, SpacePtr> Amber::readCrdTop(const QString &crdfile, const Q
21732173
// spce = PeriodicBox( Vector ( crdBox[0], crdBox[1], crdBox[2] ) ).asA<Space>() ;
21742174
// qDebug() << " periodic box " << spce.toString() ;
21752175
}
2176-
else if (pointers[IFBOX] == 2)
2177-
{
2178-
/** Truncated Octahedral box*/
2179-
throw SireError::incompatible_error(QObject::tr("Sire does not yet support a truncated octahedral box"),
2180-
CODELOC);
2181-
}
21822176
else
21832177
{
21842178
/** Default is a non periodic system */

corelib/src/libs/SireIO/amberprm.cpp

+10-1
Original file line numberDiff line numberDiff line change
@@ -2181,7 +2181,16 @@ QStringList toLines(const QVector<AmberParams> &params, const Space &space, int
21812181

21822182
if (has_periodic_box)
21832183
{
2184-
pointers[27] = 1;
2184+
// Orthorhombic box.
2185+
if (space.isA<PeriodicBox>())
2186+
{
2187+
pointers[27] = 1;
2188+
}
2189+
// General triclinic box.
2190+
else if (space.isA<TriclinicBox>())
2191+
{
2192+
pointers[27] = 3;
2193+
}
21852194
}
21862195

21872196
// here is the number of solvent molecules, and the index of the last

doc/source/changelog.rst

+4
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ organisation on `GitHub <https://github.com/openbiosim/sire>`__.
1919
* Print residue indices of perturbed water molecules to SOMD1 log.
2020
* Add support for creating Na+ and Cl- ions.
2121
* Fix ``sire.morph.merge`` function when one molecule is a monatomic ion.
22+
* Remove ``sire.move.OpenMMPMEFEP`` wrappers from build when OpenMM is not available.
23+
* Set ``IFBOX`` pointer to 3 for general triclinic boxes in ``sire.IO.AmberPrm`` parser.
24+
* Only excluded nonbonded interactions between from_ghost and to_ghost atoms if they are in the same molecule.
25+
2226

2327
`2024.2.0 <https://github.com/openbiosim/sire/compare/2024.1.0...2024.2.0>`__ - June 2024
2428
-----------------------------------------------------------------------------------------

requirements_bss.txt

-2
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,6 @@ py3dmol
3232
pydot
3333
pygtail
3434
pyyaml
35-
rdkit >=2023.0.0
36-
gemmi >=0.6.4
3735

3836
# The below are packages that aren't available on all
3937
# platforms/OSs and so need to be conditionally included

requirements_build.txt

-5
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,6 @@ make ; sys_platform == "linux"
1111
libtool ; sys_platform == "linux"
1212
sysroot_linux-64==2.17 ; sys_platform == "linux"
1313

14-
# These packages are needed to compile
15-
# the SireRDKit plugin
16-
rdkit >=2023.0.0
17-
rdkit-dev >=2023.0.0
18-
1914
# These packages are needed to compile
2015
# the SireGemmi plugin
2116
gemmi >=0.6.4

requirements_host.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@ gsl
55
lazy_import
66
libcblas
77
libnetcdf
8+
librdkit-dev
89
openmm
910
pandas
1011
python
1112
qt-main
1213
rich
1314
tbb
1415
tbb-devel
15-
rdkit >=2023.0.0
1616
gemmi >=0.6.4
1717

1818
# kartograf on Windows pulls in an openfe that has an old / incompatble

wrapper/Convert/SireOpenMM/sire_to_openmm_system.cpp

+19-4
Original file line numberDiff line numberDiff line change
@@ -1576,14 +1576,29 @@ OpenMMMetaData SireOpenMM::sire_to_openmm_system(OpenMM::System &system,
15761576
// between from_ghosts and to_ghosts
15771577
for (const auto &from_ghost_idx : from_ghost_idxs)
15781578
{
1579+
// work out the molecule index for the from ghost atom
1580+
int mol_from = 0;
1581+
while (start_indexes[mol_from] <= from_ghost_idx)
1582+
mol_from++;
1583+
15791584
for (const auto &to_ghost_idx : to_ghost_idxs)
15801585
{
1586+
// work out the molecule index for the to ghost atom
1587+
int mol_to = 0;
1588+
while (start_indexes[mol_to] <= to_ghost_idx)
1589+
mol_to++;
1590+
15811591
if (not excluded_ghost_pairs.contains(IndexPair(from_ghost_idx, to_ghost_idx)))
15821592
{
1583-
ghost_ghostff->addExclusion(from_ghost_idx, to_ghost_idx);
1584-
ghost_nonghostff->addExclusion(from_ghost_idx, to_ghost_idx);
1585-
cljff->addException(from_ghost_idx, to_ghost_idx,
1586-
0.0, 1e-9, 1e-9, true);
1593+
// only exclude if we haven't already excluded this pair
1594+
// and if the two atoms are in the same molecule
1595+
if (mol_from == mol_to)
1596+
{
1597+
ghost_ghostff->addExclusion(from_ghost_idx, to_ghost_idx);
1598+
ghost_nonghostff->addExclusion(from_ghost_idx, to_ghost_idx);
1599+
cljff->addException(from_ghost_idx, to_ghost_idx,
1600+
0.0, 1e-9, 1e-9, true);
1601+
}
15871602
}
15881603
}
15891604
}

wrapper/Move/CMakeNoOpenMM.txt

+1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@ set ( SIRE_OPENMM_WRAPPERS
33
NoOpenMM/OpenMMFrEnergyST.pypp.cpp
44
NoOpenMM/OpenMMFrEnergyDT.pypp.cpp
55
NoOpenMM/OpenMMMDIntegrator.pypp.cpp
6+
NoOpenMM/OpenMMPMEFEP.pypp.cpp
67
)

wrapper/Move/CMakeNoOpenMMFile.txt

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ set ( PYPP_OPENMM_SOURCES
33
NoOpenMM/OpenMMFrEnergyST.pypp.cpp
44
NoOpenMM/OpenMMFrEnergyDT.pypp.cpp
55
NoOpenMM/OpenMMMDIntegrator.pypp.cpp
6+
NoOpenMM/OpenMMPMEFEP.pypp.cpp
67
)
78

89
set( SIRE_OPENMM_LIBRARIES "" )

wrapper/Move/CMakeOpenMM.txt

+1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@ set ( SIRE_OPENMM_WRAPPERS
33
OpenMMFrEnergyST.pypp.cpp
44
OpenMMFrEnergyDT.pypp.cpp
55
OpenMMMDIntegrator.pypp.cpp
6+
OpenMMPMEFEP.pypp.cpp
67
)

wrapper/Move/CMakeOpenMMFile.txt

+1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@ set ( PYPP_OPENMM_SOURCES
33
OpenMMMDIntegrator.pypp.cpp
44
OpenMMFrEnergyDT.pypp.cpp
55
OpenMMFrEnergyST.pypp.cpp
6+
OpenMMPMEFEP.pypp.cpp
67
)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
// This file has been generated by Py++.
2+
3+
// (C) Christopher Woods, GPL >= 3 License
4+
5+
#include "boost/python.hpp"
6+
#include "OpenMMPMEFEP.pypp.hpp"
7+
8+
namespace bp = boost::python;
9+
10+
#include "SireFF/forcetable.h"
11+
12+
#include "SireIO/amber.h"
13+
14+
#include "SireMM/atomljs.h"
15+
16+
#include "SireMM/internalff.h"
17+
18+
#include "SireMM/internalperturbation.h"
19+
20+
#include "SireMaths/constants.h"
21+
22+
#include "SireMaths/rangenerator.h"
23+
24+
#include "SireMaths/vector.h"
25+
26+
#include "SireMol/amberparameters.h"
27+
28+
#include "SireMol/atomcharges.h"
29+
30+
#include "SireMol/atomcoords.h"
31+
32+
#include "SireMol/atommasses.h"
33+
34+
#include "SireMol/bondid.h"
35+
36+
#include "SireMol/connectivity.h"
37+
38+
#include "SireMol/mgname.h"
39+
40+
#include "SireMol/molecule.h"
41+
42+
#include "SireMol/core.h"
43+
44+
#include "SireMol/moleculegroup.h"
45+
46+
#include "SireMol/moleditor.h"
47+
48+
#include "SireMol/partialmolecule.h"
49+
50+
#include "SireMol/perturbation.h"
51+
52+
#include "SireMove/flexibility.h"
53+
54+
#include "SireStream/datastream.h"
55+
56+
#include "SireStream/shareddatastream.h"
57+
58+
#include "SireSystem/system.h"
59+
60+
#include "SireUnits/convert.h"
61+
62+
#include "SireUnits/temperature.h"
63+
64+
#include "SireUnits/units.h"
65+
66+
#include "SireVol/periodicbox.h"
67+
68+
#include "ensemble.h"
69+
70+
#include "openmmfrenergyst.h"
71+
72+
#include <QDebug>
73+
74+
#include <QTime>
75+
76+
#include <iostream>
77+
78+
#include "openmmfrenergyst.h"
79+
80+
SireMove::OpenMMPMEFEP __copy__(const SireMove::OpenMMPMEFEP &other){ return SireMove::OpenMMPMEFEP(other); }
81+
82+
const char* pvt_get_name(const SireMove::OpenMMPMEFEP&){ return "SireMove::OpenMMPMEFEP";}
83+
84+
void register_OpenMMPMEFEP_class(){
85+
86+
{ //::SireMove::OpenMMPMEFEP
87+
typedef bp::class_< SireMove::OpenMMPMEFEP > OpenMMPMEFEP_exposer_t;
88+
OpenMMPMEFEP_exposer_t OpenMMPMEFEP_exposer = OpenMMPMEFEP_exposer_t( "OpenMMPMEFEP", bp::init< >() );
89+
bp::scope OpenMMPMEFEP_scope( OpenMMPMEFEP_exposer );
90+
{ //::SireMove::OpenMMPMEFEP::typeName
91+
92+
typedef char const * ( *typeName_function_type )( );
93+
typeName_function_type typeName_function_value( &::SireMove::OpenMMPMEFEP::typeName );
94+
95+
OpenMMPMEFEP_exposer.def(
96+
"typeName"
97+
, typeName_function_value );
98+
99+
}
100+
OpenMMPMEFEP_exposer.staticmethod( "typeName" );
101+
OpenMMPMEFEP_exposer.def( "__copy__", &__copy__);
102+
OpenMMPMEFEP_exposer.def( "__deepcopy__", &__copy__);
103+
OpenMMPMEFEP_exposer.def( "clone", &__copy__);
104+
OpenMMPMEFEP_exposer.def( "__str__", &pvt_get_name);
105+
OpenMMPMEFEP_exposer.def( "__repr__", &pvt_get_name);
106+
}
107+
108+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// This file has been generated by Py++.
2+
3+
// (C) Christopher Woods, GPL >= 3 License
4+
5+
#ifndef OpenMMPMEFEP_hpp__pyplusplus_wrapper
6+
#define OpenMMPMEFEP_hpp__pyplusplus_wrapper
7+
8+
void register_OpenMMPMEFEP_class();
9+
10+
#endif//OpenMMPMEFEP_hpp__pyplusplus_wrapper

0 commit comments

Comments
 (0)