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.
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.
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.
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 create -c conda-forge --name conformational-sampling python=3.11
conda activate conformational-sampling
pip install -e .
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]
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 .
cd examples/suzuki
python ./suzuki.py
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:
start_visualization = True
in dppe.py, then run the script to start the server which loads the molecular data and hosts the visualization:python dppe.py
On the local computer with an available web browser to view the visualization:
ssh -NfL localhost:5006:localhost:5006 <user@remote.host>
http://localhost:5006
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
cd examples/dppe
python ./slurm.py
cd examples/alonso_ligand
python ./slurm.py
Output notes:
config.max_dft_opt_steps = 2
to test the integration and configuration of the DFT calculator in minutes. For fully optimized structures, increase to a larger number (e.g. 100) to allow most geometry optimizations to fully converge. This will likely take hours.config.initial_conformers
especially for smaller or more rigid molecules. Threshold for uniqueness can be configured with config.pre_xtb_rms_threshold
.config.max_connectivity_changes
. Conformers are then sorted by energy, with the lowest energy first.Notes:
stk_ligand = load_stk_mol(ligand_path, fmt='mol')
for a mol file)__init__.py
file, but this will not take effect if you import xtb before conformational_samplingfunctional_groups = [stk.SingleAtom(stk.C(73)), stk.SingleAtom(stk.O(22))]
stk_ligand = stk.BuildingBlock.init_from_molecule(
stk_ligand,
functional_groups=functional_groups
)