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.
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.
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.