Skip to content

Model building user guide - #2352

Open
jthorton wants to merge 12 commits into
mainfrom
docs/partial-charge-info
Open

jthorton wants to merge 12 commits into
mainfrom
docs/partial-charge-info

Conversation

@jthorton

@jthorton jthorton commented Nov 17, 2026 •

Copy link
Copy Markdown
Collaborator

Description

Adds a new user guide page on force field settings and partial charge options - related to the new how-to-guide in OpenFreeEnergy/ExampleNotebooks#358 which will give short examples related to the concepts here.

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]
    Drafted by me and cleaned up with GPT-6

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

@jthorton jthorton self-assigned this Nov 17, 2026
Comment thread docs/guide/setup/defining_protocols.rst Resolved
jthorton and others added 3 commits November 20, 2026 09:44
Co-authored-by: Irfan Alibay <IAlibay@users.noreply.github.com>

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

Thanks @jthorton , this looks great! I just reviewed the first half, will do the rest on Monday!

Comment thread docs/guide/setup/input_preparation.rst Outdated
Partial charges are assigned during protocol setup but can also
be assigned in advance for reproducibility and to avoid repeated calculations.
See Assigning partial charges :doc:`with the Python API </how_to_guides/user_charges>` or
Missing partial charges are assigned during protocol setup. They can also

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.

Should we mention here that currently the preferred way would be to pre-assign them?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Reworked to make it clear that pre-charging is preferred.

Comment thread docs/guide/setup/model_building.rst Outdated
* **Ligands and small-molecule cofactors:** a separate small-molecule force
field supplies parameters for :class:`.SmallMoleculeComponent`\s.
* **Partial charges:** protein and other non-small-molecule components typically use predefined *library* charges defined in the OpenMM XML files.
Small-molecule components can either use existing charges or have new charges assigned during setup.

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'm not sure if it would be clear to the user what "existing charges" means, maybe briefly add where they would come from (or if this is described elsewhere, maybe add a link here).

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Tried to make it clear and added links to guides for more information.

Comment thread docs/guide/setup/model_building.rst Outdated
Parameterization also depends on the chemistry of the prepared input; see the
:ref:`domain of applicability <userguide_protocols>` for current limitations.

Protein force fields

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.

Maybe adapt the header such that it's clear that this also entails e.g. water,ion,lipid ff?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Made it more explicit.

Comment thread docs/guide/setup/model_building.rst Outdated
---------------------------

The ``forcefield_settings.small_molecule_forcefield`` setting selects the
force field for ligands and other :class:`.SmallMoleculeComponent`\s. The

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.

maybe add "(e.g. cofactors)"?

Comment thread docs/guide/setup/model_building.rst Outdated

Structural ions and crystallographic waters retained in a protein input are
instead parameterized through the appropriate OpenMM XML files. See
:ref:`prep_cofactors` for preparation requirements and limitations.

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.

Maybe move the prep_cofactors comment one sentence above?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Good catch, moved.

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

Couple of things, otherwise looks good to me!

Comment thread docs/guide/setup/model_building.rst Resolved
Comment thread docs/guide/setup/model_building.rst Outdated
components in each :class:`.ChemicalSystem` during the protocol setup unit.

Here we detail model building for the **OpenMM** based protocols. For how to prepare the
structures, see :ref:`userguide_preparing_inputs`; for the general workflow

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.

Rather than these being in a separate sentence like this, would it be better to have the links be in-line as you mention these topics?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Moved inline in the opening.

Comment thread docs/guide/setup/model_building.rst Outdated
field supplies parameters for :class:`.SmallMoleculeComponent`\s.
* **Partial charges:** protein and other non-small-molecule components typically use predefined *library* charges defined in the OpenMM XML files.
Small-molecule components can either use existing charges or have new charges assigned during setup.
* **Water:** the solvation model and the water and ion parameters must be

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.

[nit] this maybe isn't as clear as it could be that the water parameters also rely on the OpenMM XML definition. It might be good to order them closer to each other and add some kind of small text addition to clarify the source of the parameters.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Moved up and added that they come from the OpenMM XML files as well.

the following replaces ff14SB with ff19SB::

forcefields = settings.forcefield_settings.forcefields
forcefields[forcefields.index("amber/ff14SB.xml")] = "amber19/protein.ff19SB.xml"

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 missing exposition on what the defaults are. I would put the output of the print call above and explain what each of the entries are.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

This is a nice improvement, added the output and a mapping between the files and the components.

Comment thread docs/guide/setup/model_building.rst Resolved
Comment thread docs/guide/setup/model_building.rst Outdated
* - Method
- Description
* - ``am1bcc``
- AM1-BCC (default), using AmberTools or OpenEye. Charges are generated at the input conformer.

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.

Maybe better to make the backend a separate table column?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Added the backend, and some text to make the relation clear.

jthorton and others added 4 commits November 26, 2026 12:38
Co-authored-by: Irfan Alibay <IAlibay@users.noreply.github.com>
Co-authored-by: Irfan Alibay <IAlibay@users.noreply.github.com>
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.

3 participants