Hi Hao, You can provide a SMARTS that matches any atom "*", but there's no way to provide a SMARTS that matches the absence of an atom.
If you want to construct queries that allow particularly atoms to be missing without having to create multiple SMARTS, the only way I can think of would be to build a query with all atoms and then to construct additional queries derived from those where those atoms have been removed. You can do this by converting the initial molecule into an RWMol and then calling the "RemoveAtom" method for each atom you want to make optional. Best, -greg On Fri, Aug 30, 2019 at 4:28 PM Hao <shenha...@gmail.com> wrote: > Hello, I would like to do a smarts query to match any atom including no > atom. Does anyone know something exist? For example, if ? were the > operator I want CC(?)C to match CC(C)C and CCC. I know I can do this with > something like C[C,$([*:1])]C, but I would prefer something simpler as if I > were to apply this to a benzene ring the smarts query would be large. > > Thanks! > Hao > _______________________________________________ > Rdkit-discuss mailing list > Rdkit-discuss@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/rdkit-discuss >
_______________________________________________ Rdkit-discuss mailing list Rdkit-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/rdkit-discuss