On Mon, Nov 3, 2008 at 4:19 AM, Robert DeLisle <rkdeli...@gmail.com> wrote: > I could go with the AcceptorsPlusFluorines() function option. Either way > works for me. > > Another thought I had that would likely required more work would be to allow > the import of custom definitions. If I could import a set of SMARTS > definitions, I could easily customize any pharmacophoric element without > having to modify code. This would at least partially avoid the problem of > custom definitions breaking upon public distribution as long as the custom > definitions were included along with any distribution of code.
If you're looking for a general-purpose mechanism for counting numbers of SMARTS-defined features, there is one already present in $RDBASE/Python/Chem/Fragments.py that you may be able to use. That machinery reads a set of names, descriptions, and SMARTS-based feature definitions from a text file -- $RDBASE/Data/FragmentDescriptors.csv (it's a bad name, because that's a tab-separated file) by default -- and constructs the corresponding descriptor functions. If you're looking for pharmacophoric point definitions (instead of descriptors for use in QSAR and the like), then it's probably best to look at the chemical feature functionality that uses the FDEF file mentioned earlier on this thread. -greg