OpenBioSim / sire

Sire Molecular Simulations Framework
https://sire.openbiosim.org
GNU General Public License v3.0
41 stars 11 forks source link

Fix AtomMapping::alignTo when mapping an ion to a molecule #211

Closed lohedges closed 3 months ago

lohedges commented 3 months ago

This PR fixes the AtomMapping::alignTo methods to handle the case where one molecule is a monatomic ion. This allows sire.morph.merge to handle the creation of alchemical ions by merging a water molecule with an ion. The existing alignTo methods fail since they attempt a RMSD alignment when there are too few degrees of freedom.

Suggested reviewers:

@chryswoods

lohedges commented 3 months ago

Note that this is just assuming a single ion is mapped, which is the use case in question. I guess we could generalise this to fix when the AtomMapping contains multiple molecules that are mapped to ions.

lohedges commented 3 months ago

I just need to add a platform skipif decorator for Windows. I'll add this tomorrow.

lohedges commented 3 months ago

Thanks. I'll merge this in so that we can work on the somd2 alchemical ion implementation next week.