Skip to content

Add BoreschRestraintAnalysis class - #123

Merged
hannahbaumann merged 9 commits into
mainfrom
boresch_analysis
Aug 12, 2026
Merged

Add BoreschRestraintAnalysis class#123
hannahbaumann merged 9 commits into
mainfrom
boresch_analysis

Conversation

@hannahbaumann

Copy link
Copy Markdown
Contributor

No description provided.

@review-notebook-app

Copy link
Copy Markdown

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@codecov

codecov Bot commented Jul 7, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.35%. Comparing base (ff29d21) to head (4235567).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #123      +/-   ##
==========================================
+ Coverage   98.26%   98.35%   +0.09%     
==========================================
  Files           9       10       +1     
  Lines         461      487      +26     
==========================================
+ Hits          453      479      +26     
  Misses          8        8              

☔ View full report in Codecov by Harness.
📢 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.

Comment on lines +35 to +38
if len(atomgroup) != 6:
raise ValueError(
f"atomgroup must contain exactly 6 atoms (3 host + 3 guest), got {len(atomgroup)}."
)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Does it make sense to check that there are no bonds between the H and G atoms or that they are in different residues?

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.

[personal take] I could go either way, but I personally wouldn't bother (i.e. flexibility is always good).

@@ -0,0 +1,393 @@
{

@jthorton jthorton Jul 15, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This could also be used in ABFEs as well, can we make the intro more generic to absolute calculations and then narrow the scope to septop for this example?


Reply via ReviewNB

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.

+1

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Wrote this more general now.

@@ -0,0 +1,393 @@
{

@jthorton jthorton Jul 15, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

typo: includea -> includes

Analysis unit -> Analysis Unit ?

match on - > match outputs["repeat_id"]


Reply via ReviewNB

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed this!

@@ -0,0 +1,393 @@
{

@jthorton jthorton Jul 15, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is this only plotting the first and last frame? It makes the plots look strange and quite different from what we would expect in practice, so it might be best to plot more frames to avoid confusing users when they run this analysis. I think we should highlight what the interacting lambda is in the text for each case, as it swaps going from A to B.


Reply via ReviewNB

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This was from a very short simulation, I didn't have one at hand with more frames, will update that after running some more simulations!

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Added a traj from a full simulation.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nice this looks much better, would it be worth swapping the labels to interacting/non-interacting and using a consistent colour between the plots to make it clear what the lambda values correspond to or is there a way to make it clear the interacting state changes between the ligand A and B plots?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I updated this, since technically, the user could also plot more lambda windows, I added something that in that case it would go back to lambda_* in the label.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nice that is much nicer to me! How does it look with y-axis labels or is it too crowded?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Good point! I added the units as ylabels, since the titles already have the type, I thought the unit would be enough.

@@ -0,0 +1,393 @@
{

@jthorton jthorton Jul 15, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

For the future, maybe we should be adding some shaded region for the std of the reference value to indicate what a reasonable fluctuation is.


Reply via ReviewNB

@IAlibay IAlibay left a comment

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.

Only just reviewing the analysis class itself, it looks great! So I'll approve on my end.

That being said, I agree with Josh's comments on the notebook (didn't read too deeply into the notebook details though).

Notes
-----
Bond length is reported in Angstrom; angles and dihedrals are reported
in radians, matching the units returned by MDAnalysis's

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.

Something to think about doing (not here) is to make the final results united.

@hannahbaumann
hannahbaumann requested a review from jthorton August 11, 2026 08:24
@@ -0,0 +1,440 @@
{

@jthorton jthorton Aug 12, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Add a reference/link to read more about Boresch restraints?


Reply via ReviewNB

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Added a reference to the original paper.

@jthorton jthorton left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is great thanks @hannahbaumann !

@hannahbaumann
hannahbaumann requested a review from jthorton August 12, 2026 11:14
@hannahbaumann
hannahbaumann merged commit 86b1a79 into main Aug 12, 2026
9 checks passed
@hannahbaumann
hannahbaumann deleted the boresch_analysis branch August 12, 2026 11:16
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.

Make analysis class for Boresch restraint analysis Analysis for Boresch-style restraint stability

3 participants