Skip to content

Conversation

@hannahbaumann
Copy link
Contributor

@hannahbaumann hannahbaumann commented Dec 18, 2025

After #70 (merged in that branch into this PR to fix tests)
Fixes #30

@hannahbaumann hannahbaumann changed the title Fix multi chain RMSD analysis [WIP] Fix multi chain RMSD analysis Dec 18, 2025
@hannahbaumann hannahbaumann self-assigned this Dec 19, 2025
@hannahbaumann
Copy link
Contributor Author

Check if this works for triclinic boxes. From Irfan: There might also be code in MDAnalysis that does the math also working for triclinic boxes.

@hannahbaumann hannahbaumann marked this pull request as ready for review January 16, 2026 10:30
@codecov
Copy link

codecov bot commented Jan 28, 2026

Codecov Report

❌ Patch coverage is 98.30508% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 87.28%. Comparing base (5260e3b) to head (e706b11).
⚠️ Report is 5 commits behind head on main.

Files with missing lines Patch % Lines
src/openfe_analysis/rmsd.py 97.67% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #64      +/-   ##
==========================================
- Coverage   88.16%   87.28%   -0.89%     
==========================================
  Files           7        7              
  Lines         338      346       +8     
==========================================
+ Hits          298      302       +4     
- Misses         40       44       +4     

☔ 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.

@hannahbaumann hannahbaumann changed the title [WIP] Fix multi chain RMSD analysis Fix multi chain RMSD analysis Jan 28, 2026
@hannahbaumann
Copy link
Contributor Author

pre-commit.ci autofix

center = self.central_ag.center_of_mass()
box = self.central_ag.dimensions[:3]
center = self.reference.center_of_mass()
box = triclinic_vectors(ts.dimensions)

Choose a reason for hiding this comment

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

Nice this is great that it works with all boxes.

# this only works for orthogonal boxes
ag.positions -= np.rint(vec / box) * box
frac = np.linalg.solve(box.T, vec) # fractional coordinates
shift = np.dot(np.round(frac), box) # nearest image

Choose a reason for hiding this comment

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

Maybe comment round to get the nearest image, then compute the shift

Comment on lines +53 to +54
for frag in prot.fragments:
make_whole(frag, reference_atom=frag[0])

Choose a reason for hiding this comment

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

Showing the limits of my MDAnalysis knowledge, but does this not need to be added to the trajectory transformations?

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.

Analysis does not work properly for proteins with multiple chains

3 participants