Skip to content

Commit

Permalink
Merge pull request #220 from OpenBioSim/fix_213_215_219
Browse files Browse the repository at this point in the history
Fix issues 213, 215, and 219
  • Loading branch information
lohedges authored Aug 1, 2024
2 parents 762f244 + 4768ff7 commit d120cf2
Show file tree
Hide file tree
Showing 13 changed files with 157 additions and 20 deletions.
8 changes: 1 addition & 7 deletions corelib/src/libs/SireIO/amber.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2151,7 +2151,7 @@ tuple<MoleculeGroup, SpacePtr> 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]);
Expand All @@ -2173,12 +2173,6 @@ tuple<MoleculeGroup, SpacePtr> Amber::readCrdTop(const QString &crdfile, const Q
// spce = PeriodicBox( Vector ( crdBox[0], crdBox[1], crdBox[2] ) ).asA<Space>() ;
// 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 */
Expand Down
11 changes: 10 additions & 1 deletion corelib/src/libs/SireIO/amberprm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2181,7 +2181,16 @@ QStringList toLines(const QVector<AmberParams> &params, const Space &space, int

if (has_periodic_box)
{
pointers[27] = 1;
// Orthorhombic box.
if (space.isA<PeriodicBox>())
{
pointers[27] = 1;
}
// General triclinic box.
else if (space.isA<TriclinicBox>())
{
pointers[27] = 3;
}
}

// here is the number of solvent molecules, and the index of the last
Expand Down
4 changes: 4 additions & 0 deletions doc/source/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ organisation on `GitHub <https://github.com/openbiosim/sire>`__.
* 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.
* Only excluded nonbonded interactions between from_ghost and to_ghost atoms if they are in the same molecule.


`2024.2.0 <https://github.com/openbiosim/sire/compare/2024.1.0...2024.2.0>`__ - June 2024
-----------------------------------------------------------------------------------------
Expand Down
2 changes: 0 additions & 2 deletions requirements_bss.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@ py3dmol
pydot
pygtail
pyyaml
rdkit >=2023.0.0
gemmi >=0.6.4

# The below are packages that aren't available on all
# platforms/OSs and so need to be conditionally included
Expand Down
5 changes: 0 additions & 5 deletions requirements_build.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
rdkit-dev >=2023.0.0

# These packages are needed to compile
# the SireGemmi plugin
gemmi >=0.6.4
Expand Down
2 changes: 1 addition & 1 deletion requirements_host.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ gsl
lazy_import
libcblas
libnetcdf
librdkit-dev
openmm
pandas
python
qt-main
rich
tbb
tbb-devel
rdkit >=2023.0.0
gemmi >=0.6.4

# kartograf on Windows pulls in an openfe that has an old / incompatble
Expand Down
23 changes: 19 additions & 4 deletions wrapper/Convert/SireOpenMM/sire_to_openmm_system.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
}
}
Expand Down
1 change: 1 addition & 0 deletions wrapper/Move/CMakeNoOpenMM.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ set ( SIRE_OPENMM_WRAPPERS
NoOpenMM/OpenMMFrEnergyST.pypp.cpp
NoOpenMM/OpenMMFrEnergyDT.pypp.cpp
NoOpenMM/OpenMMMDIntegrator.pypp.cpp
NoOpenMM/OpenMMPMEFEP.pypp.cpp
)
1 change: 1 addition & 0 deletions wrapper/Move/CMakeNoOpenMMFile.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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 "" )
Expand Down
1 change: 1 addition & 0 deletions wrapper/Move/CMakeOpenMM.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ set ( SIRE_OPENMM_WRAPPERS
OpenMMFrEnergyST.pypp.cpp
OpenMMFrEnergyDT.pypp.cpp
OpenMMMDIntegrator.pypp.cpp
OpenMMPMEFEP.pypp.cpp
)
1 change: 1 addition & 0 deletions wrapper/Move/CMakeOpenMMFile.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ set ( PYPP_OPENMM_SOURCES
OpenMMMDIntegrator.pypp.cpp
OpenMMFrEnergyDT.pypp.cpp
OpenMMFrEnergyST.pypp.cpp
OpenMMPMEFEP.pypp.cpp
)
108 changes: 108 additions & 0 deletions wrapper/Move/NoOpenMM/OpenMMPMEFEP.pycpp.cpp
Original file line number Diff line number Diff line change
@@ -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 <QDebug>

#include <QTime>

#include <iostream>

#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);
}

}
10 changes: 10 additions & 0 deletions wrapper/Move/NoOpenMM/OpenMMPMEFEP.pycpp.hpp
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit d120cf2

Please sign in to comment.