Skip to content

Add analysis for symmetry corrected RMSD#92

Merged
hannahbaumann merged 54 commits into
mainfrom
spyrmsd
May 28, 2026
Merged

Add analysis for symmetry corrected RMSD#92
hannahbaumann merged 54 commits into
mainfrom
spyrmsd

Conversation

@hannahbaumann
Copy link
Copy Markdown
Contributor

No description provided.

@hannahbaumann hannahbaumann linked an issue Feb 27, 2026 that may be closed by this pull request
@hannahbaumann hannahbaumann marked this pull request as draft February 27, 2026 12:13
@hannahbaumann hannahbaumann changed the title Add analysis for symmetry corrected RMSD [WIP] Add analysis for symmetry corrected RMSD Feb 27, 2026
@hannahbaumann hannahbaumann changed the base branch from main to rmsd_refactor_analysisbase February 27, 2026 12:13
@hannahbaumann hannahbaumann self-assigned this Mar 2, 2026
@hannahbaumann
Copy link
Copy Markdown
Contributor Author

The difference between the old ligand RMSD and the symmetry corrected ligand RMSD on the skipped dataset is quite big and the symmetry corrected ligand RMSD is greater (esp. at frame 5) which seemed weird.
The last test however shows that this is not due to symmetry correction (or the use of the state ligand and not the hybrid ligand), but since we are not doing mass weighting in the symmetry corrected RMSD which has a large effect here due to a Br atom.

Questions:

  • Would we want to implement mass weighting for the symmetry corrected RMSD? Do other packages report mass weighted RMSD or not?
  • Which "ligand" RMSD do we want to report? So far we had reported the RMSD of the hybrid topology, which, esp. when the number of dummy atoms is large, can lead to a large RMSD, even when the RMSD of the physical atoms might be small.
    • Would we want to report two ligand RMSD, for ligand A and ligand B?
    • Would we want to use physical atoms in the pure end states and hybrid topology for the intermediate lambda windows?

Do you have any thoughts @IAlibay or @jthorton ?

Comment thread src/openfe_analysis/tests/test_rmsd.py Outdated
@hannahbaumann hannahbaumann marked this pull request as ready for review May 21, 2026 07:44
@hannahbaumann hannahbaumann requested review from IAlibay and jthorton May 21, 2026 07:44
Copy link
Copy Markdown
Member

@IAlibay IAlibay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overally this looks great, just a few comments.

Comment thread src/openfe_analysis/tests/test_rmsd.py Outdated
Comment thread src/openfe_analysis/rmsd.py Outdated
Comment thread src/openfe_analysis/rmsd.py Outdated
Comment thread src/openfe_analysis/rmsd.py Outdated
Comment thread src/openfe_analysis/rmsd.py Outdated
Comment thread src/openfe_analysis/rmsd.py Outdated
Comment thread src/openfe_analysis/rmsd.py
Comment thread src/openfe_analysis/tests/test_rmsd.py Outdated
Co-authored-by: Irfan Alibay <IAlibay@users.noreply.github.com>
Comment thread src/openfe_analysis/utils/universe_utils.py Outdated
Comment thread src/openfe_analysis/rmsd.py
Comment thread src/openfe_analysis/rmsd.py
Comment thread src/openfe_analysis/tests/test_rmsd_classes.py
@hannahbaumann
Copy link
Copy Markdown
Contributor Author

pre-commit.ci autofix

Base automatically changed from rmsd_refactor_analysisbase to main May 27, 2026 09:45
@codecov
Copy link
Copy Markdown

codecov Bot commented May 27, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.05%. Comparing base (3e267b1) to head (53d718b).

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #92      +/-   ##
==========================================
+ Coverage   97.84%   98.05%   +0.21%     
==========================================
  Files           9        9              
  Lines         417      462      +45     
==========================================
+ Hits          408      453      +45     
  Misses          9        9              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown
Member

@IAlibay IAlibay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couple of small things, mostly the rdkit addition to pyproject.toml. Otherwise this lgtm!

Comment thread src/openfe_analysis/rmsd.py Outdated
if ligand:
# For now, leave it at the normal RMSD
lig_rmsd = RMSDAnalysis(ligand, mass_weighted=True).run(step=skip)
# state_lig = select_state_atoms(u, end_state="A").select_atoms("resname UNK")
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you migrate this to an issue and remove the comments here?

"pass an rdmol directly."
)
self._mol = rdmol if rdmol is not None else atomgroup.convert_to("RDKIT")
self._aprops = np.array([atom.GetAtomicNum() for atom in self._mol.GetAtoms()])
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might be good to add a check here that ensures that the atomgroup has the same number of atoms as the rdmol.

Comment thread src/openfe_analysis/rmsd.py
Comment thread pyproject.toml
Copy link
Copy Markdown
Contributor

@jthorton jthorton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Comment thread pyproject.toml
@hannahbaumann hannahbaumann merged commit c1bdddc into main May 28, 2026
9 checks passed
@hannahbaumann hannahbaumann deleted the spyrmsd branch May 28, 2026 08:27
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.

Using symmetry corrected RMSD for ligands

3 participants