Skip to content

Commit

Permalink
Update tutorial with more details on running. (#68)
Browse files Browse the repository at this point in the history
* Update tutorial with more details on running.

1. CLI tutorial details to run a single leg, along with lots of
   discussion of "this bash loop is just setting up independent
   directories; it doesn't matter how you do it, just please don't
   overwrite files from previous runs."
2. Python tutorial now points to CLI tutorial for how to run things.

* More clarifications:

1. Python tutorial is just a subset of CLI. Make this clear at top of
   Python tutorial.
2. Explain filenames in detail is CLI tutorial.
3. Add access to score in Python tutorial.

* rhfe => rbfe

* Apply suggestions from code review

Co-authored-by: Irfan Alibay <[email protected]>

---------

Co-authored-by: Irfan Alibay <[email protected]>
  • Loading branch information
dwhswenson and IAlibay authored May 31, 2023
1 parent 2781bcf commit c618f87
Show file tree
Hide file tree
Showing 2 changed files with 97 additions and 22 deletions.
36 changes: 33 additions & 3 deletions rbfe_tutorial/cli_tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,14 @@ better view of the structure, and if you click on the edge, you will see the
mapping for that edge.

The files that describe each individual simulation we will run are located in the
`transformations` subdirectory. Each JSON file represents a single alchemical leg to run,
and contains all the necessary information to run that leg.
`transformations` subdirectory. Each JSON file represents a single alchemical
leg to run, and contains all the necessary information to run that leg. A
single RBFE between a pair of ligands requires running two legs of an alchemical cycle (JSON files):
one for the ligand in solvent, and one for the ligand complexed with the
protein. The results from these two simulations can then be combined to obtained a single $\Delta\Delta G$ relative binding free energy value. Filenames indicate ligand names as taken from the SDF; for example,
the file `easy_rbfe_lig_ejm_31_complex_lig_ejm_42_complex.json` is the leg
associated with the tranformation of the ligand `lig_ejm_31` into `lig_ejm_42`
while in complex with the protein.

Note that this specific setup makes a number of choices for you. All of
these choices can be customized in the Python API. Here are the specifics on
Expand All @@ -100,7 +106,26 @@ how these simulation are set up:

For this tutorial, we have precalculated data that you can load, since
running the simulations can take a long time. However, you could, in principle,
run each simulation on your local machine with something like:
run each simulation on your local machine.

You can run each leg individually by using the `openfe quickrun` command. It
takes a transformation JSON as input, and the flags `-o` to give the final
output JSON file and `-d` for the directory where simulation results should be
stored. For example,

```bash
openfe quickrun path/to/transformation.json -o results.json -d working-directory
```

where `path/to/transformation.json` is the path to one of the files created above.

When running a complete network of simulations, it is important to ensure that
the file name for the result JSON and name of the working directory are
different for each leg, otherwise you'll overwrite results. We recommend doing
that with something like the following, which uses the fact that the JSON files
in `network_setup/transformations/` have unique names, and creates directories
and result JSON files based on those names. To run all legs sequentially (not
recommended) you could do something like:

```bash
# this will take a very long time! don't actually do it!
Expand Down Expand Up @@ -130,6 +155,11 @@ for file in setup/transformations/*.json; do
done
```

Note that the exact structure of the results directory is not important, as
long as all result JSON files are contained within a single directory tree. The
approach listed here is what was used for the example results that we'll
download in the next section.

## Gathering the results

To get example data, use the following commands:
Expand Down
Loading

0 comments on commit c618f87

Please sign in to comment.