From: Daniel C. M. <Dan...@uc...> - 2003-02-06 18:30:50
|
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=20 (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, >=20 > > [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=20 > generate ! >=20 > Have a look at the examples at > http://www-ra.informatik.uni-tuebingen.de/software/joelib/tutorial/functi= onalities/mol-smarts.html >=20 > 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 ! >=20 > 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/functi= onalities/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)) > { >=20 > 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."); > } > } >=20 > 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=20 > to search such errors. A flexible and transparent text based soulution > would be recommended (as in OpenBabel and JOELib shown for simpler > tasks). >=20 > If you want to do this for a lot of different patterns you could also=20 > use SMILES patterns which could be added automatically (if you have a=20 > 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=20 > this pattern. > The JOEChemTransformation (or a modified version) class can be used > with=20 > 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 >=20 > 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,=20 > Erlangen, Germany) with more atom/bond properties in JOELib > (CTX import) ! They used these descriptors also for this task > (CACTVS program). >=20 > 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=20 > can not implement AND test them, because i've other main tasks in my=20 > project. >=20 > Best regards, Joerg >=20 >=20 > > Hello, I'm currently an OpenBabel user, but am interested in > > "converting" > >=20 > > I'm mostly interested in SMILES/SMARTS transformations capabilities. > >=20 > > In particular, Can I represent the following transformation: > >=20 > > CC=3DO =3D> CC(O)=3DO > >=20 > > I tried this (in OpenBabel) > >=20 > > [C:1]=3D[O:2]>>[C:1](O)=3D[O:2] > >=20 > > But it didn't work. > >=20 > > 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. > >=20 > > Can JOElib do this sort of thing? > >=20 > > Of course, t is quite likely this is due to my lack of SMARTS > knowledge > > rather than the software ;) > >=20 >=20 >=20 > --=20 > 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 --=20 Daniel Charles McShan <Dan...@uc...> University of Colorado Health Science Center |