- Notifications
You must be signed in to change notification settings - Fork 7
Adds ATM tutorial, along with livecomms update #30
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
Conversation
Adds notebook running through a full ATM run of tyk2 31<->43, includes pre-run results and an equilibrated system
Also moves ATM notebook into the 04_fep folder.
Also fixes spelling errors
| "ligand_bound = BSS.IO.readMolecules([f\"{url}/ejm_31.prm7\", f\"{url}/ejm_31.rst7\"])[0]\n", | ||
| "ligand_free = BSS.IO.readMolecules([f\"{url}/ejm_43.prm7\", f\"{url}/ejm_43.rst7\"])[0]" |
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.
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.
This is fixed now, the files were missing from the website
04_fep/05_ATM/01-ATM.ipynb Outdated
| "# We also need to download the example output files\n", | ||
| "from get_tutorial import download\n", | ||
| "\n", | ||
| "download(\"05\")" |
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.
could be download("01") for simplicity (with an update in get_tutorial.py)
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.
Now changed to "01" along with updated get_tutorial.py
04_fep/05_ATM/01-ATM.ipynb Outdated
| "id": "56b04fa5-aa1e-4032-9ca6-e79a21240845", | ||
| "metadata": {}, | ||
| "source": [ | ||
| "This protocol can then be run using the BioSimSpace openMM runner." |
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.
update the comment to mention that this may take a few minutes to complete.
do we need to run by default for this tutorial with the default choice of step=10000?
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.
Testing minimisation and it seems that ~200 steps is the minimum to give a system that is stable going forward. Added a comment to say it may take a few minutes.
| "id": "31954b81-0307-42d3-8c4c-489a62be74c1", | ||
| "metadata": {}, | ||
| "source": [ | ||
| "We will now run our first equilibration, including all of the forces we used in the minimisation. " |
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.
test if it is possible to reduce runtime for the tutorial to ~ 10 ps. If so explicitly mention in the comment cell that the values used here are lower than what would be used in a production setting to allow (near) interactive use of the notebook
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've done some testing both locally and on the server and it seems that this system is a lot more forgiving than some of the others I've tested, so we can get away with running for only ~1ps during each equilibration step. The issue is that the system is quite large, so even with these small runtimes the total minimisation/equilibration pipeline takes around 10 minutes.
I had originally designed the notebook to have all of the code that actually runs the simulation commented out, but somewhere along the line I must've uncommented them for testing and forgotten about it. This is why the notebook loads a pre-prepared system at the end of the pipeline, since it wasn't actually meant to run any simulations.
I can't guarantee that production simulations run with the output of such a short min/eq pipeline will be stable, so i think the ready_for_production.bss file will still be useful as this is from a fully prepared system that has been equilibrated for a total of 700 ps.
I'll reduce the runtimes in the notebook and add a note at the end that clarifies that, in a real production pipeline, users would need to run much longer minimisations and equilibrations in order to ensure stability.
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.
The comment cell between equilibration and annealing is now longer in sync with the code
In this case we will use 10 annealing cycles with a total runtime of 100ps, meaning that the value of lambda is increased by a value of 0.05 every 10ps.
-->
In this case we will use 10 annealing cycles with a total runtime of 1ps, meaning that the value of lambda is increased by a value of 0.05 every 0.1ps. For production runs we recommend extending the runtime to at least 100 ps.
04_fep/05_ATM/01-ATM.ipynb Outdated
| "\n", | ||
| "We now need to introduce the ATMForce to the system; this introduction needs to be gradual, otherwise our simulations will crash.\n", | ||
| "\n", | ||
| "This gradual introduction can be done by annealing the system to a lambda value of 0.5. Starting from lambda=0, the annealing protocol simulates a series of windows in which the value of lambda is gradually increased. In this case we will use 10 annealing cycles with a total runtime of 100ps, meaning that the value of lambda is increased by a value of 0.05 every 10ps." |
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.
same comment as for equilibration (attempt to run with a shorter runtime for the purpose of the demo)
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.
Now cut to 1ps
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.
Update the comment cell to add
For production runs we recommend extending the runtime to at least 100 ps.
04_fep/05_ATM/01-ATM.ipynb Outdated
| " runtime=\"100ps\",\n", | ||
| " anneal_numcycles=10,\n", | ||
| ")\n", | ||
| "annealing_process = BSS.Process.OpenMM(equilibrated, annealing, platform=\"CUDA\")\n", |
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.
this assumes the code is executed on an instance with an available CUDA plaftorm. Update for the general case where the platform should be auto-detected
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.
All instances of "CUDA" have now been removed
04_fep/05_ATM/01-ATM.ipynb Outdated
| " runtime=\"100ps\",\n", | ||
| ")\n", | ||
| "post_anneal_equilibration_process = BSS.Process.OpenMM(\n", | ||
| " annealed, post_anneal_equilibration, platform=\"CUDA\"\n", |
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.
same comments as above
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.
cut to 1ps
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.
remind users to use 100 ps if they want to adapt the demo for actual production :-)
04_fep/05_ATM/01-ATM.ipynb Outdated
| " use_atm_force=True,\n", | ||
| " lambda1=0.5,\n", | ||
| " lambda2=0.5,\n", | ||
| " runtime=\"100ps\",\n", |
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.
test shorter run time
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.
cut to 1ps
04_fep/05_ATM/get_tutorial.py Outdated
| import BioSimSpace as BSS | ||
| | ||
| links = { | ||
| "05": ( |
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.
change to "01" ?
04_fep/05_ATM/01-ATM.ipynb Outdated
| "metadata": {}, | ||
| "outputs": [], | ||
| "source": [ | ||
| "check = BSS.Stream.load(\"tyk2_atm/ready_for_production.bss\")\n", |
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.
load a bss file saved after the post_anneal_equilibration stage ? show how to load a precomputed one if this is not available. This will allow users running the above cells to compare their post annealed inputs with those provided with the tutorial.
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.
This file is now used as a comparison for the output of the min/eq pipeline.
I could also be useful as a backup - the pipeline might not be stable, so this system can be used in the production step instead if things crash.
…tocols, allowing them to be run using minimal resources.
…mment telling the user that minimisation may take a few minutes
jmichel80 left a comment
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 suggest a few minor edits to the comment cells to remind readers throughout that the 1 ps runtime values should be updated to 100 ps if trying to adapt the demo for production
| i'm done with the review. @lohedges do you have further comments ? if not I think we can merge. The only outstanding task is to update the container . |
| I'll have another read through before the social tomorrow and will update with any comments. |
Also clarify comment at the start of min/eq pipeline to ensure users understand that production simulations should be equilibrated for a much larger amount of time
| I've fixed the annealing description and added some text to the top of the minimisation/equilibration pipeline to clarify that the runtimes used are not appropriate for real production simulations. |
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.
Can this be named with an underscore rather than a hyphen for consistency with the other notebooks.
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.
Typo in the notebook:
... BioSimSpace openMM runner.
Should be:
... BioSimSpace OpenMM process.
LIVECOMS/04_fep/livecoms.tex Outdated
| | ||
| \subsection{Alchemical Transfer} | ||
| | ||
| The seventh notebook \href{https://github.com/OpenBioSim/biosimspace_tutorials/blob/main/04_fep/05_ATM/01-ATM.ipynb}{01-ATM} describes how to setup and run an RBFE calculation using the Alchemical Transfer Method (ATM) \cite{WU2021}. The specific example in this case is TYK2 31-43, taken from the benchmark set of Wang et al. \cite{Wang2015} |
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.
Replace hyphen with underscore here too.
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.
Also a typo, sytems instead of systems.
| Thanks, @mb2055, this is great. |
Also fix a few spelling and text errors
| Should all be fixed now @lohedges |

Updates the tutorials with 04_fep/05_ATM, a tutorial for running alchemical transfer on TYK2 31<->43.
Also updates the livecomms tex file with a brief description of ATM, along with a rundown of what the tutorial covers.
Before any merging can be done, the PR needs to be squashed by @lohedges .