Hi,? ? I tryied using rdkit to match fragments with compounds only to find that 
rdkit performed not well in SMARTS. The following is the notebook I worked.
from rdkit import Chem
from rdkit.Chem import AllChem
from rdkit.Chem import FragmentMatcher
from rdkit.Chem.Draw import IPythonConsole
In?[49]:p = FragmentMatcher.FragmentMatcher()
p.Init('[a!r0][NX3+](=[OX1])([O-])')
In?[50]:mol  = Chem.MolFromSmiles('c1ccccc1[N+](=O)[O-]')
mol
Out[50]:In?[51]:p.HasMatch(mol)
Out[51]:0In?[52]:print Chem.MolFromSmarts('[a!r0][NX3+](=[OX1])([O-])')
None
However, openbabel worked well in matching the substrcutre. Even "or operator" 
was avaiable such as "[a!r0][$([NX3+](=[OX1])([O-])),$([NX3](=O)=O)]".?
>>> s=pybel.Smarts('[a!r0][NX3+](=[OX1])([O-])')

>>> s=pybel.Smarts('[a!r0][NX3+](=[OX1])([O-])')

>>> a=pybel.readstring('smi','c1ccccc1[N+](=O)[O-]')

>>> s.findall(a)

[(6, 7, 8, 9)]
It is a pity that rdkit can calculate the topological distance between two 
atoms while it cannot match the fragments... Is there any better API which I 
didn't find?


Hongbin Yang 杨弘宾

Research: Toxicophore and Chemoinformatics
Pharmaceutical Science, School of Pharmacy

East China University of Science and Technology?


------------------------------------------------------------------------------
The Command Line: Reinvented for Modern Developers
Did the resurgence of CLI tooling catch you by surprise?
Reconnect with the command line and become more productive. 
Learn the new .NET and ASP.NET CLI. Get your free copy!
http://sdm.link/telerik
_______________________________________________
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss

Reply via email to