Skip to content

Add simulation extraction and viewing notebook#226

Open
jthorton wants to merge 22 commits into
mainfrom
traj-view
Open

Add simulation extraction and viewing notebook#226
jthorton wants to merge 22 commits into
mainfrom
traj-view

Conversation

@jthorton

@jthorton jthorton commented Sep 5, 2025

Copy link
Copy Markdown
Contributor

Fixes #223

@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

@github-actions

github-actions Bot commented Sep 5, 2025

Copy link
Copy Markdown

Binder 👈 Launch a binder notebook on branch OpenFreeEnergy/ExampleNotebooks/traj-view

Comment thread simulation_visualisation/simulation_visualisation.ipynb Outdated
Comment thread simulation_visualisation/simulation_visualisation.ipynb
Comment thread simulation_visualisation/simulation_visualisation.ipynb
Comment thread simulation_visualisation/simulation_visualisation.ipynb
Comment thread simulation_visualisation/simulation_visualisation.ipynb
Comment thread simulation_visualisation/simulation_visualisation.ipynb

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

Overall looks good, thanks for doing this!

Added a few comments for things that we should address.

Comment thread simulation_visualisation/simulation_visualisation.ipynb
Comment thread simulation_visualisation/simulation_visualisation.ipynb
Comment thread simulation_visualisation/simulation_visualisation.ipynb
@hannahbaumann hannahbaumann self-assigned this Jun 1, 2026
@review-notebook-app

review-notebook-app Bot commented Jun 3, 2026

Copy link
Copy Markdown

View / edit / reply to this conversation on ReviewNB

IAlibay commented on 2026-06-03T13:14:02Z
----------------------------------------------------------------

Two questions:

1) Could you mention what Transformations are being applied by the method? Also can you mention that there's a separate one for solvent simulations if they want it.

2) Is there anything we can link to regarding when centering is a good idea and when it's not? I can't remember what Justin Lemkhul usually links to. Essentially what I mean here is that it would be good to say "don't center / align if you need to look at how components diffuse over time, etc..."


hannahbaumann commented on 2026-06-08T11:45:15Z
----------------------------------------------------------------

Added details on the transformations and added a note that the traj should not be aligned when looking at diffusion behavior. I couldn't find a good reference yet though.

@review-notebook-app

review-notebook-app Bot commented Jun 3, 2026

Copy link
Copy Markdown

View / edit / reply to this conversation on ReviewNB

IAlibay commented on 2026-06-03T13:14:03Z
----------------------------------------------------------------

"We can fix this, however, using the alignment functions in openfe_analysis"

It would be good to reword this as using a helper method to add a transformation to the MDAnalysis Universe. That way folkls that know MDAnalysis things can easily understand what's going on. For those that don't it would be good to link to the Transformations documentions in MDAnalysis (just so that folks understand what that means). And then in the code block add a comment when you apply the transformation.


hannahbaumann commented on 2026-06-08T11:48:52Z
----------------------------------------------------------------

Reworded, added a link to the MDA docs and a comment in the code block.

jthorton commented on 2026-06-09T09:21:49Z
----------------------------------------------------------------

This looks really good. One possible bit of info to add is that the resname of the ligand is always UNK from the protocol?

IAlibay commented on 2026-06-09T13:24:07Z
----------------------------------------------------------------

I would may avoid putting is as "always" but "usually" - in pontibus the ligands have normal residue names. Longer term we need to change this too (it's been a long term wish of mine to make SmallMoleculeComponent have a resname setter).

hannahbaumann commented on 2026-06-10T09:32:16Z
----------------------------------------------------------------

Thanks, I added a doc string before defining the ligand selection!

@jthorton

jthorton commented Jun 9, 2026

Copy link
Copy Markdown
Contributor Author

@hannahbaumann thanks for cleaning this up its looking great with the new openfe-analysis work! Do you want me to remove the old rendered figures?

IAlibay commented Jun 9, 2026

Copy link
Copy Markdown
Member

I would may avoid putting is as "always" but "usually" - in pontibus the ligands have normal residue names. Longer term we need to change this too (it's been a long term wish of mine to make SmallMoleculeComponent have a resname setter).


View entire conversation on ReviewNB

@review-notebook-app

review-notebook-app Bot commented Jun 9, 2026

Copy link
Copy Markdown

View / edit / reply to this conversation on ReviewNB

IAlibay commented on 2026-06-09T13:40:22Z
----------------------------------------------------------------

Line #2.    import mdtraj as md

Are we using this import anywhere anymore?


hannahbaumann commented on 2026-06-10T09:31:46Z
----------------------------------------------------------------

Removed this

@review-notebook-app

review-notebook-app Bot commented Jun 9, 2026

Copy link
Copy Markdown

View / edit / reply to this conversation on ReviewNB

IAlibay commented on 2026-06-09T13:40:23Z
----------------------------------------------------------------

Line #2.    tempfactor = 0.25

This is set but never used.


hannahbaumann commented on 2026-06-10T09:32:29Z
----------------------------------------------------------------

True, removed this!

@review-notebook-app

review-notebook-app Bot commented Jun 9, 2026

Copy link
Copy Markdown

View / edit / reply to this conversation on ReviewNB

IAlibay commented on 2026-06-09T13:40:23Z
----------------------------------------------------------------

Line #4.    state_a = sum([u_0.atoms[u_0.atoms.tempfactors == i] for i in (0.0, 0.5, 0.25)])

Could you not do u_0.atoms[u_0.atoms.tempfactors <= 0.5] ?


hannahbaumann commented on 2026-06-10T09:32:42Z
----------------------------------------------------------------

Thanks, changed this!

@review-notebook-app

review-notebook-app Bot commented Jun 9, 2026

Copy link
Copy Markdown

View / edit / reply to this conversation on ReviewNB

IAlibay commented on 2026-06-09T13:40:24Z
----------------------------------------------------------------

Line #5.            w.write(u_0.atoms[state_a.atoms.ix])

Can you not just do w.write(state_a) here ?


hannahbaumann commented on 2026-06-10T09:32:53Z
----------------------------------------------------------------

Changed this!

@review-notebook-app

review-notebook-app Bot commented Jun 9, 2026

Copy link
Copy Markdown

View / edit / reply to this conversation on ReviewNB

IAlibay commented on 2026-06-09T13:40:25Z
----------------------------------------------------------------

Line #7.            w.write(u_1.atoms[state_b.atoms.ix])

As above, you probably can just write the state_b atomgroup.


hannahbaumann commented on 2026-06-10T09:33:01Z
----------------------------------------------------------------

Changed this!

@review-notebook-app

review-notebook-app Bot commented Jun 9, 2026

Copy link
Copy Markdown

View / edit / reply to this conversation on ReviewNB

IAlibay commented on 2026-06-09T13:40:26Z
----------------------------------------------------------------

Line #6.    septop_lig_A_indices = unk_residues[0].atoms.indices.tolist()

[nit] To aid reader comprehension, adding a comment above this line re-iterating that you're getting the two ligands from distinct residues, might help.


hannahbaumann commented on 2026-06-10T09:33:16Z
----------------------------------------------------------------

Added a comment!

@review-notebook-app

review-notebook-app Bot commented Jun 9, 2026

Copy link
Copy Markdown

View / edit / reply to this conversation on ReviewNB

IAlibay commented on 2026-06-09T13:40:27Z
----------------------------------------------------------------

Should this be lambda=1?


hannahbaumann commented on 2026-06-10T09:33:30Z
----------------------------------------------------------------

Yes, changed this!

@review-notebook-app

review-notebook-app Bot commented Jun 9, 2026

Copy link
Copy Markdown

View / edit / reply to this conversation on ReviewNB

IAlibay commented on 2026-06-09T13:40:28Z
----------------------------------------------------------------

Line #2.    state_a = sum([u_septop_0.select_atoms("protein"), lig_A_0])

It would be cleaner for users to do: u_septop_0.select_atoms("protein") + lig_A_0


hannahbaumann commented on 2026-06-10T09:33:40Z
----------------------------------------------------------------

Changed this!

@review-notebook-app

review-notebook-app Bot commented Jun 9, 2026

Copy link
Copy Markdown

View / edit / reply to this conversation on ReviewNB

IAlibay commented on 2026-06-09T13:40:28Z
----------------------------------------------------------------

Line #5.            w.write(u_septop_0.atoms[state_a.atoms.ix])

should be able to use state_a directly here


hannahbaumann commented on 2026-06-10T09:33:49Z
----------------------------------------------------------------

Changed this!

@review-notebook-app

review-notebook-app Bot commented Jun 9, 2026

Copy link
Copy Markdown

View / edit / reply to this conversation on ReviewNB

IAlibay commented on 2026-06-09T13:40:29Z
----------------------------------------------------------------

Line #7.            w.write(u_septop_1.atoms[state_b.atoms.ix])

As above


hannahbaumann commented on 2026-06-10T09:33:59Z
----------------------------------------------------------------

Changed this!

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

This is looking good but there's a few things that are worth addressing before merge.

Copy link
Copy Markdown
Contributor

Removed this


View entire conversation on ReviewNB

Copy link
Copy Markdown
Contributor

Thanks, I added a doc string before defining the ligand selection!


View entire conversation on ReviewNB

Copy link
Copy Markdown
Contributor

True, removed this!


View entire conversation on ReviewNB

Copy link
Copy Markdown
Contributor

Thanks, changed this!


View entire conversation on ReviewNB

Copy link
Copy Markdown
Contributor

Changed this!


View entire conversation on ReviewNB

Copy link
Copy Markdown
Contributor

Changed this!


View entire conversation on ReviewNB

Copy link
Copy Markdown
Contributor

Added a comment!


View entire conversation on ReviewNB

Copy link
Copy Markdown
Contributor

Yes, changed this!


View entire conversation on ReviewNB

Copy link
Copy Markdown
Contributor

Changed this!


View entire conversation on ReviewNB

Copy link
Copy Markdown
Contributor

Changed this!


View entire conversation on ReviewNB

Copy link
Copy Markdown
Contributor

Changed this!


View entire conversation on ReviewNB

@hannahbaumann hannahbaumann requested a review from IAlibay June 10, 2026 10:42
@hannahbaumann

Copy link
Copy Markdown
Contributor

@jthorton : I removed the images since they were no longer used!

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.

OpenFE Analylsis notebook

4 participants