Skip to content

Add simulation visualization notebook to how-to guides - #2344

Open
hannahbaumann wants to merge 8 commits into
docs/howto-analyzefrom
docs/add-sim-viz
Open

hannahbaumann wants to merge 8 commits into
docs/howto-analyzefrom
docs/add-sim-viz

Conversation

@hannahbaumann

@hannahbaumann hannahbaumann commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

Description

LLM / AI generated code disclosure

LLMs or other AI-powered tools (beyond simple IDE use cases) were used in this contribution:

  • No
  • Yes: [If yes, please provide details here]

Checklist

  • Read the AI Policy and filled in the AI-generated code disclosure.
  • Adhered to the contribution guidelines
  • All new code is appropriately documented (user-facing code must have complete docstrings).
  • Ran pre-commit: you can run pre-commit locally or comment on this PR with pre-commit.ci autofix.
  • Added a news entry, or the changes are not user-facing.

Manual Tests: these are slow so don't need to be run every commit, only before merging and when relevant changes are made (generally at reviewer-discretion).

Developers certificate of origin

@hannahbaumann
hannahbaumann changed the base branch from main to docs/howto-analyze November 9, 2026 12:58
@hannahbaumann
hannahbaumann marked this pull request as ready for review November 9, 2026 12:58
@hannahbaumann hannahbaumann self-assigned this Nov 9, 2026
@atravitz

Copy link
Copy Markdown
Contributor

this looks good, but as mentioned over in OpenFreeEnergy/ExampleNotebooks#359, I think it would make sense to move the protocol-specific explanations over to the user guide. Thoughts?

@hannahbaumann

Copy link
Copy Markdown
Contributor Author

@atravitz I added some of the content from the notebook to the protocol user guides here and removed it in the notebooks!

hannahbaumann and others added 2 commits November 10, 2026 17:38
* Update showcase assets

* Look at showcase updates

* Apply suggestion from @hannahbaumann
@atravitz atravitz closed this Nov 10, 2026
@atravitz atravitz reopened this Nov 10, 2026

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

I think the content is good, but the single-paragraph format is confusing. I made a suggestion for making it more structured, but anything that makes it more readable is fine by me!

Comment on lines +138 to +146
Each leg writes a multistate trajectory (``complex.nc`` and ``solvent.nc``) with its topology
(``alchemical_system.pdb``). The trajectory stores the positions of every replica, together with the λ state each
replica was in at each iteration. A trajectory can therefore be read in two ways: at a fixed λ **state**, combining
frames from whichever replica occupied that state, or along a single **replica** as it moves between λ states.
This applies to the default replica exchange sampler (``sampler_method = "repex"``).
With ``"independent"`` sampling, replicas never change state, so both give the same trajectory;
with ``"sams"``, a λ state is not necessarily occupied at every iteration, so reading by state may not be possible.
Only the atoms selected by ``output_indices`` are saved, which by default excludes water.
Both files can be loaded with `openfe_analysis`_ to visualize the simulation, extract the trajectories of the end states,

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.

Suggested change
Each leg writes a multistate trajectory (``complex.nc`` and ``solvent.nc``) with its topology
(``alchemical_system.pdb``). The trajectory stores the positions of every replica, together with the λ state each
replica was in at each iteration. A trajectory can therefore be read in two ways: at a fixed λ **state**, combining
frames from whichever replica occupied that state, or along a single **replica** as it moves between λ states.
This applies to the default replica exchange sampler (``sampler_method = "repex"``).
With ``"independent"`` sampling, replicas never change state, so both give the same trajectory;
with ``"sams"``, a λ state is not necessarily occupied at every iteration, so reading by state may not be possible.
Only the atoms selected by ``output_indices`` are saved, which by default excludes water.
Both files can be loaded with `openfe_analysis`_ to visualize the simulation, extract the trajectories of the end states,
Each leg writes:
- a multistate trajectory (``complex.nc`` and ``solvent.nc``)
- the trajectory's corresponding topology (``alchemical_system.pdb``)
For the default replica exchange sampler (``sampler_method = "repex"``), the trajectory stores the positions of every replica, together with the λ state each replica was in at each iteration.
A ``repex`` trajectory can therefore be read in two ways: at a fixed λ **state**, combining frames from whichever replica occupied that state, or along a single **replica** as it moves between λ states.
With ``"independent"`` sampling, replicas never change state, so both give the same trajectory.
With ``"sams"``, a λ state is not necessarily occupied at every iteration, so reading by state may not be possible.
Only the atoms selected by ``output_indices`` are saved, which by default excludes water.
Both files can be loaded with `openfe_analysis`_ to visualize the simulation, extract the trajectories of the end states,

I find the block of text difficult to parse as-is. Maybe breaking it up like this would help? It would also be good to link to/from the API sampler_method setting.

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.

[docs] we should point out some example(s) on how to read out the trajectories from our output files

2 participants