Euclidean minimum span tree for automatic wholemolecules
I open this issue to comment about the draft EMST implemented by @maxbonomi. Super useful!
First, a list of missing things:
- [ ] Allow
ActionAtomistic::makeWholeto use the tree. - [x] Add one or more regression tests
- [ ] (maybe) allow building a tree from current position; likely expensive, but might be super-useful for analysis. In addition, this would automatically work with virtual atoms (no need to manually place them in the reference PDB).
- [ ] Currently
WHOLEMOLECULESneeds aEMSTflag. I would suggest this should be the default. Notice that the same switches might be added to all actions that make use ofActionAtomistic::makeWhole. Maybe the simplest way is to (a) enable it when the pdb is declared asWHOLEand (b) disable it in other cases. Not sure though.
Then I put a few comments on Max implementation.
At these lines. Isn't it simpler to have a separate vector newatoms and append to it all atoms that have not been found in the PDB?
At this line: is it necessary to assume this? One could alternatively start with the addtotree atoms.
If we implement the on-the-fly tree building (as mentioned above) then we might try to optimise the code. Maybe some push_back's could be optimised. In any case, it looks like the main cost will be in this nested loop, that looks difficult to optimise further. Perhaps it can be parallelized with openMP.
Anyway, I think this is a major step forward in easing PBCs issues for molecular complexes.