On May 8, 2014, at 5:47 PM, Craig James wrote: > Yes. As far as I know, it's the only way to get the correct answer. Your > original question essentially asked, "Is there a way to get OpenBabel to > change the semantics of SMARTS?" One could write such a substructure matcher, > but then it wouldn't be a SMARTS.
Hmm. I thought my original question was more along the lines of "Is this the right place to use OBIsomorphismMapper?" The documentation at http://openbabel.org/dev-api/classOpenBabel_1_1OBIsomorphismMapper.shtml says: ======= OBIsomorphismMapper Class Reference [Substructure Searching] ... While it is possible to construct these queries manually, "compilers" are provided to convert a query representation to a OBQuery object. Currently, only two exact substructure search compilers exist. The first is CompileMoleculeQuery which converts an OBMol object to an OBQuery object. The second is CompileSmilesQuery and converts a smiles string to an OBQuery object. OBMol *queried; // ... initialize queried ... OBQuery *query = CompileSmilesQuery("c1ccccc1"); OBIsomorphismMapper *mapper = OBIsomorphismMapper::GetInstance(query); OBIsomorphismMapper::Mappings maps = mapper->MapUnique(mol); std::cout << "found " << maps.size() << " unique mappings" << std::endl; delete mapper; delete query; ======= Since that deals with a SMILES-generated substructure query, I figured I wasn't asking anything about SMARTS semantics. Instead, I was thinking that someone might have an example of how to construct the precise OBQuery molecule with the semantics I wanted, or say that it isn't possible. Cheers, Andrew da...@dalkescientific.com ------------------------------------------------------------------------------ Is your legacy SCM system holding you back? Join Perforce May 7 to find out: • 3 signs your SCM is hindering your productivity • Requirements for releasing software faster • Expert tips and advice for migrating your SCM now http://p.sf.net/sfu/perforce _______________________________________________ OpenBabel-discuss mailing list OpenBabel-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/openbabel-discuss