BioSimSpace icon indicating copy to clipboard operation
BioSimSpace copied to clipboard

[TUTORIAL] FEP with perturbation network

Open lohedges opened this issue 4 years ago • 13 comments

This is a thread to discuss the creation of a tutorial showing how to implement free-energy perturbation using a network, e.g. generated by LOMAP, within BioSimSpace.

lohedges avatar Mar 02 '21 16:03 lohedges

Linking this thread with my working repo.

JenkeScheen avatar Mar 02 '21 17:03 JenkeScheen

I have done some work around this a while ago. Do you intend to submit this for a live comms tutorial paper as well as a general use tutorial? I can dig out the stuff I have done for this already if helpful.

ppxasjsm avatar Mar 02 '21 18:03 ppxasjsm

Hi @ppxasjsm yes it would be great if you can help. It would be good to update https://github.com/michellab/freenrgworkflows . I would like to implement an alternative free energy estimation method that avoids the reference compound dependency on final relative free energies. I'm thinking to adopt the Weighted least squares approach used by Mark at Cresset.

jmichel80 avatar Mar 03 '21 08:03 jmichel80

Hi @ppxasjsm if you've done any work on LOMAP network generation to show within a notebook that would be very helpful! It's starting to look like the LOMAP build I currently have is unable to draw a decent-looking network to show in an ipynb.

see https://github.com/michellab/bss_fep_advanced_tut_bg/blob/main/fep_workflow_ros1.ipynb for the default graph (uses pygraphviz)

JenkeScheen avatar Mar 03 '21 11:03 JenkeScheen

Yes happy to help with this! It’s been on my would like to do list for ages!

ppxasjsm avatar Mar 03 '21 11:03 ppxasjsm

I'm just going to build a networkx function that takes the edges text file written by LOMAP and creates a simple neato graph while loading molecule images and LOMAP scores to display on edges.. @ppxasjsm if you have code that does something similar I'd be happy to work from there

JenkeScheen avatar Mar 03 '21 11:03 JenkeScheen

That is a one liner in networkx though right?

ppxasjsm avatar Mar 03 '21 11:03 ppxasjsm

the graph generation yes, getting to the line requires some more work (rdkit to load molecules, draw images correctly + save, etc)

JenkeScheen avatar Mar 03 '21 11:03 JenkeScheen

Adding current diagram summarising use case (for binding)

fep_01-white

And for hydration

fep_02-white

jmichel80 avatar Mar 03 '21 21:03 jmichel80

update: I've now pushed a working notebook that runs LOMAP on a set of ligands, then uses networkx to plot LOMAP's output and finally uses BSS to setup SOMD folders according to the transformations that LOMAP suggests. Note that the network plotting function still needs some condensation + tests!

It was a bit painful to get LOMAP and networkx to work mostly because of versioning. Feel free to use the env.yml to spare yourself to trouble if you're trying to reproduce the outputs. The LOMAP scripts can be found in ./lomap/and will need to be used in the tutorial environment because it contains a few hacks in graphgen.py. lomap_networkgen.py is run as bash command in the notebook.

Next would be using freenrgworkflows to get dGbind barplots with an optinal weighted least squares method. @jmichel80 @lohedges would this implementation be useful to have before our next meeting, or do we have enough to discuss for the time being?

JenkeScheen avatar Mar 04 '21 12:03 JenkeScheen

Hi @JenkeScheen great progress ! For the FEP analysis stage can you put together a notebook using current functionality in freenrgworkflows ? We will revisit later the exact approach used to estimate free energies once the code is in place.

jmichel80 avatar Mar 04 '21 22:03 jmichel80

I have now added a draft slurm submission script (of course the BSS functionality of loading a SOMD environment still has to be added for this) the main setup notebook as well as the command to run freenrgworkflows on the output. I decided to adjust the freenrgworkflows-generated notebook a bit so that the user has a bit more freedom in the plotting which in the end is just basic python.

At some point we'll have to decide on how we want to do make the analysis notebook connect to simulation outputs (i.e. could do the ipynb generator that @ppxasjsm has used, or could just work with a template notebook where users adjust paths)

JenkeScheen avatar Mar 08 '21 14:03 JenkeScheen

note that this workflow doesn't have .Solvation() steps yet but that should be easy to implement at a later stage; the only bottleneck there is deciding on how we can make vacuum jobs run on CPU (if that is something we want)

JenkeScheen avatar Mar 08 '21 14:03 JenkeScheen