Fixes the issues outlined in #102 with regard to individual atoms being part of multiple automatic restraint groups
restraints.py now checks for duplicates in the ligand restraint groups (Restraint.g1) when initializing the automatic extremity restraints. If duplicates are found, the atom is assigned to the restraint with its core closest to the atom position. The atom is deleted from all other restraints.
Significant memory management improvements
Previously, each restraint initialized its own MDAnalysis.Universe instance. This was extremely stupid. Now, a shared instance is used by all restraints, significantly improving memory usage and performance. (-6.8s for a 5-extremity 2OJ9 on an admittedly rather slow VM)
Tests adapted for new single-topology approach and duplicates
Status
Local tests with -m restraints go through. No external API changes, so there should be not problem with CI or the other tests, but it might be worth running them just in case.
Description
Fixes the issues outlined in #102 with regard to individual atoms being part of multiple automatic restraint groups
restraints.py
now checks for duplicates in the ligand restraint groups (Restraint.g1
) when initializing the automatic extremity restraints. If duplicates are found, the atom is assigned to the restraint with its core closest to the atom position. The atom is deleted from all other restraints.Significant memory management improvements Previously, each restraint initialized its own
MDAnalysis.Universe
instance. This was extremely stupid. Now, a shared instance is used by all restraints, significantly improving memory usage and performance. (-6.8s for a 5-extremity 2OJ9 on an admittedly rather slow VM)Tests adapted for new single-topology approach and duplicates
Status
-m restraints
go through. No external API changes, so there should be not problem with CI or the other tests, but it might be worth running them just in case.