michellab / Sire

Sire Molecular Simulations Framework
http://siremol.org
GNU General Public License v3.0
95 stars 26 forks source link

Fix bug causing distance restraints to be skipped if ligand not first in topology #359

Closed fjclark closed 2 years ago

fjclark commented 2 years ago

Julien has fixed a bug which caused distance restraints to be skipped if the ligand was not the first molecule in the topology. The issue was that when the distance restraints were set up they were stored in MolNum(1), but when the OpenMM system was initialised they were looked up in molecules.moleculeAt(0).

Julien has tested with systems where the ligand both is and is not the first molecule in the topology, and I have also tested the latter. The code worked as expected in all cases.

lohedges commented 2 years ago

Thanks for catching this. It is good timing, since we now no longer re-order the perturbable system to put the ligand first with BioSimSpace, rather using the perturbed residue number option instead.