Repository navigation
Re-structure the cookbooks #2319
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
d7941fa
151eff1
23d38a1
83ab2bd
8bf26b2
f2ca03d
e9df9e0
d8112e6
b84e3f1
11c9624
9bae955
b063c34
4872a93
6c31121
01112ce
bf11b63
41f4811
71d7aca
063ec0d
b3eff3d
927df69
cab30f7
6a04376
eb91570
1a0904e
2d08cb1
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,168 +1,77 @@ | ||||
| .. _cookbooks: | ||||
|
|
||||
| Cookbook | ||||
| ======== | ||||
| How-To Guides | ||||
| ============= | ||||
|
|
||||
| This section describes common tasks involving the OpenFE Python API. | ||||
| These guides show how to carry out specific tasks with **openfe**, mostly using the Python API. | ||||
| For the concepts behind each step, see the :doc:`User Guide </guide/index>`. | ||||
| To run a transformation with ``openfe quickrun``, see :ref:`userguide_quickrun`. | ||||
|
|
||||
| The :any:`OpenFE CLI<cli-reference>` provides a simple way to perform the most common procedures for free energy calculations, but does not provide much flexibility for fine-tuning your approach or combining OpenFE with other tools. The :any:`Python API<api>` allows that flexibility, but using it is more complex. This cookbook breaks down common steps that would be implemented in Python to help navigate that complexity. | ||||
|
|
||||
| .. note:: This section is a work-in-progress. | ||||
| .. TODO: remove the quickrun sentence above once moved to "Running calculations" | ||||
|
|
||||
| .. module:: openfe | ||||
| :noindex: | ||||
|
|
||||
| The Basic Workflow | ||||
| ------------------ | ||||
|
|
||||
| The typical way to use the Python API is to load a number of molecules you want to calculate free energies of, construct a :class:`LigandNetwork` connecting them in an efficient way, and then combine that with information for how each ligand should be simulated to construct an :class:`AlchemicalNetwork`, which specifies the entire simulation campaign. This provides a lot of flexibility in how molecules are specified, mapped, connected, and simulated, without exposing a great deal of complexity. OpenFE recommends this workflow for most users. | ||||
|
|
||||
| .. container:: deflist-flowchart | ||||
|
|
||||
| * Setup | ||||
| - .. container:: flowchart-sidebyside | ||||
|
|
||||
| - - | ||||
| .. rst-class:: flowchart-spacer | ||||
| - | ||||
|
|
||||
| .. rst-class:: arrow-down arrow-from-nothing | ||||
| - :any:`choose_protocol` | ||||
|
|
||||
| - :class:`Protocol` | ||||
| Simulation procedure for an alchemic mutation. | ||||
|
|
||||
| .. rst-class:: arrow-down arrow-tail arrow-combine-right | ||||
| - | ||||
|
|
||||
| - - | ||||
| .. rst-class:: width-8 | ||||
| - Chemical component definition | ||||
| SDF, PDB, RDKit, OpenFF Molecule, solvent spec, etc. | ||||
|
|
||||
| - .. container:: flowchart-sidebyside | ||||
|
|
||||
| - .. rst-class:: width-3 | ||||
|
|
||||
| - | ||||
|
|
||||
| .. rst-class:: arrow-down arrow-multiple | ||||
| - :any:`Loading proteins`, :any:`Defining solvents` | ||||
|
|
||||
| - :class:`SolventComponent` and :class:`ProteinComponent` | ||||
| Other chemical components needed to simulate the ligand. | ||||
|
|
||||
| .. rst-class:: arrow-down arrow-multiple arrow-tail arrow-combine | ||||
| - | ||||
|
|
||||
| - - .. container:: flowchart-sidebyside | ||||
|
|
||||
| - .. rst-class:: width-5 | ||||
|
|
||||
| - | ||||
| .. rst-class:: arrow-down arrow-multiple | ||||
| - :any:`Loading small molecules` | ||||
|
|
||||
|
|
||||
| - :class:`SmallMoleculeComponent` | ||||
| The ligands that will be mutated. | ||||
|
|
||||
| - .. rst-class:: width-3 | ||||
|
|
||||
| - | ||||
| .. rst-class:: flowchart-spacer | ||||
| - | ||||
|
|
||||
| - Orion/FEP+ | ||||
| Network from another tool. | ||||
|
|
||||
|
|
||||
| - .. container:: flowchart-sidebyside | ||||
|
|
||||
| - .. rst-class:: width-2 | ||||
|
|
||||
| - | ||||
| .. rst-class:: arrow-down arrow-multiple | ||||
| - :any:`generate_ligand_network` | ||||
|
|
||||
| - .. rst-class:: width-2 | ||||
|
|
||||
| - | ||||
| .. rst-class:: arrow-down arrow-multiple | ||||
| - :any:`hand_write_ligand_network` | ||||
|
|
||||
| - .. rst-class:: width-1 | ||||
|
|
||||
| - | ||||
| .. rst-class:: arrow-down arrow-tail arrow-multiple arrow-combine-right | ||||
| - | ||||
|
|
||||
| .. rst-class:: flowchart-spacer | ||||
| - | ||||
| .. toctree:: | ||||
| :maxdepth: 1 | ||||
| :caption: Setting up chemical systems | ||||
|
|
||||
| - .. rst-class:: width-3 | ||||
| loading_molecules | ||||
| user_charges | ||||
| bespoke_parameters | ||||
|
Collaborator
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. It is pulling the recap heading out of the bespokefit guide and making it an entry here, can we stop it here or do we need to use a smaller heading in that guide?
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 think we have to do that in the ExampleNotebooks repo. Maybe in a separate PR there we can also update some of the titles of the cookbooks since some of these are not great.
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. @jthorton I updated the titles here: OpenFreeEnergy/ExampleNotebooks#351
Collaborator
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. Can we build the docs against it here by changing Line 198 in c9eeacd
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. Targeting the rename branch for now. |
||||
| packmol_memgen_setup | ||||
|
|
||||
| - | ||||
| .. rst-class:: arrow-down arrow-tail arrow-combine-left | ||||
| - | ||||
| .. TODO: merge cofactors_rbfe into loading_molecules, | ||||
| "Create a ChemicalSystem", "Specify custom force fields", OpenFold3 notebooks. | ||||
|
|
||||
| .. rst-class:: arrow-down arrow-head flowchart-spacer | ||||
| - :any:`network_from_orion_fepp` | ||||
| .. toctree:: | ||||
| :maxdepth: 1 | ||||
| :caption: Planning: Ligand networks | ||||
|
|
||||
| - :class:`LigandNetwork <openfe.setup.LigandNetwork>` | ||||
| A network of ligand transformations. | ||||
| generate_ligand_network | ||||
| hand_write_ligand_network | ||||
| network_from_orion_fepp | ||||
| ligandnetwork_vis | ||||
|
|
||||
| - .. container:: flowchart-sidebyside | ||||
| .. TODO: add howto on scorers | ||||
|
|
||||
| - - | ||||
| .. rst-class:: arrow-down arrow-tail arrow-combine-left width-4 | ||||
| - | ||||
| .. toctree:: | ||||
| :maxdepth: 1 | ||||
| :caption: Planning: Protocols and alchemical networks | ||||
|
|
||||
| - - | ||||
| .. rst-class:: arrow-cycle width-4 | ||||
| - | ||||
| choose_protocol | ||||
| rfe_alchemical_planners | ||||
| create_alchemical_network | ||||
|
|
||||
| - :any:`ligandnetwork_vis` | ||||
| .. TODO: add "Customize CLI planning with YAML" (from guide/cli/cli_yaml) and move the | ||||
| how-to parts of guide/setup/defining_protocols into choose_protocol. | ||||
|
|
||||
| .. toctree:: | ||||
| :maxdepth: 1 | ||||
| :caption: Running calculations | ||||
|
|
||||
| .. rst-class:: arrow-down arrow-head | ||||
| - :any:`create_alchemical_network` | ||||
| dumping_transformation | ||||
|
|
||||
| - :class:`AlchemicalNetwork` | ||||
| A complete simulation campaign. | ||||
| .. TODO: add: run a transformation with quickrun, | ||||
| run repeats in parallel, run on a SLURM cluster, resume interrupted calculations and | ||||
| share a GPU using NVIDIA MPS (from guide/execution/quickrun_execution), and task-based | ||||
| execution. | ||||
|
|
||||
| .. rst-class:: arrow-down | ||||
| * :any:`dumping_transformations` | ||||
| .. toctree:: | ||||
| :maxdepth: 1 | ||||
| :caption: Working with results | ||||
|
|
||||
| * Run | ||||
| - :any:`openfe quickrun <cli_quickrun>` | ||||
| OpenFE recommends using the ``openfe quickrun`` CLI command to execute a transformation. | ||||
| jq_inspection | ||||
|
|
||||
| .. rst-class:: arrow-down | ||||
| * | ||||
| .. TODO: add "Gather free energy results" and "Load results in Python" (from | ||||
| guide/results/working_with_results), "Analyze an RBFE network with cinnabar" (from | ||||
| guide/results/working_with_networks) and "Visualize trajectories with openfe_analysis". | ||||
| .. TODO: merge dumping_transformation and jq_inspection into a single | ||||
| "Save and inspect OpenFE JSON files" how-to. | ||||
|
|
||||
| * Gather | ||||
| - :any:`openfe gather <cli_gather>` | ||||
| OpenFE recommends using the ``openfe gather`` CLI command to collect the results of a transformation. | ||||
| .. toctree:: | ||||
| :maxdepth: 1 | ||||
| :caption: Repairing and extending networks | ||||
|
|
||||
| List of Cookbooks | ||||
| ----------------- | ||||
| repairing_broken_networks | ||||
|
|
||||
| .. toctree:: | ||||
| :maxdepth: 1 | ||||
|
|
||||
| loading_molecules | ||||
| dumping_transformation | ||||
| jq_inspection | ||||
| choose_protocol | ||||
| generate_ligand_network | ||||
| rfe_alchemical_planners | ||||
| network_from_orion_fepp | ||||
| hand_write_ligand_network | ||||
| ligandnetwork_vis | ||||
| create_alchemical_network | ||||
| user_charges | ||||
| bespoke_parameters | ||||
| repairing_broken_networks | ||||
|
|
||||
|
|
||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| { | ||
| "path": "../ExampleNotebooks/membranes/packmol_memgen_setup.ipynb" | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I moved this to the introduction to the user guide instead, though the same chart is also in the under the hood, which we can revisit when we re-organize the user guide maybe?