Skip to content
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

Relative Free Energy of solvation #1120

Open
mathilfiker opened this issue Jan 2, 2025 · 14 comments
Open

Relative Free Energy of solvation #1120

mathilfiker opened this issue Jan 2, 2025 · 14 comments
Assignees

Comments

@mathilfiker
Copy link

Dear developers,

Thank you for your work and your dedication.
I'm trying to calculate the relative free energy of solvation of two molecules. They are the same molecules but with different sets of charges. I tried following your RBFE tutorial but neglected the protein. The transformation is correctly created and the calculations run, but the RFE results to be zero. Do you have any suggestions on how to tackle this problem?

Best wishes,
Mathias

@IAlibay
Copy link
Member

IAlibay commented Jan 6, 2025

Hi @mathilfiker,

Could you provide more details about how you did your rhfe calculation?

I.e. did you calculate both a vacuum and solvent leg? What were your components for the end states of each calculation?

@mathilfiker
Copy link
Author

mathilfiker commented Jan 7, 2025

Hello @IAlibay ,
As a first attempt, I followed the tutorial. Specifically, calling LigandA the molecule with the set of charges A, and LigandB the molecule with set of charges B, I did:

ligands = [ligandA,ligandB]
ligand_network = network_planner(
    ligands=ligands,
    mappers=[mapper],
    scorer=scorer
)
mapping = next(iter(ligand_network.edges))
solvent = openfe.SolventComponent()
systemA = openfe.ChemicalSystem({
    'ligand': mapping.componentA,
    'solvent': solvent
})
systemB = openfe.ChemicalSystem({
    'ligand': mapping.componentB,
    'solvent': solvent
})
protocol = RelativeHybridTopologyProtocol(settings)
transformation = openfe.Transformation(
    systemA,
    systemB,
    protocol,
    mapping={'ligand': mapping},
)
transformations = []
for mapping in ligand_network.edges:
    for leg in ['solvent']:#, 'complex']:
        sysA_dict = {'ligand': mapping.componentA,
                     'solvent': solvent}
        sysB_dict = {'ligand': mapping.componentB,
                     'solvent': solvent}
        # The following is copy and pasted from the tutorial, but since I commented 'complex' in the for loop it shouldn't be considered
        if leg == 'complex':
            sysA_dict['protein'] = protein
            sysB_dict['protein'] = protein
        sysA = openfe.ChemicalSystem(sysA_dict, name=f"{mapping.componentA.name}_{leg}")
        sysB = openfe.ChemicalSystem(sysB_dict, name=f"{mapping.componentB.name}_{leg}")

        prefix = "easy_rbfe_" 

        transformation = openfe.Transformation(
            stateA=sysA,
            stateB=sysB,
            mapping={'ligand': mapping},
            protocol=protocol,  # use protocol created above
            name=f"{prefix}{sysA.name}_{sysB.name}"
        )
        transformations.append(transformation)

network = openfe.AlchemicalNetwork(transformations)

Maybe there is something I didn't understand from the tutorial, so any input can be useful :).

Best,
Mathias

@IAlibay
Copy link
Member

IAlibay commented Jan 7, 2025

So there's two separate issues I can see here:

  1. The solvent transformation is giving a dG of 0 with different charges.
  2. The hydration free energy calculation is missing a vacuum leg.

Issue 1

This will need more information:

  • How are you feeding in the partial charges?
  • What version of openfe & gufe do you have installed?

Issue 2

In order to do a relative hydration free energy calculation, you will need a vacuum transformation.

This should be something like:

ligands = [ligandA,ligandB]
ligand_network = network_planner(
    ligands=ligands,
    mappers=[mapper],
    scorer=scorer
)

# Create your settings
solvent_settings = RelativeHybridTopologyProtocol.default_settings()
vacuum_settings = RelativeHybridTopologyProtocol.default_settings()
vacuum_settings.forcefield_settings.nonbonded_method = "nocutoff" 

# Create the Protocol objects
protocols = {
    'solvent': RelativeHybridTopologyProtocol(solvent_settings),
    'vacuum': RelativeHybridTopologyProtocol(vacuum_settings)
}

transformations = []
for mapping in ligand_network.edges:
    for leg in ['solvent', 'vacuum']:
        sysA_dict = {'ligand': mapping.componentA,}
        sysB_dict = {'ligand': mapping.componentB,}
        if leg == 'solvent':
            sysA_dict['solvent'] = solvent
            sysB_dict['solvent'] = solvent

        sysA = openfe.ChemicalSystem(sysA_dict, name=f"{mapping.componentA.name}_{leg}")
        sysB = openfe.ChemicalSystem(sysB_dict, name=f"{mapping.componentB.name}_{leg}")

        transformation = openfe.Transformation(
            stateA=sysA,
            stateB=sysB,
            mapping={'ligand': mapping},
            protocol=protocols[leg]
            name=f"{sysA.name}_{sysB.name}_{leg}"
        )
        transformations.append(transformation)

network = openfe.AlchemicalNetwork(transformations)

By calculating both the vacuum and solvent transformation, you can then take their difference to get the ddG of hydration.

@mathilfiker
Copy link
Author

Hello, I tried adding the vacuum leg to the simulation, but both the transformations return a dG of zero. The way I feed partial charges is the following:

chgsA = np.load('chargesA.npy')
sdf_file = 'path_to_file.sdf'
suppl = Chem.SDMolSupplier(sdf_file.removeHs=False)
off_molecule = Molecule.from_rdkit(suppl[0])
ureg = UnitRegistry()
off_molecule.partial_charges = Quantity(chgsA,unit.elementary_charge)
ligandA = openfe.SmallMoleculeComponent.from_openff(off_molecule)

This method proved successful when I computed ABHFEs.

@IAlibay
Copy link
Member

IAlibay commented Jan 8, 2025

This is rather odd - could you tell us what your python environment looks like @mathilfiker ? Something like mamba list or conda list

@mathilfiker
Copy link
Author

This is the list of all installed packages:

# packages in environment at openfe_env_2:
#
# Name                    Version                   Build  Channel
_libgcc_mutex             0.1                 conda_forge    conda-forge
_openmp_mutex             4.5                       2_gnu    conda-forge
adjusttext                1.3.0              pyhd8ed1ab_0    conda-forge
amberlite                 22.0                     pypi_0    pypi
ambertools                22.5            py310hd182041_0    conda-forge
amberutils                21.0                     pypi_0    pypi
annotated-types           0.7.0              pyhd8ed1ab_0    conda-forge
anyio                     4.6.2.post1        pyhd8ed1ab_0    conda-forge
argon2-cffi               23.1.0             pyhd8ed1ab_0    conda-forge
argon2-cffi-bindings      21.2.0          py310ha75aee5_5    conda-forge
arpack                    3.7.0                hdefa2d7_2    conda-forge
arrow                     1.3.0              pyhd8ed1ab_0    conda-forge
asttokens                 2.4.1              pyhd8ed1ab_0    conda-forge
async-lru                 2.0.4              pyhd8ed1ab_0    conda-forge
atk-1.0                   2.38.0               h04ea711_2    conda-forge
attrs                     24.2.0             pyh71513ae_0    conda-forge
babel                     2.16.0             pyhd8ed1ab_0    conda-forge
beautifulsoup4            4.12.3             pyha770c72_0    conda-forge
biopython                 1.84            py310hc51659f_0    conda-forge
bleach                    6.2.0              pyhd8ed1ab_0    conda-forge
blosc                     1.21.6               hef167b5_0    conda-forge
boost                     1.78.0          py310hcb52e73_5    conda-forge
boost-cpp                 1.78.0               h2c5509c_4    conda-forge
brotli                    1.1.0                hb9d3cd8_2    conda-forge
brotli-bin                1.1.0                hb9d3cd8_2    conda-forge
brotli-python             1.1.0           py310hf71b8c6_2    conda-forge
bson                      0.5.9                      py_0    conda-forge
bzip2                     1.0.8                h4bc722e_7    conda-forge
c-ares                    1.34.3               hb9d3cd8_1    conda-forge
c-blosc2                  2.15.2               h68e2383_0    conda-forge
ca-certificates           2024.8.30            hbcca054_0    conda-forge
cached-property           1.5.2                hd8ed1ab_1    conda-forge
cached_property           1.5.2              pyha770c72_1    conda-forge
cachetools                5.5.0              pyhd8ed1ab_0    conda-forge
cairo                     1.18.0               hbb29018_2    conda-forge
certifi                   2024.8.30          pyhd8ed1ab_0    conda-forge
cffi                      1.17.1          py310h8deb56e_0    conda-forge
cftime                    1.6.4           py310hf462985_1    conda-forge
chardet                   5.2.0           py310hff52083_2    conda-forge
charset-normalizer        3.4.0              pyhd8ed1ab_0    conda-forge
cinnabar                  0.4.1              pyhd8ed1ab_1    conda-forge
click                     8.1.7           unix_pyh707e725_0    conda-forge
colorama                  0.4.6              pyhd8ed1ab_0    conda-forge
comm                      0.2.2              pyhd8ed1ab_0    conda-forge
contourpy                 1.3.1           py310h3788b33_0    conda-forge
cudatoolkit               11.8.0              h4ba93d1_13    conda-forge
cycler                    0.12.1             pyhd8ed1ab_0    conda-forge
cython                    3.0.11          py310h5b1441d_3    conda-forge
debugpy                   1.8.9           py310hf71b8c6_0    conda-forge
decorator                 5.1.1              pyhd8ed1ab_0    conda-forge
defusedxml                0.7.1              pyhd8ed1ab_0    conda-forge
dill                      0.3.9              pyhd8ed1ab_0    conda-forge
entrypoints               0.4                pyhd8ed1ab_0    conda-forge
exceptiongroup            1.2.2              pyhd8ed1ab_0    conda-forge
executing                 2.1.0              pyhd8ed1ab_0    conda-forge
expat                     2.6.4                h5888daf_0    conda-forge
fftw                      3.3.10          nompi_hf1063bd_110    conda-forge
font-ttf-dejavu-sans-mono 2.37                 hab24e00_0    conda-forge
font-ttf-inconsolata      3.000                h77eed37_0    conda-forge
font-ttf-source-code-pro  2.038                h77eed37_0    conda-forge
font-ttf-ubuntu           0.83                 h77eed37_3    conda-forge
fontconfig                2.15.0               h7e30c49_1    conda-forge
fonts-conda-ecosystem     1                             0    conda-forge
fonts-conda-forge         1                             0    conda-forge
fonttools                 4.55.0          py310h89163eb_0    conda-forge
fqdn                      1.5.1              pyhd8ed1ab_0    conda-forge
freetype                  2.12.1               h267a509_2    conda-forge
freetype-py               2.3.0              pyhd8ed1ab_0    conda-forge
fribidi                   1.0.10               h36c2ea0_0    conda-forge
gdk-pixbuf                2.42.12              hb9ae30d_0    conda-forge
giflib                    5.2.2                hd590300_0    conda-forge
graphite2                 1.3.13            h59595ed_1003    conda-forge
graphviz                  12.0.0               hba01fac_0    conda-forge
greenlet                  3.1.1           py310hf71b8c6_0    conda-forge
griddataformats           1.0.2              pyhd8ed1ab_0    conda-forge
gsd                       3.4.2           py310ha75aee5_0    conda-forge
gtk2                      2.24.33              h6470451_5    conda-forge
gts                       0.7.6                h977cf35_4    conda-forge
gufe                      1.1.0              pyhd8ed1ab_1    conda-forge
h11                       0.14.0             pyhd8ed1ab_0    conda-forge
h2                        4.1.0              pyhd8ed1ab_0    conda-forge
harfbuzz                  9.0.0                hfac3d4d_0    conda-forge
hdf4                      4.2.15               h2a13503_7    conda-forge
hdf5                      1.14.4          nompi_h2d575fe_104    conda-forge
hpack                     4.0.0              pyh9f0ad1d_0    conda-forge
httpcore                  1.0.7              pyh29332c3_1    conda-forge
httpx                     0.28.0             pyhd8ed1ab_0    conda-forge
hyperframe                6.0.1              pyhd8ed1ab_0    conda-forge
icu                       73.2                 h59595ed_0    conda-forge
idna                      3.10               pyhd8ed1ab_0    conda-forge
importlib-metadata        8.5.0              pyha770c72_0    conda-forge
importlib_resources       6.4.5              pyhd8ed1ab_0    conda-forge
iniconfig                 2.0.0              pyhd8ed1ab_0    conda-forge
ipykernel                 6.29.5             pyh3099207_0    conda-forge
ipython                   8.30.0             pyh707e725_0    conda-forge
ipywidgets                8.1.5              pyhd8ed1ab_0    conda-forge
isoduration               20.11.0            pyhd8ed1ab_0    conda-forge
jedi                      0.19.2             pyhff2d567_0    conda-forge
jinja2                    3.1.4              pyhd8ed1ab_0    conda-forge
joblib                    1.4.2              pyhd8ed1ab_0    conda-forge
json5                     0.10.0             pyhd8ed1ab_0    conda-forge
jsonpointer               3.0.0           py310hff52083_1    conda-forge
jsonschema                4.23.0             pyhd8ed1ab_0    conda-forge
jsonschema-specifications 2024.10.1          pyhd8ed1ab_0    conda-forge
jsonschema-with-format-nongpl 4.23.0               hd8ed1ab_0    conda-forge
jupyter-lsp               2.2.5              pyhd8ed1ab_0    conda-forge
jupyter_client            8.6.3              pyhd8ed1ab_0    conda-forge
jupyter_core              5.7.2              pyh31011fe_1    conda-forge
jupyter_events            0.10.0             pyhd8ed1ab_0    conda-forge
jupyter_server            2.14.2             pyhd8ed1ab_0    conda-forge
jupyter_server_terminals  0.5.3              pyhd8ed1ab_0    conda-forge
jupyterlab                4.2.6              pyhff2d567_0    conda-forge
jupyterlab_pygments       0.3.0              pyhd8ed1ab_1    conda-forge
jupyterlab_server         2.27.3             pyhd8ed1ab_0    conda-forge
jupyterlab_widgets        3.0.13             pyhd8ed1ab_0    conda-forge
kartograf                 1.0.1              pyhd8ed1ab_0    conda-forge
keyutils                  1.6.1                h166bdaf_0    conda-forge
kiwisolver                1.4.7           py310h3788b33_0    conda-forge
krb5                      1.21.3               h659f571_0    conda-forge
lcms2                     2.16                 hb7c19ff_0    conda-forge
ld_impl_linux-64          2.43                 h712a8e2_2    conda-forge
lerc                      4.0.0                h27087fc_0    conda-forge
libaec                    1.1.3                h59595ed_0    conda-forge
libblas                   3.9.0           25_linux64_openblas    conda-forge
libbrotlicommon           1.1.0                hb9d3cd8_2    conda-forge
libbrotlidec              1.1.0                hb9d3cd8_2    conda-forge
libbrotlienc              1.1.0                hb9d3cd8_2    conda-forge
libcblas                  3.9.0           25_linux64_openblas    conda-forge
libcurl                   8.10.1               hbbe4b11_0    conda-forge
libdeflate                1.22                 hb9d3cd8_0    conda-forge
libedit                   3.1.20191231         he28a2e2_2    conda-forge
libev                     4.33                 hd590300_2    conda-forge
libexpat                  2.6.4                h5888daf_0    conda-forge
libffi                    3.4.2                h7f98852_5    conda-forge
libgcc                    14.2.0               h77fa898_1    conda-forge
libgcc-ng                 14.2.0               h69a702a_1    conda-forge
libgd                     2.3.3                h119a65a_9    conda-forge
libgfortran               14.2.0               h69a702a_1    conda-forge
libgfortran-ng            14.2.0               h69a702a_1    conda-forge
libgfortran5              14.2.0               hd5240d6_1    conda-forge
libglib                   2.82.2               h2ff4ddf_0    conda-forge
libgomp                   14.2.0               h77fa898_1    conda-forge
libiconv                  1.17                 hd590300_2    conda-forge
libjpeg-turbo             3.0.0                hd590300_1    conda-forge
liblapack                 3.9.0           25_linux64_openblas    conda-forge
libllvm14                 14.0.6               hcd5def8_4    conda-forge
libnetcdf                 4.9.2           nompi_h2564987_115    conda-forge
libnghttp2                1.64.0               h161d5f1_0    conda-forge
libnsl                    2.0.1                hd590300_0    conda-forge
libopenblas               0.3.28          pthreads_h94d23a6_1    conda-forge
libpng                    1.6.44               hadc24fc_0    conda-forge
librsvg                   2.58.4               hc0ffecb_0    conda-forge
libsodium                 1.0.20               h4ab18f5_0    conda-forge
libsqlite                 3.47.0               hadc24fc_1    conda-forge
libssh2                   1.11.1               hf672d98_0    conda-forge
libstdcxx                 14.2.0               hc0a3c3a_1    conda-forge
libstdcxx-ng              14.2.0               h4852527_1    conda-forge
libtiff                   4.7.0                he137b08_1    conda-forge
libuuid                   2.38.1               h0b41bf4_0    conda-forge
libwebp                   1.4.0                h2c329e2_0    conda-forge
libwebp-base              1.4.0                hd590300_0    conda-forge
libxcb                    1.17.0               h8a09558_0    conda-forge
libxcrypt                 4.4.36               hd590300_1    conda-forge
libxml2                   2.12.7               h4c95cb1_3    conda-forge
libxslt                   1.1.39               h76b75d6_0    conda-forge
libzip                    1.11.2               h6991a6a_0    conda-forge
libzlib                   1.3.1                hb9d3cd8_2    conda-forge
llvmlite                  0.43.0          py310h1a6248f_1    conda-forge
lomap2                    3.1.0              pyhff2d567_0    conda-forge
lxml                      5.3.0           py310h6ee67d5_2    conda-forge
lz4-c                     1.9.4                hcb278e6_0    conda-forge
markupsafe                3.0.2           py310h89163eb_0    conda-forge
matplotlib-base           3.9.2           py310h68603db_2    conda-forge
matplotlib-inline         0.1.7              pyhd8ed1ab_0    conda-forge
mda-xdrlib                0.2.0              pyhd8ed1ab_0    conda-forge
mdanalysis                2.1.0           py310h769672d_4    conda-forge
mdtraj                    1.10.1          py310he1cc299_1    conda-forge
mistune                   3.0.2              pyhd8ed1ab_0    conda-forge
mmpbsa-py                 16.0                     pypi_0    pypi
mmtf-python               1.1.3              pyhd8ed1ab_0    conda-forge
mpiplus                   v0.0.2             pyhd8ed1ab_0    conda-forge
mrcfile                   1.5.3              pyhd8ed1ab_0    conda-forge
msgpack-python            1.1.0           py310h3788b33_0    conda-forge
munkres                   1.1.4              pyh9f0ad1d_0    conda-forge
nbclient                  0.10.1             pyhd8ed1ab_0    conda-forge
nbconvert-core            7.16.4             pyhd8ed1ab_1    conda-forge
nbformat                  5.10.4             pyhd8ed1ab_0    conda-forge
ncurses                   6.5                  he02047a_1    conda-forge
nest-asyncio              1.6.0              pyhd8ed1ab_0    conda-forge
netcdf-fortran            4.6.1           nompi_ha5d1325_107    conda-forge
netcdf4                   1.7.2           nompi_py310h5146f0f_100    conda-forge
networkx                  3.4.2              pyh267e887_2    conda-forge
nomkl                     1.0                  h5ca1d4c_0    conda-forge
nose                      1.3.7                   py_1006    conda-forge
notebook                  7.2.2              pyhd8ed1ab_0    conda-forge
notebook-shim             0.2.4              pyhd8ed1ab_0    conda-forge
numba                     0.60.0          py310h5dc88bb_0    conda-forge
numexpr                   2.10.2          py310hdb6e06b_100    conda-forge
numpy                     1.26.4          py310hb13e2d6_0    conda-forge
ocl-icd                   2.3.2                hb9d3cd8_2    conda-forge
ocl-icd-system            1.0.0                         1    conda-forge
opencl-headers            2024.10.24           h5888daf_0    conda-forge
openfe                    1.2.0              pyhd8ed1ab_0    conda-forge
openfe-analysis           0.2.0              pyhd8ed1ab_0    conda-forge
openff-amber-ff-ports     0.0.4              pyhca7485f_0    conda-forge
openff-forcefields        2024.09.0          pyhff2d567_0    conda-forge
openff-interchange        0.4.0              pyhd8ed1ab_0    conda-forge
openff-interchange-base   0.4.0              pyhd8ed1ab_0    conda-forge
openff-models             0.1.2              pyhca7485f_0    conda-forge
openff-toolkit            0.16.6             pyhd8ed1ab_0    conda-forge
openff-toolkit-base       0.16.6             pyhd8ed1ab_0    conda-forge
openff-units              0.2.2              pyhca7485f_0    conda-forge
openff-utilities          0.1.12             pyhd8ed1ab_0    conda-forge
openjpeg                  2.5.2                h488ebb8_0    conda-forge
openmm                    8.1.2           py310h6b72300_2    conda-forge
openmmforcefields         0.12.0             pyhd8ed1ab_0    conda-forge
openmmtools               0.23.1             pyhd8ed1ab_0    conda-forge
openssl                   3.4.0                hb9d3cd8_0    conda-forge
overrides                 7.7.0              pyhd8ed1ab_0    conda-forge
packaging                 24.2               pyhff2d567_1    conda-forge
packmol                   20.15.1              hc8b2c43_1    conda-forge
packmol-memgen            1.2.3rc0                 pypi_0    pypi
pandas                    2.2.2           py310hf9f9076_1    conda-forge
pandocfilters             1.5.0              pyhd8ed1ab_0    conda-forge
panedr                    0.8.0              pyhd8ed1ab_0    conda-forge
pango                     1.54.0               h4c5309f_1    conda-forge
parmed                    4.3.0           py310h78e4988_0    conda-forge
parso                     0.8.4              pyhd8ed1ab_0    conda-forge
patsy                     1.0.1              pyhff2d567_0    conda-forge
pcre2                     10.44                hba22ea6_2    conda-forge
pdb4amber                 22.0                     pypi_0    pypi
pdbfixer                  1.9                pyh1a96a4e_0    conda-forge
perl                      5.32.1          7_hd590300_perl5    conda-forge
pexpect                   4.9.0              pyhd8ed1ab_0    conda-forge
pickleshare               0.7.5                   py_1003    conda-forge
pillow                    11.0.0          py310hfeaa1f3_0    conda-forge
pint                      0.23               pyhd8ed1ab_1    conda-forge
pip                       24.3.1             pyh8b19718_0    conda-forge
pixman                    0.43.2               h59595ed_0    conda-forge
pkgutil-resolve-name      1.3.10             pyhd8ed1ab_1    conda-forge
platformdirs              4.3.6              pyhd8ed1ab_0    conda-forge
plotly                    5.24.1             pyhd8ed1ab_0    conda-forge
plugcli                   0.2.0              pyhd8ed1ab_0    conda-forge
pluggy                    1.5.0              pyhd8ed1ab_0    conda-forge
pooch                     1.8.2              pyhd8ed1ab_0    conda-forge
prometheus_client         0.21.0             pyhd8ed1ab_0    conda-forge
prompt-toolkit            3.0.48             pyha770c72_0    conda-forge
psutil                    6.1.0           py310ha75aee5_0    conda-forge
pthread-stubs             0.4               hb9d3cd8_1002    conda-forge
ptyprocess                0.7.0              pyhd3deb0d_0    conda-forge
pure_eval                 0.2.3              pyhd8ed1ab_0    conda-forge
py-cpuinfo                9.0.0              pyhd8ed1ab_0    conda-forge
py3dmol                   2.4.2              pyhd8ed1ab_0    conda-forge
pycairo                   1.27.0          py310h25ff670_0    conda-forge
pycparser                 2.22               pyhd8ed1ab_0    conda-forge
pydantic                  2.10.2             pyh3cfb1c2_0    conda-forge
pydantic-core             2.27.1          py310h505e2c1_0    conda-forge
pyedr                     0.8.0              pyhd8ed1ab_0    conda-forge
pygments                  2.18.0             pyhd8ed1ab_0    conda-forge
pygraphviz                1.14            py310h9a1d609_0    conda-forge
pymbar                    3.1.1           py310h8a78493_3    conda-forge
pyparsing                 3.2.0              pyhd8ed1ab_1    conda-forge
pysocks                   1.7.1              pyha2e5f31_6    conda-forge
pytables                  3.10.1          py310h431dcdc_3    conda-forge
pytest                    8.3.3              pyhd8ed1ab_0    conda-forge
python                    3.10.15         h4a871b0_2_cpython    conda-forge
python-constraint         1.4.0                      py_0    conda-forge
python-dateutil           2.9.0.post0        pyhff2d567_0    conda-forge
python-fastjsonschema     2.21.0             pyhd8ed1ab_0    conda-forge
python-json-logger        2.0.7              pyhd8ed1ab_0    conda-forge
python-tzdata             2024.2             pyhd8ed1ab_0    conda-forge
python_abi                3.10                    5_cp310    conda-forge
pytraj                    2.0.6                    pypi_0    pypi
pytz                      2024.2             pyhd8ed1ab_0    conda-forge
pyyaml                    6.0.2           py310ha75aee5_1    conda-forge
pyzmq                     26.2.0          py310h71f11fc_3    conda-forge
qhull                     2020.2               h434a139_5    conda-forge
rdkit                     2023.03.3       py310h399bcf7_0    conda-forge
readline                  8.2                  h8228510_1    conda-forge
referencing               0.35.1             pyhd8ed1ab_0    conda-forge
reportlab                 4.2.5           py310ha75aee5_0    conda-forge
requests                  2.32.3             pyhd8ed1ab_0    conda-forge
rfc3339-validator         0.1.4              pyhd8ed1ab_0    conda-forge
rfc3986-validator         0.1.1              pyh9f0ad1d_0    conda-forge
rlpycairo                 0.2.0              pyhd8ed1ab_0    conda-forge
rpds-py                   0.21.0          py310h505e2c1_0    conda-forge
sander                    22.0                     pypi_0    pypi
scikit-learn              1.5.2           py310h27f47ee_1    conda-forge
scipy                     1.14.1          py310hfcf56fc_1    conda-forge
seaborn                   0.13.2               hd8ed1ab_2    conda-forge
seaborn-base              0.13.2             pyhd8ed1ab_2    conda-forge
send2trash                1.8.3              pyh0d859eb_0    conda-forge
setuptools                75.6.0             pyhff2d567_1    conda-forge
six                       1.16.0             pyh6c4a22f_0    conda-forge
smirnoff99frosst          1.1.0              pyh44b312d_0    conda-forge
snappy                    1.2.1                ha2e4443_0    conda-forge
sniffio                   1.3.1              pyhd8ed1ab_0    conda-forge
soupsieve                 2.5                pyhd8ed1ab_1    conda-forge
sqlalchemy                2.0.36          py310ha75aee5_0    conda-forge
stack_data                0.6.2              pyhd8ed1ab_0    conda-forge
statsmodels               0.14.4          py310hf462985_0    conda-forge
tenacity                  9.0.0              pyhd8ed1ab_0    conda-forge
terminado                 0.18.1             pyh0d859eb_0    conda-forge
threadpoolctl             3.5.0              pyhc1e730c_0    conda-forge
tinycss2                  1.4.0              pyhd8ed1ab_0    conda-forge
tinydb                    4.8.2              pyhd8ed1ab_0    conda-forge
tk                        8.6.13          noxft_h4845f30_101    conda-forge
tomli                     2.1.0              pyhff2d567_0    conda-forge
tornado                   6.4.2           py310ha75aee5_0    conda-forge
tqdm                      4.67.1             pyhd8ed1ab_0    conda-forge
traitlets                 5.14.3             pyhd8ed1ab_0    conda-forge
types-python-dateutil     2.9.0.20241003     pyhff2d567_0    conda-forge
typing-extensions         4.12.2               hd8ed1ab_0    conda-forge
typing_extensions         4.12.2             pyha770c72_0    conda-forge
typing_utils              0.1.0              pyhd8ed1ab_0    conda-forge
tzdata                    2024b                hc8b5060_0    conda-forge
unicodedata2              15.1.0          py310ha75aee5_1    conda-forge
uri-template              1.3.0              pyhd8ed1ab_0    conda-forge
urllib3                   2.2.3              pyhd8ed1ab_0    conda-forge
validators                0.34.0             pyhd8ed1ab_0    conda-forge
wcwidth                   0.2.13             pyhd8ed1ab_0    conda-forge
webcolors                 24.8.0             pyhd8ed1ab_0    conda-forge
webencodings              0.5.1              pyhd8ed1ab_2    conda-forge
websocket-client          1.8.0              pyhd8ed1ab_0    conda-forge
wheel                     0.45.1             pyhd8ed1ab_0    conda-forge
widgetsnbextension        4.0.13             pyhd8ed1ab_0    conda-forge
xmltodict                 0.14.2             pyhd8ed1ab_0    conda-forge
xorg-libice               1.1.1                hb9d3cd8_1    conda-forge
xorg-libsm                1.2.4                he73a12e_1    conda-forge
xorg-libx11               1.8.10               h4f16b4b_0    conda-forge
xorg-libxau               1.0.11               hb9d3cd8_1    conda-forge
xorg-libxdmcp             1.1.5                hb9d3cd8_0    conda-forge
xorg-libxext              1.3.6                hb9d3cd8_0    conda-forge
xorg-libxrender           0.9.11               hb9d3cd8_1    conda-forge
xorg-libxt                1.3.1                hb9d3cd8_0    conda-forge
xorg-xorgproto            2024.1               hb9d3cd8_1    conda-forge
xz                        5.2.6                h166bdaf_0    conda-forge
yaml                      0.2.5                h7f98852_2    conda-forge
zeromq                    4.3.5                h3b0a872_7    conda-forge
zipp                      3.21.0             pyhd8ed1ab_1    conda-forge
zlib                      1.3.1                hb9d3cd8_2    conda-forge
zlib-ng                   2.2.2                h5888daf_0    conda-forge
zstandard                 0.23.0          py310ha39cb0e_1    conda-forge
zstd                      1.5.6                ha6fb4c9_0    conda-forge

@hannahbaumann hannahbaumann self-assigned this Jan 20, 2025
@hannahbaumann
Copy link
Contributor

Hi @mathilfiker , thank you for sending this along!
I'm also not sure yet what might be going on, but if you have some time, could you maybe check the following things?

  • Are there any warnings or errors in the simulation .log file?
  • What are the output files of the simulation? Does the shared_XXX folder contain a simulation_real_time_analysis.yaml file? That file should contain the calculated DG values (and errors) after different simulation lengths, e.g. after 1 ns, 2 ns, ..., depending on the overall length of the simulation. Are all DG estimates in that file zero as well? Are the uncertainties zero too?
  • Do the ligands (the two variants of the same ligand) have the same name? You can check that by printing ligandA.name of the SmallMoleculeComponent
  • Could you print the partial charges for both ligands, starting e.g. from the SmallMoleculeComponent, and verify that the partial charges are different and as expected? E.g. printing ligandA.to_openff().partial_charges
  • The partial charges that are being used in the actual simulation are also present in the db.json file in the shared_XXX directory. That could be a another thing to check if those are as expected.

Please let me know if you have any questions!

@mathilfiker
Copy link
Author

Hi @hannahbaumann, thank you for answering!

  • There are no errors nor warnings in the .log file

  • All DGs and uncertainties are zero
    - ligandA.name shows a different name than ligandB.name

  • Partial charges printed with ligandA.to_openff().partial_charges are actually different for the two ligands

  • The db.json file only shows details for one ligand, so I don't know about the other. Its structure is
    {
    "gaff-2.11": {
    "1": {
    "ffxml": # force field parameters for ligandA
    "smiles": # SMILES for ligand A
    }
    }
    }

Is this .db file supposed to look like this?

@hannahbaumann
Copy link
Contributor

Thanks @mathilfiker !

Yes, that's how the db.json would look like, the charges should be in the ffxml, maybe you could just check it for the first ligand atom?

All DGs and uncertainties are zero

That's very odd indeed! Just to clarify, this is from the simulation_real_time_analysis.yaml file or from the resuls .json file?

@mathilfiker
Copy link
Author

Where should I find the ffxml? it is not in the working directory.

Yes, the DGs = 0 come from simulation_real_time_analysis.yaml

@hannahbaumann
Copy link
Contributor

Thanks @mathilfiker ! This is indeed very weird!
The ffxml file should be in the shared_XXX folder.

We will try to replicate this issue on our end to see whether there could be a bug somewhere. Apologies for the delays on this!

@atravitz atravitz self-assigned this Feb 3, 2025
@atravitz
Copy link
Contributor

atravitz commented Feb 5, 2025

@mathilfiker - could you clarify if within simulation_real_time analysis.yaml you are seeing standard_error_in_kT: 0.0, or if it is a very small value (on the order of 1e-11)?

@IAlibay
Copy link
Member

IAlibay commented Feb 5, 2025

Hi @mathilfiker just a brief update, it looks like this is a legitimate (albeit obscure) bug in the way we parameterize our systems.

You can see a very messy bugfix for it here: #1116

FIxing it properly is going to require some rework of some of our Protocol internals and a lot of validation, so we need to discuss things internally (probably next week) before we move forward with this.

If you want to try out completly experimental code, then that bugfix may work.

@mathilfiker
Copy link
Author

Hi @IAlibay , thank you for the update! I will try that experimental code asap.

@atravitz , the errors are 0.0

Thank you both for your work

@jameseastwood jameseastwood transferred this issue from OpenFreeEnergy/ExampleNotebooks Feb 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants