From: Geoff H. <hut...@ch...> - 2003-02-06 19:41:52
|
There's really no reason it can't add atoms, IMHO. The class itself is exposed mostly through adding hydrogens. I do have some ideas about how that would be implemented in Open Babel, but things are a bit busy here with an oral exam coming up soon. And I'd certainly be interested to know about LISP uses of Open Babel! -- -Geoff Hutchison=09=09<hut...@ch...> Marks/Ratner Groups=09=09(847) 491-3295 Northwestern Chemistry=09=09<http://www.chem.northwestern.edu> On 6 Feb 2003, Daniel Charles McShan wrote: > Hmm, it does seem that while the ChemTransformation class was perhaps > unintended as a general transformation mechanism we could us it as such. > > Consider: > > sh-2.05a$ ./transform CO [C:1][O:2] [C:1]=3D[O:2] > CO - [C:1][O:2] + [C:1]=3D[O:2] =3D> C=3DO > > (This is using openbabel - I just exposed their transformation class to > the command line - the first argument is the smiles for the starting > molecule, the second is the "search" and the third is the "replace") > > So the example above works great. But, as we've noted, you can't just > add atoms. But I wonder if we can add this capability to the transform > class? The other solutions you offer might work if I was working in > java, but I program in lisp, so I'm really looking for a general API > that I can either access from the command line or a library call... > > Ultimately, though, I suppose all I'm really looking for is regular > expression search/replace for graphs (in particular chemical graphs). > > I'll give this some more thought and keep you posted on what I come up > with... > > Thanks! > > Dan > > On Thu, 2003-02-06 at 04:42, "J=F6rg K. Wegner" wrote: > > Hello Daniel, > > > > > [C:1]=3D[O:2]>>[C:1](O)=3D[O:2] > > no, adding atoms isn't implemented. Additionally this looks weird !;-) > > because the transformation is based on two SMARTS substructure > > searches > > and the second pattern implies already the product which you want to > > generate ! > > > > Have a look at the examples at > > http://www-ra.informatik.uni-tuebingen.de/software/joelib/tutorial/func= tionalities/mol-smarts.html > > > > For what is this facility used --> (de)protonation model ! > > joelib/src/joelib/data/JOEChemTransformation > > loading transformations:lines 161-180 > > doing transformations:lines 330-344 > > the problem is, that the transformation informations (vector bindings) > > must be stored in joelib/src/joelib/smarts/JOESmartsPattern > > It's not designed to apply all kind of chemical transformations ! > > > > If you want to do that, i would recommend a Patty search: > > 1. see example joelib/src/joelib/test/TestPatty > > 2. i would recommend the pattern (only BO=3D2): > > [CQ2(=3DO)C] carbonylC > > see > > http://www-ra.informatik.uni-tuebingen.de/software/joelib/tutorial/func= tionalities/mol-smarts.html > > 3. now you can add the following things in > > joelib/src/joelib/test/TestPatty:line 144 > > if(typeString.equals("carbonylC")) > > { > > JOEAtom add2atom =3D mol.getAtom(i1); > > JOEAtom addAtom =3D new JOEAtom(); > > addAtom.setAtomicNum(JOEElementTable.instance().getAtomicNum("O")); > > addAtom.setType("O"); > > if (!mol.addAtom(addAtom)) > > { > > > > throw new MoleculeIOException("Atom could not be added."); > > } > > if (!mol.addBond(add2atom.getIdx(), addAtom.getIdx(), 1, 0)) > > { > > throw new MoleculeIOException("Bond could not be added."); > > } > > } > > > > or alternative (better) solution, because it's no good idea to use > > a hard coding of such tasks. One error and you can invest a lot of > > time > > to search such errors. A flexible and transparent text based soulution > > would be recommended (as in OpenBabel and JOELib shown for simpler > > tasks). > > > > If you want to do this for a lot of different patterns you could also > > use SMILES patterns which could be added automatically (if you have a > > method for that !;-), e.g. > > BO1 SMILES1 B2 S2 ...||reaction ||transformation t2 t3 ... > > 1 O ||ox_acetobacter|| > > 1 H ||reduction ||C:1]=3D[O:2]>>[C:1]-[H:2] > > ... > > The first number gives the bond order for the new connection and the > > SMILES pattern the pattern to be added starting at the first atom of > > this pattern. > > The JOEChemTransformation (or a modified version) class can be used > > with > > another input file to take standard atom,charge and bond modifications > > into account. > > It's possible to add your own ReactTransformation class to > > joelib/data and > > the data for this task to > > joelib/data/plain > > > > By the way, do you known the atom property descriptors in JOELib ? > > Eventually you can use these descriptors for reactivity prediction. > > Additionally you can use the Petra descriptors (Prof. Gasteiger, > > Erlangen, Germany) with more atom/bond properties in JOELib > > (CTX import) ! They used these descriptors also for this task > > (CACTVS program). > > > > I hope that will help you ! > > I would be pleased if you will adapt JOELib for your needs. I would > > help you to join your classes into JOELib (if you're interested), but > > i > > can not implement AND test them, because i've other main tasks in my > > project. > > > > Best regards, Joerg > > > > > > > Hello, I'm currently an OpenBabel user, but am interested in > > > "converting" > > > > > > I'm mostly interested in SMILES/SMARTS transformations capabilities. > > > > > > In particular, Can I represent the following transformation: > > > > > > CC=3DO =3D> CC(O)=3DO > > > > > > I tried this (in OpenBabel) > > > > > > [C:1]=3D[O:2]>>[C:1](O)=3D[O:2] > > > > > > But it didn't work. > > > > > > I'd actually hoped it could be as simple as C=3DO>>C(O)=3DO, but this > > was > > > not to be, so I'm looking around for other options. > > > > > > Can JOElib do this sort of thing? > > > > > > Of course, t is quite likely this is due to my lack of SMARTS > > knowledge > > > rather than the software ;) > > > > > > > > > -- > > Dipl. Chem. Joerg K. Wegner > > Univ. Tuebingen, Computer Architecture, Sand 1, D-72076 Tuebingen, > > Germany > > Tel. (+49/0) 7071 29 78970, Fax (+49/0) 7071 29 5091 > > E-Mail: mailto:we...@in... > > WWW: http://www-ra.informatik.uni-tuebingen.de > -- > Daniel Charles McShan <Dan...@uc...> > University of Colorado Health Science Center > > > ------------------------------------------------------- > This SF.NET email is sponsored by: > SourceForge Enterprise Edition + IBM + LinuxWorld http://www.vasoftware.c= om > _______________________________________________ > OpenBabel-discuss mailing list > Ope...@li... > https://lists.sourceforge.net/lists/listinfo/openbabel-discuss > |