A general toolkit for working with coarse-grained models.
The library is built off of stk, which comes with the pip install
CGExplore is a library but contains an example library usage in the first_paper_example directory. I recommend installing the library with the following instructions and then using the example directory in a separate repository or code base of your own.
To reproduce data in DOI: 10.1039/D3SC03991A: Download the source code from first_paper_example - presubmission release from Releases instead of the repo in step 1. I do not guarantee that running the example code on the current version will work. However, with each pull request a test is run as a GitHub Action connected to this repository. This ensures that the results obtained for a subset of the original data set do not change with changes to this library. Additionally, the naming convention has changed and force field xml files should provide the appropriate information for mapping angles to models.
The code can be installed following these steps:
-
clone
CGExplorefrom here -
Create a
condaormambaenvironment:
mamba create -n NAME python=3.11
- Activate the environment:
conda activate NAME
- From
CGExploredirectory, install pip environment:
pip install .
or for development, use just to install a dev environment with:
just dev
- Install
OpenMMdocs:
mamba install openmm
or
conda install -c conda-forge openmm
- Install
openmmtoolsdocs:
mamba install openmmtools
or
conda config --add channels omnia --add channels conda-forge
conda install openmmtools
- Update directory structure in
env_set.pyif using example code.
The library implements some analysis that uses:
Shape 2.1: Follow the instructions to download and installed at Shape
- The directory
cgexplorecontains the actual source code for the package. Warning: This package is still very much underdevelopment and many changes are expected. - The directory
first_paper_examplecontains the code to generate the cages and data for DOI: XX. This series of examples uses the classes and tools inCGExplore.generate_XX.pygenerates cage structures for different topology setsenv_set.pysets a specific environment for file outputsplot_XX.pyproduces images and figures, and performs analysis
Warning: If you have a CUDA-capable GPU and attempt to use CUDA in the first example, you may get NaN errors due to the torsion restriction for angles at 180 degrees, which cause problematic forces. This will be handled in future versions of the code. And logically, I would suggest removing the torsion restriction for those angles. The platform can be handled through this argument in build_building_blocks and build_populations, which I currently set to None, meaning OpenMM will decide for itself.
This work was completed during my time as a postdoc, and then research fellow in the Pavan group at PoliTO (https://www.gmpavanlab.com/).