Noel, I had read that post, and I was aware of the fact that SMIRKS are not supported. Although, I thought the pattern I've tested was a tautomer-like pattern, and pretty similar to what OB does for fixing the pH and/or normalizing bonds.
I was trying to 'hijack' explicit hydrogens to transform them into other elements and add one atom at the time (i.e., [S:1][H:2] >> [S:1][C:2]), but it seems to me the current functionality is a bit more limited than I thought. In my tests, SMARTS patterns don't match mapped hydrogens, so for the molecule "CO": [O:1][H:2] : False [O][H] : True Nevertheless, even when you get a match, this transformation never happens: '[O][H] >> [O][N]' and sometimes I get a segfault. I know that prior to testing a SMARTS patter, explicit hydrogens are added to a copy of the molecule, but adding them beforehand doesn't change the outcome. I'm wondering if it is possible to start adding pieces to build up toward implementing this functionality. I while ago I started a discussion about the implementation of the Maximum Common Substructure in OpenBabel[1], and I got quite some positive feedback (including pointers to actual code). In fact, the Python code from Andrew Dalke seems a good starting point to me. Beside the McGregor approach you suggested in the thread I linked, I've also found this more recent algorithm, MultiMCS: http://pubs.acs.org/doi/pdf/10.1021/ci100297y dx.doi.org/10.1021/ci100297y Obviously, I'm have a particular interest in these features (MCS and reactions) but searching for solutions, I've found several people requesting them in the past. I know many alternative solutions are available (I've successfully used RDKit and Indigo), but I would prefer to use OpenBabel. If there's indeed some general interest, and developers think it's feasible, even if in the long run, I would be happy to work on it. Thanks! S [1] http://forums.openbabel.org/Maximum-common-substructure-MCS-with-OpenBabel-td4657949.html On 03/25/2016 05:57 AM, Noel O'Boyle wrote: > We don't support smirks. See > http://baoilleach.blogspot.co.uk/2012/08/transforming-molecules-intowellother.html?m=1 > > On 24 Mar 2016 9:33 p.m., "Stefano Forli" <fo...@scripps.edu > <mailto:fo...@scripps.edu>> > wrote: > > Hi all, > for a while, now, I'm banging my head on how to perform simple > modifications on molecules > (I wouldn't dare to call them reactions), but I'm having a hard time > getting anything > done. I'm using v2.3.2 with Python, and the core of my code is basically > this: > > reactor = ob.OBChemTsfm() > reactor.Init(start_pattern, end_pattern) > reactor.Apply(mol) > > Since I couldn't get it to work with my molecules, I've tested one simple > reaction example > from here [1]: > [CH2:1]=[CH:2][CH:3]=[CH:4][CH2:5][H:6]>> > [H:6][CH2:1][CH:2]=[CH:3][CH:4]=[CH2:5] > > and I found that it doesn't seem to work on a simple test molecule such > "C/C=C\C=C". > I think the problem is that the first part of the reaction is not > recognized using it as > SMARTS pattern, even without indexes (i.e. "[CH2]=[CH][CH]=[CH][CH2][H]"). > > The documentation suggests that OBChemTsfm is indeed the one to use to > perform chemical > transformations, while OBReaction holds only the information about it. > > I suspect I'm doing something wrong, but I can't figure out what it is. > Any advice on the matter? > > Thanks! > > S > > > > [1] > http://www.daylight.com/meetings/summerschool01/course/basics/smirks.html > > > -- > > Stefano Forli, PhD > > Assistant Professor of Integrative > Structural and Computational Biology, > Molecular Graphics Laboratory > > Dept. of Integrative Structural > and Computational Biology, MB-112A > The Scripps Research Institute > 10550 North Torrey Pines Road > La Jolla, CA 92037-1000, USA. > > tel: +1 (858)784-2055 > fax: +1 (858)784-2860 > email: fo...@scripps.edu <mailto:fo...@scripps.edu> > http://www.scripps.edu/~forli/ > > > ------------------------------------------------------------------------------ > Transform Data into Opportunity. > Accelerate data analysis in your applications with > Intel Data Analytics Acceleration Library. > Click to learn more. > http://pubads.g.doubleclick.net/gampad/clk?id=278785351&iu=/4140 > _______________________________________________ > OpenBabel-discuss mailing list > OpenBabel-discuss@lists.sourceforge.net > <mailto:OpenBabel-discuss@lists.sourceforge.net> > https://lists.sourceforge.net/lists/listinfo/openbabel-discuss > -- Stefano Forli, PhD Assistant Professor of Integrative Structural and Computational Biology, Molecular Graphics Laboratory Dept. of Integrative Structural and Computational Biology, MB-112A The Scripps Research Institute 10550 North Torrey Pines Road La Jolla, CA 92037-1000, USA. tel: +1 (858)784-2055 fax: +1 (858)784-2860 email: fo...@scripps.edu http://www.scripps.edu/~forli/ ------------------------------------------------------------------------------ Transform Data into Opportunity. Accelerate data analysis in your applications with Intel Data Analytics Acceleration Library. Click to learn more. http://pubads.g.doubleclick.net/gampad/clk?id=278785471&iu=/4140 _______________________________________________ OpenBabel-discuss mailing list OpenBabel-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/openbabel-discuss