Replies: 2 comments
-
You’ll want to use the FilterCatalog https://www.rdkit.org/docs/source/rdkit.Chem.rdfiltercatalog.html I’m traveling today, but can get a proper example tomorrow, however the test suite may help you out: |
Beta Was this translation helpful? Give feedback.
0 replies
-
Thanks @bp-kelley, After looking into from rdkit import Chem
from rdkit import FilterCatalog
catalog = FilterCatalog.FilterCatalog()
for k, v in smarts_library.items():
# create RDKit molecule
m = Chem.MolFromSmarts(v)
# create SMARTS matcher
sm = FilterCatalog.SmartsMatcher(m)
# add entry to FilterCatalog
entry = FilterCatalog.FilterCatalogEntry(k, sm)
catalog.AddEntry(entry)
smiles = "C1N=CC=C(C(=O)Cl)C=1"
matches = catalog.GetMatches(Chem.MolFromSmiles(smiles))
for match in matches:
print(match.GetDescription())
# matches in SMARTS catalog:
# - AcidHalide_Chloride_Het6 pattern
# - Heterocycle6 pattern Is this the solution that you thought about? Cheers, |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello community!
I'm currently trying to build a fixed library of SMARTS patterns that I'd like to use to match via substructure search on molecules. I came across the
rdkit.Chem.rdSubstrucLibrary
, but I assume that this is exactly the inverse case with one pattern and many molecules in a library.Currently, I have a brute force ansatz iterating over the SMARTS library,
which I assume is not very efficient. Has someone experience with screening hundreds of SMARTS pattern on molecules in an efficient way? The aim of this is to create a substructure fingerprint that incorporates fixed identifiers of matched substructures - identifiers in the SMARTS library will not change in the future.
Beta Was this translation helpful? Give feedback.
All reactions