Skip to content

ChemKit Usage

from chem_kit import Molecule, Transformation

Molecules

mol = Molecule("Oc1ccc(cc1O)-c1cc(=O)c2c(O)cc(O)c(O)c2o1")
mol

Get SMILES

print("Cannonical smiles: ",mol.smiles)
print("Kekulized smiles: ",mol.smiles_kekulized)
Cannonical smiles:  O=C1C=C(c2ccc(O)c(O)c2)Oc2c(O)c(O)cc(O)c21
Kekulized smiles:  O=C1C=C(C2=CC=C(O)C(O)=C2)OC2=C(O)C(O)=CC(O)=C12

Highlight aromatics

mol.highlight_aromatics()

Transformation

Transformation is a kind of generic chemical reaction.

tsf = Transformation("[#6:1]-[#8:2]-[#1:3]>>[#6:1]-[#8:2]-[#6:3](-[#1])(-[#1])-[#1]")
tsf

Auto map atoms from smiles

tsf = Transformation.from_smiles("Oc1ccc(cc1O)-c1cc(=O)c2c(O)cc(O)c(O)c2o1", "COc1ccc(cc1O)-c1cc(=O)c2c(O)cc(O)c(O)c2o1")
tsf

Simplify the transformation

It keeps only changed atoms (reaction site) and bonds and specific atoms close to it

tsf.simplify()[0]