Refactor RMSD analyses into MDAnalysis AnaysisBase classes#90
Open
hannahbaumann wants to merge 1 commit intomainfrom
Open
Refactor RMSD analyses into MDAnalysis AnaysisBase classes#90hannahbaumann wants to merge 1 commit intomainfrom
AnaysisBase classes#90hannahbaumann wants to merge 1 commit intomainfrom
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #90 +/- ##
==========================================
+ Coverage 88.16% 96.44% +8.28%
==========================================
Files 7 6 -1
Lines 338 366 +28
==========================================
+ Hits 298 353 +55
+ Misses 40 13 -27 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Contributor
Author
|
@talagayev and @jthorton : This is a first go at the refactor into the individual RMSD classes, based on the MDAnalysis |
AnaysisBase classes
jthorton
reviewed
Feb 20, 2026
Comment on lines
+177
to
+203
| class LigandRMSD(AnalysisBase): | ||
| """ | ||
| 1D RMSD time series for a ligand AtomGroup. | ||
| """ | ||
|
|
||
| def __init__(self, atomgroup, **kwargs): | ||
| super(LigandRMSD, self).__init__(atomgroup.universe.trajectory, **kwargs) | ||
|
|
||
| self._ag = atomgroup | ||
|
|
||
| def _prepare(self): | ||
| self.results.rmsd = [] | ||
| self._reference = self._ag.positions | ||
| self._weights = self._ag.masses / np.mean(self._ag.masses) | ||
|
|
||
| def _single_frame(self): | ||
| rmsd = rms.rmsd( | ||
| self._ag.positions, | ||
| self._reference, | ||
| self._weights, | ||
| center=False, | ||
| superposition=False, | ||
| ) | ||
| self.results.rmsd.append(rmsd) | ||
|
|
||
| def _conclude(self): | ||
| self.results.rmsd = np.asarray(self.results.rmsd) |
There was a problem hiding this comment.
2 initial thoughts:
- Can we make a more general RMSD class that can be reused for protein and ligand analysis, basically it should work on any atom group and does this not already exist in MDAnalysis?
- Do we not want to switch to use the symmetry RMSD (spyrmsd I think its called)?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refactor the rmsd analysis using this example: https://docs.mdanalysis.org/2.7.0/documentation_pages/analysis/base.html
gather_rms_datafunction but access the individual analysis classes directly in the openfeProtocolmake_Universefunction go into utils?