Skip to content

Commit

Permalink
Merge pull request #117 from wiederm/update_to_new_packages
Browse files Browse the repository at this point in the history
adapt some packages
  • Loading branch information
JohannesKarwou authored Dec 11, 2023
2 parents 77d5f0f + 7c85c46 commit b366c3d
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 14 deletions.
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Transformato
[![GH Pages](https://github.com/wiederm/transformato/actions/workflows/build_page.yaml/badge.svg)](https://github.com/wiederm/transformato/actions/workflows/build_page.yaml)
[![Conda Downloads](https://img.shields.io/conda/dn/conda-forge/transformato.svg)](https://anaconda.org/conda-forge/transformato)

Transformato is a package that helps to set up relative alchemical free energy calculations of small molecules with a common core scaffold, either for solvation free energy[^1] or binding free energy[^2] estimates. The package is designed to be used with output generated by [CHARMM-GUI](https://charmm-gui.org/).
Transformato is a package that helps to set up relative alchemical free energy calculations of small molecules with a common core scaffold, either for relative solvation free energy[^1], absolute solvation free energy[^2] or binding free energy[^3] estimates. The package is designed to be used with output generated by [CHARMM-GUI](https://charmm-gui.org/).

## Installation

Expand All @@ -29,7 +29,7 @@ For more information on how to use transformato please visit the [documentation]

### Copyright

:copyright: 2022, Marcus Wieder, Johannes Karwounopoulos, Stefan Boresch
:copyright: 2023, Marcus Wieder, Johannes Karwounopoulos, Stefan Boresch


#### Acknowledgements
Expand All @@ -39,5 +39,6 @@ Project based on the


[^1]: Wieder, M., Fleck, M., Braunsfeld, B., Boresch, S., *J. Comput. Chem.* 2022, 1. [DOI](https://doi.org/10.1002/jcc.26877)
[^2]: Karwounopoulos, J., Wieder, M., Boresch, S., *Front. Mol. Biosci.* 2022, 9, 954638 [DOI](https://doi.org/10.3389/fmolb.2022.954638
[^2]: Karwounopoulos, J.,Kaupang, A., Wieder, M., Boresch, S., *JCTC* 2023, 9, 954638 [DOI](https://doi.org/10.1021/acs.jctc.3c00691)
[^3]: Karwounopoulos, J., Wieder, M., Boresch, S., *Front. Mol. Biosci.* 2022, 9, 954638 [DOI](https://doi.org/10.3389/fmolb.2022.954638
)
3 changes: 1 addition & 2 deletions devtools/conda-envs/fep_env.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ dependencies:
- openmmtools
- numpy
- ipython
- pymbar=3
- pymbar
- rdkit
- parmed
- pyyaml
Expand All @@ -25,5 +25,4 @@ dependencies:
- codecov
- pip:
- git+https://github.com/wiederm/tf_routes.git
- git+https://github.com/ParmEd/ParmEd.git
- git+https://github.com/wiederm/transformato_testsystems.git
20 changes: 12 additions & 8 deletions transformato/analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -301,8 +301,12 @@ def calculate_dG_using_mbar(self, u_kn: np.array, N_k: dict, env: str):
nr_of_snapshots = N_k[env][d] + N_k[env][d + 1]
u_kn_ = u_kn[d : d + 2 :, start : start + nr_of_snapshots]
m = mbar.MBAR(u_kn_, N_k[env][d : d + 2])
logger.debug(m.getFreeEnergyDifferences(return_dict=True)["Delta_f"][0, 1])
logger.debug(m.getFreeEnergyDifferences(return_dict=True)["dDelta_f"][0, 1])
logger.debug(
m.compute_free_energy_differences(return_dict=True)["Delta_f"][0, 1]
)
logger.debug(
m.compute_free_energy_differences(return_dict=True)["dDelta_f"][0, 1]
)

start += N_k[env][d]

Expand Down Expand Up @@ -690,9 +694,9 @@ def _load_mbar_results(file: str):
def free_energy_differences(self, env="vacuum"):
"""matrix of free energy differences"""
try:
r = self.mbar_results[env].getFreeEnergyDifferences(return_dict=True)[
"Delta_f"
]
r = self.mbar_results[env].compute_free_energy_differences(
return_dict=True
)["Delta_f"]
except KeyError:
raise KeyError(f"Free energy difference not obtained for : {env}")
return r
Expand All @@ -709,9 +713,9 @@ def free_energy_overlap(self, env="vacuum"):
def free_energy_difference_uncertainties(self, env="vacuum"):
"""matrix of asymptotic uncertainty-estimates accompanying free energy differences"""
try:
r = self.mbar_results[env].getFreeEnergyDifferences(return_dict=True)[
"dDelta_f"
]
r = self.mbar_results[env].compute_free_energy_differences(
return_dict=True
)["dDelta_f"]
except KeyError:
raise KeyError(f"Free energy uncertanties not obtained for : {env}")
return r
Expand Down
3 changes: 2 additions & 1 deletion transformato/tests/test_restraints.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,8 @@ def test_integration():
)

simulation.minimizeEnergy(
tolerance=inputs.mini_Tol * kilojoule / mole, maxIterations=10
tolerance=inputs.mini_Tol * kilojoule / (openmm.unit.nanometer * mole),
maxIterations=10,
)
logger.info(
f"Potential energy after 1-iter minimization {simulation.context.getState(getEnergy=True).getPotentialEnergy()}"
Expand Down

0 comments on commit b366c3d

Please sign in to comment.