ZimmermanGroup / py-conformational-sampling

MIT License
8 stars 1 forks source link

py-conformational-sampling

py-conformational-sampling is an experimental python library for sampling conformers of a metal ligand complex and searching for a reaction path and corresponding transition state for each conformer.

Conformational sampling

The user provides an ancillary ligand and reactive ligands as structure files which this library reads and stores as stk (supramolecular toolkit) objects. The user also provides a description of binding atoms and a description of a reaction in the form of changes in bonding. This library generates an ensemble of conformers for each ligand, binds them to Pd, and performs an optimization and filtering funnel to refine the conformer ensemble. Then for each conformer, the user's reaction is carried out using pyGSM which looks for a reaction path and corresponding transition state.

Draft installation instructions

Note: the code for this project is written in python which is generally platform independent. The author is unaware of any dependencies that are tied to a specific operating system. However, currently development and testing are primarily conducted within a CentOS 7 linux high performance computing environment using pip and venv or anaconda for management of python and other dependencies. Example commands below are for linux and will vary slightly by platform. Python versions 3.8 and 3.11 are tested in github actions workflows.

Venv (built in virtual environment) installation

Note: on Windows, the dependency openbabel may be difficult to install.

git clone https://github.com/ZimmermanGroup/py-conformational-sampling.git

Create a python virtual environment using the built in python module venv as an isolated environment in which to install this library and its dependencies.

python -m venv .venv
source ./.venv/bin/activate
pip install -e .

Conda (alternative) installation

conda create -c conda-forge --name conformational-sampling python=3.11
conda activate conformational-sampling
pip install -e .

For developers:

To install in editable mode with extra packages for development and testing within visual studio code, substitute the following during the pip installation:

pip install -e .[dev,vscode]

Updating an existing installation:

If you have made changes to the example scripts or other files in this repository that you may want to keep, before updating you should first copy those files to a folder location outside this directory. If you are actively using this library but wish to try the latest version, having multiple versions of this repository in different difectory locations is an option. To update run:

# REMOVES ANY CHANGES YOU HAVE MADE TO FILES IN THIS REPOSITORY
git reset --hard

# updates this library to the latest version
git pull
pip install -e .

Getting started

Suzuki example from Organic Letters publication

cd examples/suzuki
python ./suzuki.py

Interactive visualization example

Note: assumes that the visualization is running on a remote computing cluster. If serving the visualization locally, omit the ssh tunneling step.

On the cluster containing the results of py-conformational-sampling calculations:

python dppe.py

On the local computer with an available web browser to view the visualization:

Note: the visualization is built using the Panel package. These instructions are based on the Panel documentation at https://panel.holoviz.org/how_to/server/index.html

Examples of only conformer generation step (outdated)

DPPE

cd examples/dppe
python ./slurm.py

Alonso's ligand

cd examples/alonso_ligand
python ./slurm.py

Output notes:

Using your own ligands

Notes:

functional_groups = [stk.SingleAtom(stk.C(73)), stk.SingleAtom(stk.O(22))]
stk_ligand = stk.BuildingBlock.init_from_molecule(
    stk_ligand,
    functional_groups=functional_groups
)