/molfunc

fast functionalisation of molecules

Primary LanguagePythonMIT LicenseMIT

Build Status codecov PyPI version License: MIT

alt text

molfunc

About

molfunc is a Python tool for functionalisation of 3D molecules. Given a .xyz file molecular functionalisation is performed by specifying monovalent atoms in the structure to swap for a set of fragments given as their corresponding SMILES strings. The energy of the combined molecule is minimised with purely rigid body rotations. Possible use cases include catalyst functionalisation, ligand modification and combinatorial molecule generation.


Installation

If the requirements (rdkit, numpy, scipy, networkx) are already satisfied:

pip install molfunc

Otherwise, clone this repository and cd into the top level molfunc directory:

git clone https://github.com/duartegroup/molfunc.git
cd molfunc/

install the Python dependencies using conda (anaconda or miniconda) and install:

conda config --append channels conda-forge
conda install --file requirements.txt
python setup.py install

Usage

A minimal example to convert PH3 to PMe3

from molfunc import CoreMolecule, CombinedMolecule

ph3 = CoreMolecule(xyz_filename='examples/PH3.xyz', atoms_to_del=[2, 3, 4])
pme3 = CombinedMolecule(core_mol=ph3, frag_smiles='C[*]', name='PMe3')
pme3.print_xyz_file()

molfunc can also be used from the command line

molfunc examples/PH3.xyz -a 2 3 4 -s C[*]

where in both cases all hydrogen atoms are swapped for methyls. See examples/ for more examples.