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

Rename a3fe #1

Merged
merged 6 commits into from
Feb 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1 +1 @@
EnsEquil/_version.py export-subst
a3fe/_version.py export-subst
6 changes: 3 additions & 3 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# How to contribute

We welcome contributions from external contributors, and this document
describes how to merge code changes into this EnsEquil.
describes how to merge code changes into this a3fe.

## Getting Started

Expand All @@ -19,7 +19,7 @@ describes how to merge code changes into this EnsEquil.
[branch](https://help.github.com/articles/creating-and-deleting-branches-within-your-repository/)
with the branch name relating to the feature you are going to add.
* When you are ready for others to examine and comment on your new feature,
navigate to your fork of EnsEquil on GitHub and open a [pull
navigate to your fork of a3fe on GitHub and open a [pull
request](https://help.github.com/articles/using-pull-requests/) (PR). Note that
after you launch a PR from one of your fork's branches, all
subsequent commits to that branch will be added to the open pull request
Expand All @@ -29,7 +29,7 @@ describes how to merge code changes into this EnsEquil.
* If you're providing a new feature, you must add test cases and documentation.
* When the code is ready to go, make sure you run the test suite using pytest.
* When you're ready to be considered for merging, check the "Ready to go"
box on the PR page to let the EnsEquil devs know that the changes are complete.
box on the PR page to let the a3fe devs know that the changes are complete.
The code will not be merged until this box is checked, the continuous
integration returns checkmarks,
and multiple core developers give "Approved" reviews.
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/CI.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:
# conda setup requires this special shell
shell: bash -l {0}
run: |
pytest -v --cov=EnsEquil --cov-report=xml --color=yes EnsEquil/tests/
pytest -v --cov=a3fe --cov-report=xml --color=yes a3fe/tests/

- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
Expand Down
2 changes: 1 addition & 1 deletion .lgtm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ path_classifiers:
- versioneer.py # Set Versioneer.py to an external "library" (3rd party code)
- devtools/*
generated:
- EnsEquil/_version.py
- a3fe/_version.py
1 change: 0 additions & 1 deletion EnsEquil/_version.py

This file was deleted.

10 changes: 0 additions & 10 deletions EnsEquil/tests/test_import.py

This file was deleted.

32 changes: 17 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,41 +1,43 @@
EnsEquil
a3fe
==============================
[//]: # (Badges)
[![GitHub Actions Build Status](https://github.com/fjclark/EnsEquil/workflows/CI/badge.svg)](https://github.com/fjclark/EnsEquil/actions?query=workflow%3ACI)
[![codecov](https://codecov.io/gh/fjclark/EnsEquil/branch/main/graph/badge.svg?token=UMH0OUSUJY)](https://codecov.io/gh/fjclark/EnsEquil)
[![GitHub Actions Build Status](https://github.com/fjclark/a3fe/workflows/CI/badge.svg)](https://github.com/fjclark/a3fe/actions?query=workflow%3ACI)
[![codecov](https://codecov.io/gh/fjclark/a3fe/branch/main/graph/badge.svg?token=UMH0OUSUJY)](https://codecov.io/gh/fjclark/a3fe)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![Documentation Status](https://readthedocs.org/projects/ensequil/badge/?version=latest)](https://ensequil.readthedocs.io/en/latest/?badge=latest)
[![Documentation Status](https://readthedocs.org/projects/a3fe/badge/?version=latest)](https://a3fe.readthedocs.io/en/latest/?badge=latest)

<img src="./a3fe_logo.png" alt="Alt text" style="width: 50%; height: 50%;">

A package for running adaptive alchemical absolute binding free energy calculations with SOMD based on an ensemble of simulations. This requires the SLURM scheduling system.

### Installation

EnsEquil depends on SLURM for scheduling jobs, and on GROMACS for running initial equilibration simulations. Please ensure that your have sourced your GMXRC or loaded your GROMACS module before proceeding with the installation.
a3fe depends on SLURM for scheduling jobs, and on GROMACS for running initial equilibration simulations. Please ensure that your have sourced your GMXRC or loaded your GROMACS module before proceeding with the installation.

We first need to install the [BioSimSpace](https://biosimspace.openbiosim.org/) dependencies using mamba (or conda). SOMD, which is used to run the simulations, is contained within Sire, which will be installed as a dependency of BioSimSpace.
```bash
mamba create -n ensequil -c conda-forge -c openbiosim/label/dev biosimspace
mamba activate ensequil
mamba create -n a3fe -c conda-forge -c openbiosim/label/dev biosimspace
mamba activate a3fe
```
Now download EnsEquil, install, and test:
Now download a3fe, install, and test:
```bash
git clone https://github.com/fjclark/EnsEquil.git
cd EnsEquil
git clone https://github.com/fjclark/a3fe.git
cd a3fe
pip install .
pytest EnsEquil
pytest a3fe
```

### Quick Start

- Activate your EnsEquil conda environment
- Activate your a3fe conda environment
- Create a base directory for the calculation and create an directory called `input` within this
- Move your input files into the the input directory. For example, if you have parameterised AMBER-format input files, name these bound_param.rst7, bound_param.prm7, free_param.rst7, and free_param.prm7. For more details see the documentation.
- Copy run somd.sh and template_config.sh from EnsEquil/EnsEquil/data/example_run_dir to your `input` directory, making sure to the SLURM options in run_somd.sh so that the jobs will run on your cluster
- Copy run somd.sh and template_config.sh from a3fe/a3fe/data/example_run_dir to your `input` directory, making sure to the SLURM options in run_somd.sh so that the jobs will run on your cluster
- In the calculation base directory, run the following python code, either through ipython or as a python script (you will likely want to run the script with `nohup`or use ipython through tmux to ensure that the calculation is not killed when you lose connection)

```python
import EnsEquil as ee
calc = ee.Calculation()
import a3fe as a3
calc = a3.Calculation()
calc.setup()
calc.get_optimal_lam_vals()
calc.run()
Expand Down
8 changes: 8 additions & 0 deletions EnsEquil/__init__.py → a3fe/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
"""A package for running free energy calculations with SOMD with automated equilibration detection based on an ensemble of simulations."""

# This package was previously named "EnsEquil". To allow objects pickled with the
# old name to be unpickled with the new name, we set EnsEquil to point to a3fe.
import sys as _sys

_sys.modules["EnsEquil"] = _sys.modules["a3fe"]


# Run imports
from ._version import __version__

# Pdb helper import
from .read import *
from .run import *
1 change: 1 addition & 0 deletions a3fe/_version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__version__ = "1.0.0+414.g1520022.dirty"
File renamed without changes.
File renamed without changes.
File renamed without changes.
8 changes: 5 additions & 3 deletions EnsEquil/analyse/compare.py → a3fe/analyse/compare.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
"""Functionality for comparing two or more simulation runners."""


import numpy as _np
from ..run._utils import SimulationRunnerIterator as _SimulationRunnerIterator
from typing import List as _List
from typing import Tuple as _Tuple
from typing import Union as _Union

import numpy as _np
from scipy.stats import levene as _levene

from typing import List as _List, Tuple as _Tuple, Union as _Union
from ..run._utils import SimulationRunnerIterator as _SimulationRunnerIterator

__all__ = [
"get_comparitive_convergence_data",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -950,7 +950,7 @@ def dummy_check_equil_multiwindow(
) -> _Tuple[bool, _Optional[float]]: # type: ignore
"""
Becuse "check_equil_multiwindow" checks multiple windows at once and sets the _equilibrated
and _equil_time attributes of the lambda windows, but EnsEquil was written based on per-window
and _equil_time attributes of the lambda windows, but a3fe was written based on per-window
checks, we need a dummy function which just reads the attributes of the lambda window and
assumes that they have already been set by "check_equil_multiwindow".

Expand Down
File renamed without changes.
8 changes: 4 additions & 4 deletions EnsEquil/analyse/mbar.py → a3fe/analyse/mbar.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@

import numpy as _np

from ..read._process_somd_files import \
read_mbar_gradients as _read_mbar_gradients
from ..read._process_somd_files import read_mbar_result as _read_mbar_result
from ..read._process_somd_files import (
write_truncated_sim_datafile as _write_truncated_sim_datafile,
read_mbar_gradients as _read_mbar_gradients,
)
from ..read._process_somd_files import \
write_truncated_sim_datafile as _write_truncated_sim_datafile


def run_mbar(
Expand Down
13 changes: 6 additions & 7 deletions EnsEquil/analyse/plot.py → a3fe/analyse/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,24 +29,23 @@
from typing import Optional as _Optional
from typing import Tuple as _Tuple

import matplotlib.pyplot as _plt
import matplotlib.colors as _colors
import matplotlib.cm as _cm
import matplotlib.colors as _colors
import matplotlib.pyplot as _plt
import numpy as _np
import pandas as _pd
import scipy.stats as _stats
from scipy.stats import kruskal as _kruskal
import seaborn as _sns
from scipy.stats import kruskal as _kruskal

from ..read._process_somd_files import read_mbar_pmf as _read_mbar_pmf
from ..read._process_somd_files import read_overlap_mat as _read_overlap_mat
from ..run._utils import SimulationRunnerIterator as _SimulationRunnerIterator
from .compare import \
get_comparitive_convergence_data as _get_comparitive_convergence_data
from .process_grads import GradientData
from .rmsd import get_rmsd as _get_rmsd
from .compare import (
get_comparitive_convergence_data as _get_comparitive_convergence_data,
)
from .waters import get_av_waters_stage as _get_av_waters_stage
from ..run._utils import SimulationRunnerIterator as _SimulationRunnerIterator


def general_plot(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,8 @@
import numpy as _np
from scipy.constants import gas_constant as _R

from .autocorrelation import (
get_statistical_inefficiency as _get_statistical_inefficiency,
)
from .autocorrelation import \
get_statistical_inefficiency as _get_statistical_inefficiency
from .mbar import run_mbar as _run_mbar


Expand Down
4 changes: 2 additions & 2 deletions EnsEquil/analyse/rmsd.py → a3fe/analyse/rmsd.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@
import subprocess as _subprocess
from tempfile import TemporaryDirectory as _TemporaryDirectory
from typing import List as _List
from typing import Tuple as _Tuple
from typing import Optional as _Optional
from typing import Tuple as _Tuple

import BioSimSpace as _BSS
import MDAnalysis.transformations as _trans
import numpy as _np
from MDAnalysis import Universe as _Universe
import MDAnalysis.transformations as _trans
from MDAnalysis.analysis.rms import RMSD as _RMSD


Expand Down
17 changes: 7 additions & 10 deletions EnsEquil/analyse/waters.py → a3fe/analyse/waters.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,15 @@
"""Functions to analyse binding site waters."""

from typing import (
List as _List,
Tuple as _Tuple,
Optional as _Optional,
Callable as _Callable,
)

import glob as _glob
import MDAnalysis as _mda
import numpy as _np
import os as _os

from multiprocessing import Pool as _Pool
from typing import Callable as _Callable
from typing import List as _List
from typing import Optional as _Optional
from typing import Tuple as _Tuple

import MDAnalysis as _mda
import numpy as _np


def get_av_waters_simulation(
Expand Down
File renamed without changes.
Loading
Loading