Thanks to visit codestin.com
Credit goes to github.com

Skip to content

LazyShion/GESim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

57 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GESim

How to setup

Requirements

  • Python: >= 3.11
  • gcc: 11.3.1 (or later)
  • rdkit: 2023.9.1
  • pybind11: 2.11.1

Installation

pip install --upgrade git+https://github.com/LazyShion/GESim.git

How to use

Calculate similarity

from rdkit import Chem
from gesim import gesim

mol1 = Chem.MolFromSmiles('Cc1nn(C2CCN(Cc3cccc(C#N)c3)CC2)cc1-c1ccccc1')
mol2 = Chem.MolFromSmiles('Cc1nn(C2CCN(Cc3cccc(Cl)c3)CC2)cc1-c1ccccc1')
mols = [mol1, mol2, Chem.MolFromSmiles('c1ccc(CN2CCC(n3nccc3-c3ccccc3)CC2)cc1')]

print(gesim.graph_entropy_similarity(mol1, mol2))
# 0.9580227325517037
print(gesim.graph_entropy_similarity_batch(mol1, mols))
# [1.0, 0.9580227325517037, 0.7766178810633495]

Visualize matched atoms

from rdkit import Chem
from rdkit.Chem import Draw

mol1 = Chem.MolFromSmiles('Cc1nn(C2CCN(Cc3cccc(C#N)c3)CC2)cc1-c1ccccc1')
mol2 = Chem.MolFromSmiles('Cc1nn(C2CCN(Cc3cccc(Cl)c3)CC2)cc1-c1ccccc1')

mol1_matched, mol2_matched = gesim.get_matched_mapping_numbers(mol1, mol2)
mol1_hal = [i for i, mv in enumerate(mol1_matched) if mv == 1]
mol2_hal = [i for i, mv in enumerate(mol2_matched) if mv == 1]

Draw.MolsToGridImage([mol1, mol2], highlightAtomLists=[mol1_hal, mol2_hal], molsPerRow=2, useSVG=True, subImgSize=(250, 200))

How to cite

@article{Shiokawa2025,
  title = {GESim: ultrafast graph-based molecular similarity calculation via von Neumann graph entropy},
  volume = {17},
  ISSN = {1758-2946},
  url = {http://dx.doi.org/10.1186/s13321-025-01003-6},
  DOI = {10.1186/s13321-025-01003-6},
  number = {1},
  journal = {Journal of Cheminformatics},
  publisher = {Springer Science and Business Media LLC},
  author = {Shiokawa, Hiroaki and Ishida, Shoichi and Terayama, Kei},
  year = {2025},
  month = apr 
}

Contact

  • Hiroaki Shiokawa
  • Shoichi Ishida

License

This package is distributed under the MIT license.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published