Skip to content

Commit

Permalink
Merge branch 'develop' into HydrogenBondAnalysis
Browse files Browse the repository at this point in the history
  • Loading branch information
orbeckst authored Aug 25, 2023
2 parents 40ee178 + 6449879 commit a390a4e
Show file tree
Hide file tree
Showing 105 changed files with 31,461 additions and 1,605 deletions.
2 changes: 2 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Autoformat all files using `black`
8f061e7da99eb78353e9392d6929673da5b352a3
10 changes: 10 additions & 0 deletions .github/workflows/black.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: Lint

on: [push, pull_request]

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: psf/black@stable
27 changes: 15 additions & 12 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,20 +32,17 @@ jobs:

os: [ubuntu-latest]
python-version: ["3.10"]
gromacs-version: ["4.6.5", "2018.6", "2020.6", "2021.1"]
gromacs-version: ["4.6.5", "2018.6", "2020.6", "2021.1", "2022.4", "2023.1"]
include:
- os: ubuntu-latest
python-version: "3.7"
gromacs-version: "2021.1"
- os: ubuntu-latest
python-version: "3.8"
gromacs-version: "2021.1"
gromacs-version: "2023.1"
- os: ubuntu-latest
python-version: "3.9"
gromacs-version: "2021.1"
gromacs-version: "2023.1"
- os: macos-latest
python-version: "3.10"
gromacs-version: "2021.1"
gromacs-version: "2023.1"

env:
MPLBACKEND: agg
Expand All @@ -55,13 +52,17 @@ jobs:
- uses: actions/checkout@v3

- name: mamba environment and package installation
uses: mamba-org/provision-with-micromamba@main
uses: mamba-org/setup-micromamba@v1
with:
environment-file: devtools/conda-envs/test_env.yaml
channel-priority: "flexible"
condarc: |
channels:
- conda-forge
- bioconda
channel_priority: flexible
cache-downloads: true
cache-env: true
extra-specs: |
cache-environment: true
create-args: >-
python=${{ matrix.python-version }}
- name: Python version information
Expand All @@ -78,8 +79,10 @@ jobs:
python -m pip install pybol
- name: Install GROMACS (${{ matrix.gromacs-version }})
# include mdanalysis here AGAIN to work around micromamba removing mdanalysis
# while downgrading libxml2 (see issue #252)
run: |
micromamba install 'gromacs==${{ matrix.gromacs-version }}' pocl
micromamba install 'gromacs==${{ matrix.gromacs-version }}' pocl mdanalysis
- name: Install package (with no dependencies)
run: |
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,6 @@ dist
doc/examples/benzene/Equilibrium/
.coverage
coverage.xml
*.lock
*.npz
dir.csv
6 changes: 6 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"recommendations": [
"ms-python.black-formatter",
"ms-python.python"
]
}
5 changes: 5 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"[python]": {
"editor.formatOnSave": true
}
}
4 changes: 4 additions & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,7 @@ their first commit. GitHub handle is optional.

- Cade Duckworth (cadeduckworth)

2023
----

- Alexander Moriarty (@a-ws-m)
37 changes: 32 additions & 5 deletions CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,16 @@ CHANGES for MDPOW
Add summary of changes for each release. Use ISO 8061 dates. Reference
GitHub issues numbers and PR numbers.

2022-??-?? 0.9.0
cadeduckworth, orbeckst, VOD555
2023-??-?? 0.9.0
cadeduckworth, orbeckst, VOD555, a-ws-m

Changes

* added support for Python 3.10 (#202)
* dropped testing on Python 3.6 (PR #220, #202)
* dropped testing on Python 3.7 (minimally supported Python >= 3.8, #248)
* support Gromacs 2022.4 and 2023.1 (#256)
* use pymbar >= 4 and alchemlyb >= 2 (#246)
* for ensemble.EnsembleAnalysis._single_frame()
changed 'pass' to 'raise NotImplementedError' (#216)
* for ensemble.EnsembleAnalysis._single_universe()
Expand All @@ -18,16 +23,38 @@ Changes
and use _single_frame OR _single_universe (#216)
* _prepare_universe and _conclude_universe removed from
EnsembleAnalysis.run() method, no longer needed (per comments, #199)
* added support for Python 3.10
* dropped testing on Python 3.6
* internal log_banner() now uses logger as argument (PR #247)
* use `black` formatter for codebase (#271)

Enhancements

* convert figure components to SVG, save as individual PDFs,
and generate PDF of all figures combined in one file,
for workflows dihedrals module (#243)
* add RDKit mol object to dihedrals plot with dihedral atom
indices labeled and dihedral atom group bonds highlighted
for workflows dihedrals module (#243)
* new workflows registry that contains each EnsembleAnalysis for which
a workflows module exists, for use with workflows base module (#229)
* new workflows base module that provides iterative workflow use for
directories that contain multiple projects (#229)
* new workflows module (#217)
* new automated dihedral analysis workflow (detect dihedrals with SMARTS,
analyze with EnsembleAnalysis, and generate seaborn violinplots) (#217)
* new workflows.base.guess_elements() function to guess elements
from masses (PR #264)
* add new exit_on_error=False|True argument to run.runMD_or_exit() so
that failures just raise exceptions and not call sys.exit() (PR #249)

Fixes

* for mdpow.workflows.dihedrals.periodic_angle() implement .copy(deep=True)
to explicitly make a copy DataFrame of the data for angle padding (#242)
* fix rcoulomb in CHARMM energy minimization MDP template file (PR #210)
* fix ensemble.EnsembleAnalysis.check_groups_from_common_ensemble (#212)


2021-01-03 0.8.0
2022-01-03 0.8.0
ALescoulie, orbeckst

Changes
Expand Down
6 changes: 3 additions & 3 deletions INSTALL.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Quick installation instructions for *MDPOW*
=============================================

MDPOW is compatible with Python 3.7+ and tested
MDPOW is compatible with Python >=3.8 and tested
on Ubuntu and Mac OS.

We recommend that you install MDPOW in a virtual environment.
Expand All @@ -28,11 +28,11 @@ GROMACS_.
Conda environment with pre-requisites
-------------------------------------

Make a conda environment with the latest packages for Python 3.7 and
Make a conda environment with the latest packages for Python 3.8 or
higher with the name *mdpow*; this installs the larger dependencies that are
pre-requisites for MDPOW::

conda create -c conda-forge -n mdpow numpy scipy matplotlib mdanalysis pyyaml alchemlyb pandas gromacswrapper
conda create -c conda-forge -n mdpow numpy scipy matplotlib seaborn mdanalysis pyyaml alchemlyb pandas gromacswrapper rdkit
conda activate mdpow

Install MDPOW with ``pip``::
Expand Down
23 changes: 19 additions & 4 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@
README for MDPOW
===================

|build| |cov| |docs|
|build| |cov| |docs| |black| |zenodo|

.. |P_ow| replace:: *P*\ :sub:`OW`
.. |P_cw| replace:: *P*\ :sub:`CW`
.. |P_tw| replace:: *P*\ :sub:`TW`

*MDPOW* is a python package that automates the calculation of
solvation free energies via molecular dynamics (MD) simulations. In
Expand All @@ -14,7 +15,8 @@ coefficients. Currently implemented:

- *water-octanol* partition coefficient (|P_ow|)
- *water-cyclohexane* partition coefficient (|P_cw|)

- *water-toluene* partition coefficient (|P_tw|)

Calculations are performed with the Gromacs_ MD software package
[#GromacsWrapperNote]_. Currently, *OPLS-AA*, *CHARMM/CGENFF*, and
*AMBER/GAFF* parameters are supported.
Expand Down Expand Up @@ -44,10 +46,10 @@ Installation
------------

See `INSTALL`_ for detailed instructions. MDPOW currently supports and
is tested with Python 3.7 to 3.9.
is tested with Python 3.8 to 3.10.

You will also need `Gromacs`_ (currently tested with versions 4.6.5,
2018, 2020, 2021 but 2016 and 2019 should also work).
2018, 2020, 2021, 2022, 2023 but 2016 and 2019 should also work).


Development version
Expand All @@ -72,9 +74,14 @@ Source code
*MDPOW* is open source and published under the `GNU General Public License
v3`_. Source code is available at https://github.com/Becksteinlab/MDPOW .

We use `black`_ for uniform code formatting.

.. _`GNU General Public License v3`:
http://www.gnu.org/licenses/gpl-3.0.html

.. _`black`: https://github.com/psf/black


Footnotes
---------

Expand All @@ -92,5 +99,13 @@ Footnotes
.. |docs| image:: https://readthedocs.org/projects/mdpow/badge/?version=latest
:target: http://mdpow.readthedocs.org/en/latest/?badge=latest
:alt: Documentation

.. |zenodo| image:: https://zenodo.org/badge/44999898.svg
:target: https://zenodo.org/badge/latestdoi/44999898
:alt: Zenodo

.. |black| image:: https://img.shields.io/badge/code%20style-black-000000.svg
:target: https://github.com/psf/black
:alt: black

.. _INSTALL: INSTALL.rst
10 changes: 8 additions & 2 deletions devtools/conda-envs/test_env.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,16 @@ dependencies:
- mdanalysis >=2
- numkit
- gromacswrapper
- alchemlyb <2
- alchemlyb >=2
- pymbar >=4
- rdkit
- seaborn
- svgutils
- cairosvg
- pypdf

# Testing
- pytest
- pytest-pep8
- pytest-cov
- codecov
- codecov
22 changes: 15 additions & 7 deletions doc/examples/benzene/session.py
Original file line number Diff line number Diff line change
@@ -1,31 +1,39 @@
import mdpow.equil

S = mdpow.equil.WaterSimulation(molecule="BNZ")
S.topology("benzene.itp")
S.solvate(struct="benzene.pdb")
S.energy_minimize()
S.MD_relaxed(runtime=5) # should be at least 1e3 ps for production not just 5 ps
S.MD_relaxed(runtime=5) # should be at least 1e3 ps for production not just 5 ps

# run simulation externally or use MDrunner
# (see docs for using mpi etc)
import gromacs
r = gromacs.run.MDrunner(dirname=S.dirs['MD_relaxed'], deffnm="md", c="md.pdb", cpi=True, append=True, v=True)
r.run() # runs mdrun in the python shell

r = gromacs.run.MDrunner(
dirname=S.dirs["MD_relaxed"], deffnm="md", c="md.pdb", cpi=True, append=True, v=True
)
r.run() # runs mdrun in the python shell


S.MD(runtime=10, qscript=['local.sh']) # should be at least 10e3 ps for production, not just 10 ps
S.MD(
runtime=10, qscript=["local.sh"]
) # should be at least 10e3 ps for production, not just 10 ps
# run simulation
r = gromacs.run.MDrunner(dirname=S.dirs['MD_NPT'], deffnm="md", c="md.pdb", cpi=True, append=True, v=True)
r.run() # runs mdrun in the python shell
r = gromacs.run.MDrunner(
dirname=S.dirs["MD_NPT"], deffnm="md", c="md.pdb", cpi=True, append=True, v=True
)
r.run() # runs mdrun in the python shell


import mdpow.fep

gwat = mdpow.fep.Ghyd(simulation=S, runtime=10)
gwat.setup()

# run multiple simulations on cluster



O = mdpow.equil.OctanolSimulation(molecule="BNZ")
O.topology("benzene.itp")
O.solvate(struct="benzene.pdb")
Expand Down
9 changes: 8 additions & 1 deletion doc/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,12 @@ scipy
pandas
pyyaml
GromacsWrapper>=0.5.1
alchemlyb
alchemlyb>=2
pymbar>=4
mdanalysis
rdkit
seaborn
matplotlib
svgutils
cairosvg
pypdf
6 changes: 2 additions & 4 deletions doc/sphinx/source/analysis.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,11 @@ all FEP simulations. They then make data available (typically, as a
:class:`pandas.DataFrame`).

.. toctree::
:maxdepth: 1
:maxdepth: 2

analysis/solvation
analysis/dihedral


.. _framework:

Ensemble Analysis Framework
Expand All @@ -45,10 +44,9 @@ in more detail in [Lescoulie2021]_.
.. toctree::
:maxdepth: 1

analysis/ensemble_analysis
analysis/ensemble_analysis
analysis/ensemble


References
----------
.. [Lescoulie2021] A. Lescoulie, "SPIDAL Summer REU 2021: Upgrading MDPOW and
Expand Down
Loading

0 comments on commit a390a4e

Please sign in to comment.