Git Product home page Git Product logo

brer_plugin's Introduction

BRER restraint plugin

Build Status

This is the repository for the brer Python module, a C++ extension that provides the GROMACS MD plugin for use with https://github.com/kassonlab/run_brer

Requirements

To build and install the GROMACS MD plugin, first install GROMACS and gmxapi as described for run_brer.

NOTE: For several recent versions of GROMACS, the "legacy API" needs to be enabled when GROMACS is configured. The GMX_INSTALL_LEGACY_API GROMACS CMake variable is not documented. Example:

cmake /path/to/gromacs/sources -DGMX_INSTALL_LEGACY_API=ON -DGMX_THREAD_MPI=ON

You will also need a reasonably recent version of cmake. cmake is a command line tool that is often already available, but you can be sure of getting a recent version by activating your python environment and just doing pip install cmake.

Installation

This is a simple C++ extension module that can be attached to a GROMACS molecular dynamics (MD) simulator through the gmxapi Python interface. The module is necessary for research workflows based on the run_brer Python package. See https://github.com/kassonlab/run_brer for more information.

Once you have identified your compilers and Python installation (or virtual environment), use cmake to configure, build, and install. Refer to cmake documentation for usage and options. Note that GROMACS installs a CMake hints (or toolchain) file to help you specify the correct compiler toolchain to cmake. See GROMACS release notes.

See https://github.com/kassonlab/brer_plugin/releases for tagged releases. For development code, clone the repository and use the default branch.

Complete example

This example assumes

  • I have already activated a Python (virtual) environment in which gmxapi is installed, and
  • A GROMACS installation is available on my $PATH (such as by "sourcing" the GMXRC or calling module load gromacs in an HPC environment)
  • I am using GROMACS 2022, which provides a CMake "hints" file, which I will (optionally) provide when calling cmake.

To confirm:

  • gmx --version (or gmx_mpi, gmx_d, etc. for other configurations) should ...
  • which python should show a path to a python virtual environment for Python 3.7 or later.
  • pip list should include gmxapi

To download, build, and install the brer Python module:

git clone https://github.com/kassonlab/brer_plugin.git
cd brer_plugin
mkdir build
cd build
cmake ..
make
make install

In the example above, the -C argument is usually optional. (See below.)

Troubleshooting

Mismatched compiler toolchain

One of the most common installation problems is related to incompatible compiler toolchains between GROMACS, gmxapi, and the plugin module.

  • CMake may warn "You are compiling with a different C++ compiler from the one that was used to compile GROMACS."
  • When you import the brer module, you may get an error like the following. ImportError: dlopen(...): symbol not found in flat namespace '__ZN6gmxapi10MDWorkSpec9addModuleENSt3__110shared_ptrINS_8MDModuleEEE'

You can either set the CMAKE_CXX_COMPILER, explicitly, or you can use the GROMACS-installed CMake hints file.

You will have to rebuild and reinstall the brer module. First, remove the CMakeCache.txt file from the build directory.

For GROMACS 2022 and newer, you would invoke cmake with something like the following. (The exact path will depend on your installation.)

cmake .. -C /path/to/gromacs_installation/share/cmake/gromacs/gromacs-hints.cmake

For GROMACS 2021 and older,

cmake .. -DCMAKE_TOOLCHAIN_FILE=/path/to/gromacs_installation/share/cmake/gromacs/gromacs-toolchain.cmake

See GROMACS release notes.

References

Hays, J. M., Cafiso, D. S., & Kasson, P. M. Hybrid Refinement of Heterogeneous Conformational Ensembles using Spectroscopic Data. The Journal of Physical Chemistry Letters 2019. DOI: 10.1021/acs.jpclett.9b01407

Irrgang, M. E., Hays, J. M., & Kasson, P. M. gmxapi: a high-level interface for advanced control and extension of molecular dynamics simulations. Bioinformatics 2018. DOI: 10.1093/bioinformatics/bty484

brer_plugin's People

Contributors

carolinedav avatar eirrgang avatar jmhays avatar peterkasson avatar

Watchers

 avatar  avatar  avatar

brer_plugin's Issues

Restraint logs are overwritten when resuming.

The "convergence" and "production" phases of the BRER workflow are intended to be compatible with GROMACS continuation-from-checkpoint, for simulations managed by run-brer.

However, the log files in which the LinearStopRestraint and LinearRestraint (the plugin potentials used for the convergence and production phases, respectively) are opened with mode "w" instead of mode "a".

This means that trajectories that are interrupted (such as for HPC job walltime limits) may be successfully completed with subsequent jobs, but the data logged to these files would be overwritten.

Two options:

  • run_brer could rotate the log files, backing up existing log files before launching simulations
  • brer_plugin could open log files with "append" mode (a) instead of truncated write mode (w). (Note that log lines are flushed immediately each time they are written, so the chance of file corruption should be very low.)

I don't think that run_brer currently officially knows about these files, so the latter option would seem cleaner.

Check for zero-valued alpha parameter

It doesn't make sense for alpha to be zero unless a developer is testing a restraint that should not apply forces. However, under some circumstances, run_brer could accidentally set alpha=0. We should check for this and either issue a warning or raise an error that can be optionally disabled.

Move maintenance of BRER restraint code to new repository.

  • Create a https://github.com/kassonlab/brer_plugin repository
  • Move this issue to the new repository, along with the pending issues below.
  • Transfer the sample_restraint fork from @jmhays to https://github.com/kassonlab/brer_plugin
  • Update external links.
  • Update sample_restraint artifacts to clarify that the repository is for the brer plugin. Update README, project name, docs, tests. Increment the project version to aid with clarity.

Pending issues for renewed repository

  • Warning or Error when alpha parameter is 0. Issue #3
  • Update for gmxapi 0.1+

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.