Skip to content

rmsd_to/pairwise_rmsd: search symmetry mappings in heavy-atom mode - #19

Open
rpinho wants to merge 1 commit into
rowansci:masterfrom
rpinho:fix-rmsd-symmetry
Open

rpinho wants to merge 1 commit into
rowansci:masterfrom
rpinho:fix-rmsd-symmetry

Conversation

@rpinho

@rpinho rpinho commented Nov 16, 2026

Copy link
Copy Markdown

There's a bug in ConformerEnsemble.rmsd_to and pairwise_rmsd: in heavy-atom mode (the default) they pass only an identity atom map to GetBestRMS, so it can't search the symmetry mappings the docstrings promise.

Two isopentane conformers that differ only by swapping the two equivalent methyl groups give about 0.79 Å with the default heavy_only=True, and 0 in all-atom mode. The right answer is 0, so any molecule with symmetric groups gets inflated RMSDs by default.

This removes hydrogens from the private copy of the molecule used for the comparison and lets GetBestRMS search the mappings. Stored conformers and coordinates don't change, and all-atom mode is unchanged.

Test: tests/test_rmsd_symmetry.py (both methods, heavy and all atoms) fails on main for the two heavy-atom cases and passes here. ruff format --check, ruff check, ty check, prek run --all-files and uv build pass; pytest --cov: 177 passed, 1 xfailed (the existing C12 xfail).

🤖 Generated with Claude Code

https://claude.ai/code/session_01LKxc9GKLwnyeV2jaZBxH9N

@rpinho

rpinho commented Nov 19, 2026

Copy link
Copy Markdown
Author

Let me know if you have any thoughts on this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant