-
Notifications
You must be signed in to change notification settings - Fork 45
User guide updates membrane #1933
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
4e6617e
ac9862a
8ea145a
587a1bf
b7c63d6
24f3d58
617ac8c
7fd5ca9
18db828
1ee6fd7
238b36b
6945805
646ebbe
abf0007
96fa49a
b70e5b2
481ff35
4d28281
eff1958
1456a99
0cdde55
5bfd1c9
ce29130
c53fd60
5c313b1
9dce0e0
080d93e
48a7844
b492de0
2913994
e654a4d
1e707ba
bf51b0c
872c914
27d15f7
508fa62
a33d882
7a640ce
44e3545
6e4023d
339a9ed
741e44c
e53512b
e67ecd2
1f408fc
19761df
5d5bc8e
3e6b063
4d7da11
4c7cdd4
0962f3c
00c606e
b317cab
d97de53
2145f37
fc61675
b132806
88c9179
379cdf6
d79eb36
207fe3c
3504100
af99e37
c309957
9ae0565
4156c55
4327ef1
ff06372
3cd7793
8c00e32
5dd1758
11602f5
7ac6d32
45c26de
7dc626c
621b0d7
a42653e
825e8ae
919cacf
683b47d
21615c8
45f48e0
d3c4711
efdb5f1
5f6816c
b7f021d
cfdaf04
e35690c
5a9f873
31f9227
a2ab353
8ff8d45
39e62ca
71c8a99
edd0e5d
e23d2a2
1936b83
cafa04a
ec2beaa
a0a2ad1
6a3a5a3
0996c33
df381f9
54986e8
14e162e
a0b3c91
30218d2
5273d43
962dea5
c9b75b9
5eebbbc
8b53130
93b4cb7
481c0e9
32c4a5e
4586c5b
8b8529c
ede10d3
69d0986
40b87ec
ff2fec9
d7e4255
58a004d
0039bbe
5cfbc61
02ce210
3450d2c
78b266c
24cb6d3
df4ca99
9f67fbf
3ec132d
eddd3d2
c2feb33
de778de
39793ea
db4ba21
2eaa4a1
775b619
949eaeb
20fcd05
a31527c
d8d8051
33e2694
ff5c0c3
e9187fd
93e9d54
db0bc3e
676f4c6
20dbdf9
1720e00
8652214
db33dd2
a148ae8
201d9fa
22bdbe4
a9dae30
f30578e
f12d806
1af9cc6
7254ee7
13786db
31e4d72
d6f4fc4
e8b1e29
99d1258
eba6282
d7468b6
6e848d8
c228e52
d715d11
c798e58
c2a6467
375e26b
028e442
a72e135
81daebb
aeec7f4
5b0d76c
83a7c21
c281222
b3d2a0f
a41644b
61d0c7d
d1f2be9
5ccbfb6
322955b
d893a2d
6b5c105
b207607
e9d8c0b
a1041fd
6f7ff71
d514dca
e7ae164
c34c1b6
aaaef62
f680e54
f5c2927
15bfcb6
0222eb8
312268e
0f953f3
e393fda
72c7f89
66bcb27
d8177ac
427ce2b
0662d60
0a0f29c
5943aed
d6bce0f
7ed71b0
002d321
2411b5d
87735e9
d1b70a1
c54c699
02e7a93
4935166
52b8e3c
eea1967
60678df
7babe21
7d5750b
de2e5e9
4484d9d
c0fcc4e
d4f2051
752784f
3f2f50b
1463b97
cd998b9
5c7cdef
58453b0
1e8fc68
6fdebcc
ee1a729
24405dd
eac871c
5b64a84
16aa5a8
acd0abb
d1e2fe0
9976c15
27ca639
108a86d
f2ba207
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,5 @@ | ||
| .. _userguide_abfe_protocol: | ||
|
|
||
| Absolute Binding Protocol | ||
| ========================= | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,5 @@ | ||
| .. _userguide_septop_protocol: | ||
|
|
||
| Separated Topologies Protocol | ||
| ============================= | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,55 +1,201 @@ | ||
| .. _userguide_chemicalsystems_and_components: | ||
|
|
||
| Chemical Systems, Components and Thermodynamic Cycles | ||
| Components, Chemical Systems and Thermodynamic Cycles | ||
| ===================================================== | ||
|
|
||
| This page describes the core building blocks used to define simulation states in openfe: | ||
| :class:`.Component`\s, which describe what is physically present in a system; | ||
| :class:`.ChemicalSystem`\s, which combine components into a complete end state; | ||
| and thermodynamic cycles, which connect end states via alchemical transformations. | ||
|
|
||
| .. _userguide_components: | ||
|
|
||
| Components | ||
| ---------- | ||
|
|
||
| Components are the composable building blocks that define the chemical | ||
| composition of a simulated system. Splitting a system into components serves three purposes: | ||
|
|
||
| 1. Alchemical transformations can be easily understood by comparing the differences in components. | ||
| 2. Components can be reused to compose different systems. | ||
| 3. :class:`.Protocol`\s can apply component-specific behaviour, e.g. different force fields per component. | ||
|
|
||
|
|
||
| Component types — overview | ||
| ~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
|
||
| .. list-table:: | ||
| :header-rows: 1 | ||
| :widths: 25 30 45 | ||
|
|
||
| * - Component | ||
| - Role | ||
| - Key notes | ||
| * - :class:`.ProteinComponent` | ||
| - Biological assembly | ||
| - Typically the contents of a PDB file. May include crystallographic waters and ions (defined as HETATM entries), | ||
| and disulfide bonds (defined via CONECT records). | ||
| * - :class:`.SmallMoleculeComponent` | ||
| - Ligands and cofactors | ||
| - Can optionally contain atomic partial charges. If present, those will be used in the simulation. | ||
| * - :class:`.SolventComponent` | ||
| - Abstract solvent definition | ||
| - Defines solvent conditions and ion concentration. Does **not** include coordinates or box vectors. Solvent is added by the protocol at runtime. | ||
| * - :class:`.SolvatedPDBComponent` | ||
| - Explicitly solvated system | ||
| - Includes atomic coordinates and box vectors. Solvent is already present, | ||
| the protocol does not add any further solvation. | ||
| * - :class:`.ProteinMembraneComponent` | ||
| - Protein-membrane complex | ||
| - Subclass of :class:`.SolvatedPDBComponent`. Includes protein, membrane, solvent, | ||
| and box vectors. Replaces :class:`.ProteinComponent` in membrane systems. | ||
|
|
||
| .. _userguide_solvation_models: | ||
|
|
||
| Abstract vs explicit solvation | ||
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
|
||
| These two approaches are **mutually exclusive**: | ||
|
|
||
| * **Abstract solvation** — use a :class:`.SolventComponent`. The protocol adds solvent | ||
| during system preparation. | ||
| * **Explicit solvation** — use a :class:`.SolvatedPDBComponent` or | ||
| :class:`.ProteinMembraneComponent`. Solvent molecule coordinates (waters and ions) are explicitly defined in the inputs. | ||
|
|
||
| Either define the solvent abstractly, or provide a fully solvated system — do not mix | ||
| both for the same leg of a transformation. | ||
|
|
||
| .. note:: | ||
|
|
||
| Some protocols, such as :class:`.SepTopProtocol` and :class:`.AbsoluteBindingProtocol`, | ||
| use a single :class:`.ChemicalSystem` to represent both the complex and solvent legs. | ||
| In this case, a :class:`.ChemicalSystem` may contain both a :class:`.SolventComponent` | ||
| and a :class:`.ProteinMembraneComponent`. However, these apply to *different* legs: the | ||
| :class:`.SolventComponent` is used only for the solvent leg, and the | ||
| :class:`.ProteinMembraneComponent` (which is already explicitly solvated) is used only | ||
| for the complex leg. The mutual exclusivity rule still holds per leg. | ||
|
|
||
| Box vectors for explicitly solvated systems | ||
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
|
||
| The components :class:`.SolvatedPDBComponent` and :class:`.ProteinMembraneComponent` | ||
| require periodic box vectors. These can be provided in three ways: | ||
|
|
||
| 1. **CRYST record in the PDB file** — OpenMM reads box vectors automatically. No additional arguments are needed:: | ||
|
|
||
| membrane_protein = openfe.ProteinMembraneComponent.from_pdb_file('./protein_membrane.pdb') | ||
|
|
||
| 2. **Manual specification** — box vectors can be provided explicitly as numpy arrays with OpenFF units in OpenMM format via the ``box_vectors`` argument:: | ||
|
|
||
| import numpy as np | ||
| import openff.units as offunit | ||
|
|
||
| box_vectors = np.array([ | ||
| [6.9587, 0.0, 0.0], | ||
| [0.0, 5.9164, 0.0], | ||
| [0.0, 0.0, 9.2692] | ||
| ]) * offunit.nanometer | ||
|
|
||
| membrane_protein = openfe.ProteinMembraneComponent.from_pdb_file( | ||
| './protein_membrane.pdb', box_vectors=box_vectors | ||
| ) | ||
|
|
||
| 3. **Inference from atomic coordinates** — box vectors can be estimated from the atomic | ||
| positions by passing ``infer_box_vectors=True``:: | ||
|
|
||
| membrane_protein = openfe.ProteinMembraneComponent.from_pdb_file( | ||
| './protein_membrane.pdb', infer_box_vectors=True | ||
| ) | ||
|
|
||
| .. warning:: | ||
|
|
||
| Inferring box vectors from atomic positions can be inaccurate if the PDB originates | ||
| from a previous simulation where atoms may be distributed across periodic images. | ||
|
|
||
|
|
||
| .. _userguide_chemical_systems: | ||
|
|
||
| Chemical Systems | ||
| ---------------- | ||
| ChemicalSystem | ||
| -------------- | ||
|
|
||
| A :class:`.ChemicalSystem` represents the end state of an alchemical transformation, | ||
| which can then be input to a :class:`.Protocol`. | ||
| A :class:`.ChemicalSystem` is composed of components that together describe a model of the system to be simulated. | ||
| simulated system. It represents the **end state** of an alchemical transformation | ||
| and is the primary input a :class:`.Protocol` consumes to define a simulation state. | ||
|
|
||
| A :class:`.ChemicalSystem` **does** contain the following information (when present): | ||
| **What a ChemicalSystem defines** | ||
|
|
||
| * exact atomic information (including protonation state) of protein, ligands, co-factors, and any crystallographic | ||
| waters | ||
| * atomic positions of all explicitly defined components such as ligands or proteins | ||
| * the abstract definition of the solvation environment, if present | ||
| * Exact atomic information (including protonation state) of protein, ligands, | ||
| cofactors, and any crystallographic waters. | ||
| * Atomic positions of all explicitly defined components such as ligands or proteins. | ||
| * The abstract or explicit definition of the solvent environment (SolventComponent). | ||
|
|
||
| A :class:`.ChemicalSystem` does **NOT** include the following: | ||
| **What a ChemicalSystem does NOT define**, and are instead handled by the Protocol: | ||
|
|
||
| * forcefield applied to any component, including details on water model or virtual particles | ||
| * thermodynamic conditions (e.g. temperature or pressure) | ||
| Any simulation parameters including: | ||
| * Forcefield applied to any component, including water model or virtual particles. | ||
| * Thermodynamic conditions (e.g. temperature or pressure). | ||
| * These are handled by the :class:`.Protocol`. | ||
|
hannahbaumann marked this conversation as resolved.
|
||
|
|
||
| .. _userguide_components: | ||
| .. _userguide_system_composition: | ||
|
|
||
| System composition examples | ||
| --------------------------- | ||
|
|
||
| The components that make up each :class:`.ChemicalSystem` depend on the protocol and | ||
| the nature of the system. The table below summarises the composition for each combination. | ||
|
|
||
| Components | ||
| ---------- | ||
|
|
||
| A :class:`.ChemicalSystem` is composed of many 'component' objects, which together define overall system. | ||
| .. note:: | ||
|
|
||
| Examples of components include: | ||
| Protocol-specific behaviour: | ||
| For :class:`.SepTopProtocol` and :class:`.AbsoluteBindingProtocol`, a single | ||
| :class:`.ChemicalSystem` represents both legs of the thermodynamic cycle. The protocol | ||
| determines internally what is the complex leg and what is the solvent leg. | ||
| This differs from the :class:`.RelativeHybridTopologyProtocol`, where each leg (e.g. complex and solvent) is defined by | ||
| separate :class:`.ChemicalSystem`\s. This behaviour is expected to change in future versions. | ||
|
|
||
| * :class:`.ProteinComponent`: an entire biological assembly, typically the contents of a PDB file. | ||
| * :class:`.SmallMoleculeComponent`: typically ligands and cofactors | ||
| * :class:`.SolventComponent`: solvent conditions | ||
| .. list-table:: | ||
| :header-rows: 1 | ||
| :widths: 20 40 40 | ||
|
|
||
| Splitting the total system into components serves three purposes: | ||
| * - System | ||
| - :ref:`RBFE <userguide_relative_hybrid_topology_protocol>` (:class:`.RelativeHybridTopologyProtocol`) | ||
| - :ref:`SepTop <userguide_septop_protocol>` / :ref:`ABFE <userguide_abfe_protocol>` (:class:`.SepTopProtocol`, :class:`.AbsoluteBindingProtocol`) | ||
| * - **Standard protein–ligand** | ||
| - | **Complex leg:** | ||
| | :class:`.ProteinComponent` + :class:`.SmallMoleculeComponent`\s + :class:`.SolventComponent` | ||
| | | ||
| | **Solvent leg:** | ||
| | :class:`.SmallMoleculeComponent`\s + :class:`.SolventComponent` | ||
| - | **Single ChemicalSystem (both legs):** | ||
| | :class:`.ProteinComponent` + :class:`.SmallMoleculeComponent`\s + :class:`.SolventComponent` | ||
| * - **Membrane system** | ||
| - | **Complex leg:** | ||
| | :class:`.ProteinMembraneComponent` + :class:`.SmallMoleculeComponent`\s | ||
| | *(no* :class:`.SolventComponent` *— already explicitly solvated)* | ||
| | | ||
| | **Solvent leg:** | ||
| | :class:`.SmallMoleculeComponent`\s + :class:`.SolventComponent` | ||
| - | **Single ChemicalSystem (both legs):** | ||
| | :class:`.ProteinMembraneComponent` + :class:`.SmallMoleculeComponent`\s + :class:`.SolventComponent` | ||
| | *(protocol applies* :class:`.SolventComponent` *only in the solvent leg)* | ||
|
|
||
| 1. alchemical transformations can be easily understood by comparing the differences in components. | ||
| 2. components can be reused to compose different systems. | ||
| 3. :class:`.Protocol`\s can have component-specific behavior. E.g. different force fields for each component. | ||
|
|
||
| Thermodynamic Cycles | ||
| -------------------- | ||
|
|
||
| We can now describe a thermodynamic cycle as a set of :class:`.ChemicalSystem`\s. | ||
| The exact end states to construct are detailed in the :ref:`pages for each specific Protocol <userguide_protocols>`. | ||
| A thermodynamic cycle can be described as a set of :class:`.ChemicalSystem`\s (nodes) connected by | ||
| alchemical transformations (edges). The :class:`.Protocol` defines how the | ||
| :class:`.ChemicalSystem`\s map onto the cycle and how they are used in practice. | ||
|
Comment on lines
+187
to
+189
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this unclear regarding thermodynamic cycles and alchemical networks. Not blocking for this PR, but maybe we can follow up with a better explainer over in the alchemical network docs?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I ended up removing the reference to the alchemical networks here, because I think it would confuse users more, since a thermodynamic cycle is more linked to a Transformation. I think the reference to the protocols here is more helpful, since e.g. in the RBFE protocol we say how the ChemicalSystems are used to describe the thermodynamic cycle. |
||
| The same :class:`.ChemicalSystem` can be reused across multiple thermodynamic states | ||
| depending on the protocol. For details of which end states to construct, consult the | ||
| :ref:`pages for each specific Protocol <userguide_protocols>`. | ||
|
|
||
| As an example, we can construct the classic relative binding free energy cycle by defining four components: two ligands, | ||
| a protein, and a solvent: | ||
| Hybrid topology RBFE example | ||
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
|
||
| As an example, the relative binding free energy cycle requires four | ||
| :class:`.ChemicalSystem`\s — one for each node in the cycle: | ||
|
|
||
| .. figure:: ../protocols/img/rbfe_thermocycle.png | ||
| :scale: 40% | ||
|
|
@@ -75,12 +221,27 @@ a protein, and a solvent: | |
| ligand_B_complex = openfe.ChemicalSystem(components={'ligand': ligand_B, 'protein': protein, 'solvent': solvent}) | ||
| # ligand_A + solvent | ||
| ligand_A_solvent = openfe.ChemicalSystem(components={'ligand': ligand_A, 'solvent': solvent}) | ||
| # ligand_A + solvent | ||
| # ligand_B + solvent | ||
| ligand_B_solvent = openfe.ChemicalSystem(components={'ligand': ligand_B, 'solvent': solvent}) | ||
|
|
||
| Explicitly solvated variant | ||
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
|
||
| When using a :class:`.SolvatedPDBComponent` or :class:`.ProteinMembraneComponent`, replace :class:`.ProteinComponent` | ||
| and :class:`.SolventComponent` for the complex leg. No separate :class:`.SolventComponent` | ||
| is required: | ||
|
|
||
| :: | ||
|
|
||
| # explicitly solvated protein-membrane complex (box vectors read from CRYST1 record) | ||
| protein_membrane = openfe.ProteinMembraneComponent.from_pdb_file('./protein_membrane.pdb') | ||
|
|
||
| # ligand_A + explicitly solvated protein-membrane — no SolventComponent needed | ||
| ligand_A_complex = openfe.ChemicalSystem(components={'ligand': ligand_A, 'protein_membrane': protein_membrane}) | ||
|
|
||
|
|
||
| See Also | ||
| -------- | ||
|
|
||
| * To see how to construct a :class:`.ChemicalSystem` \s from your files, see :ref:`the cookbook entry on loading molecules <Loading Molecules>` | ||
| * For details of what thermodynamic cycles to construct, consult the :ref:`pages for each specific Protocol <userguide_protocols>` | ||
| * To see how to construct a :class:`.ChemicalSystem` from your files, see :ref:`the cookbook entry on loading molecules <Loading Molecules>` | ||
| * For details of which thermodynamic cycles to construct, consult the :ref:`pages for each specific Protocol <userguide_protocols>` | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| **Added:** | ||
|
|
||
| * <news item> | ||
|
|
||
| **Changed:** | ||
|
|
||
| * Updated the chemical systems user guide and the defining protocols user guide to reflect recent protocol updates, including adding membrane support. | ||
|
|
||
| **Deprecated:** | ||
|
|
||
| * <news item> | ||
|
|
||
| **Removed:** | ||
|
|
||
| * <news item> | ||
|
|
||
| **Fixed:** | ||
|
|
||
| * <news item> | ||
|
|
||
| **Security:** | ||
|
|
||
| * <news item> |
Uh oh!
There was an error while loading. Please reload this page.