alchemlyb icon indicating copy to clipboard operation
alchemlyb copied to clipboard

Analysing DV DL integration from AMBER18 TI calculations

Open DDGmichigan opened this issue 5 years ago • 8 comments

Hi alchemists, I did install the alchemical-analysis using the steps defined. I have run some TI calculations for estimating absolute free energies of binding. I was told that the numerical integration has to be done by the user and AMBER does not provide scripts. Is there a documentation of how I can use alchemical_analysis.py to estimate the free energy of binding?

DDGmichigan avatar Dec 16 '19 20:12 DDGmichigan

@DDGmichigan if the question is about using alchemical_analysis.py then you should ask at https://github.com/MobleyLab/alchemical-analysis – this repo is for the alchemlyb library (which is being used to replace alchemical_analysis.py.

You can use alchemlyb to analyze AMBER TI data. I am not 100% sure if we tested AMBER18 but you could give it a try. The documentation of alchemlyb is still pretty bare but there are AMBER parsers. Something along the lines of (based on https://alchemlyb.readthedocs.io/en/latest/estimators-ti.html and the test_ti_estimators.py test): Assuming you have a list of filenames with your FEP data in AMBER format in FILENAME_LIST then something like the following might work (untested...):

import pandas as pd
from alchemlyb.parsing import amber
from alchemlyb.estimators import TI

# extract data
dHdl = pd.concat([amber.extract_dHdl(filename, T=300) for filename in FILENAME_LIST)]

# preprocess here if necessary (e.g., decorrelate)
# ... skipped for simplicity but NECESSARY for meaningful error estimates ...

# run TI
ti_estimator = TI()
ti_estimator.fit(dHdl)

# get output
delta_f = ti_estimator.delta_f_.iloc[0, -1]
d_delta_f = ti_estimator.d_delta_f_.iloc[0, -1]

print("Free energy difference (TI)", delta_f, "kT")
print("Free energy difference (TI) error", d_delta_f, "kT")

(Note that the error estimate is incorrect if you do not decorrelate your data with something like alchemlyb.preprocessing.subsampling.statistical_inefficiency.)

@dotsdl or @shuail might be able to say more here.

In any case, we need a few simple "howto" examples in the docs.

orbeckst avatar Jan 17 '20 16:01 orbeckst

I agree. There are no examples provided on how to go about performing TI analysis on my data generated. Please help!

DDGmichigan avatar Feb 10 '20 20:02 DDGmichigan

We would like to have all the tutorials and the helpful examples that you would like to have, too. However, at the moment, we have no-one to actually do the work. This is an opportunity for everyone else to come and help out and contribute.

As I said above, we tested some Amber input files but as I am not an Amber expert, so I don't know if this will work for you. Did you try what I suggested above (which was based on our tests)? Feedback is welcome.

orbeckst avatar Feb 11 '20 00:02 orbeckst

Hello alchemlyb developers, Thanks I am trying to do an absolute free energy calc of a small molecule binding to a src-kinase protein, My small molecule is acetonitrile. I have run all the steps in pmemd.cuida (AMBER 18) and have 2 separate folders C3N in protein and C3N in water, as i need to do a disappear my C3N from the protein pocket and disappear my C3N molecule in water. now in alchemical analysis there is a sample folder and underneath that is a AMBER folder "data". it has 10 lambda folders 0.1, 0.2, 0.3 so on till 1.0, each of the folder has 2 output files by the name ti002.out ti003.out, can you explain why? Thanks Regards Debarati

DDGmichigan avatar Feb 12 '20 14:02 DDGmichigan

I don't know the details of your setup. I would first see if alchemlyb can parse your files

from alchemlyb.parsing import amber
df = amber.extract_dHdl("data/0.1/ti002.out", T=300)
print(df)

If this looks sensible then you need to load all the lambda windows that belong to the same run (see above), combine them with pandas.concat() (see above) and run the TI estimator (see above).

orbeckst avatar Feb 12 '20 16:02 orbeckst

I m not a very experienced python programmer, so would I have to write a python script to implement what you suggested? Thanks

Sent from Mailhttps://go.microsoft.com/fwlink/?LinkId=550986 for Windows 10

From: Oliver Becksteinmailto:[email protected] Sent: Wednesday, February 12, 2020 11:33 AM To: alchemistry/alchemlybmailto:[email protected] Cc: DDGmichiganmailto:[email protected]; Mentionmailto:[email protected] Subject: Re: [alchemistry/alchemlyb] Analysing DV DL integration from AMBER18 TI calculations (#92)

I don't know the details of your setup. I would first see if alchemlyb can parse your files

from alchemlyb.parsing import amber

df = amber.extract_dHdl("data/0.1/ti002.out", T=300)

print(df)

If this looks sensible then you need to load all the lambda windows that belong to the same run (see above), combine them with pandas.concat() (see above) and run the TI estimator (see above).

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/alchemistry/alchemlyb/issues/92?email_source=notifications&email_token=ALP3CANA6EKHXWZMCPMQHG3RCQQFFA5CNFSM4J3QM7V2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOELRN5YA#issuecomment-585293536, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ALP3CAKDNMC55FEBPGSPOGDRCQQFFANCNFSM4J3QM7VQ.

DDGmichigan avatar Feb 12 '20 18:02 DDGmichigan

Yes, you'll have to write Python code.

orbeckst avatar Feb 12 '20 21:02 orbeckst

@orbeckst Thanks a lot for your suggestions! It worked for me, I got a consistent result estimated by other script (TI). My simulation is run by pmemd.cuda of Amber 20. I will also try to figure it out how to do the MBAR estimation.

qinghualiao avatar Oct 20 '21 22:10 qinghualiao

The new ABFE workflow gives a easy to use script of performing all the aforementioned analysis https://alchemlyb.readthedocs.io/en/latest/workflows/alchemlyb.workflows.ABFE.html

xiki-tempula avatar Nov 06 '22 19:11 xiki-tempula