From: Nina J. <jel...@gm...> - 2015-04-23 17:54:17
|
Thanks. One more inquiry - could you run mvn dependency:tree on your project with ambit 3.0.0 and tell which net.idea.modbcum-i version is required And possibly check if it is here http://ambit.uni-plovdiv.bg:8083/nexus/#nexus-search;gav~net.idea~modbcum-i~~~~kw,versionexpand Regards, Nina On 23 April 2015 at 20:42, Yannick .Djoumbou <y.d...@gm...> wrote: > Hi Nina, > > I got some help from John regarding kekulization and how to go around type > 4 bonds. I attached the class SmirksTest.java. Some included CDK classes > are not in this code though. > > I changed my code from the previous one, and I am adding implicit H > atoms., converting them to explicit ones, and I kekulize the molecule. > John suggested setting the flag of each bond to ISAROMATIC when its is set > to SINGLE_OR_DOUBLE, as well as seeting the flag for the 2 participant > atoms to ISAROMATIC. this is done before kekulaiation (from the > Kekulization class). > > Now, I get metabolites when the input structure is in aromatic (not > kekule) form (see MOL1, output_1, and mol1_metabolites). however, when I > submit the structure in kekule form (MOL2, output_2), I do not get any > metabolite. > > The SMIRKS I used is: [c:1][H:2]>>[c:1][OX2][H:2] (I also tried > [c;H1:1]>>[c:1][OX2H1]) > > Thank you for your help. > > Regards, > > > On Thu, Apr 23, 2015 at 11:07 AM, Nina Jeliazkova < > jel...@gm...> wrote: > >> Hi Yannick, >> >> On 23 April 2015 at 19:17, Yannick .Djoumbou <y.d...@gm...> >> wrote: >> >>> Hi Nina, >>> >>> You mentioned early that SMIRKS needs the structures to be kekulized. I >>> assumed that it means every bond of type 4 will be changed to type 1 or 2, >>> but still be labeled as aromatic. Am I right? >>> This means, I should not used the Aromatize function then. I should make >>> sure the structure is always kekulize. Therefore, I should use the >>> kekuliseAromaticRings() from FixBondOrdersTool, right? >>> >> >> No, FixBondOrdersTool is deprecated, don't use it. Use the new >> Kekulization class. John May may help with how to use it. >> >> >> http://cdk.github.io/cdk/1.5/docs/api/org/openscience/cdk/aromaticity/Kekulization.html >> >> >>> >>> Moreover, I have the following error when using ambit2 3.0.0. It >>> tdoesn't mattr whether I use CDK 1.5.6 (as I did before with ambit 2.5.6) >>> or 1.5.10. >>> >>> Exception in thread "main" java.lang.NoClassDefFoundError: >>> net/idea/modbcum/i/exceptions/AmbitException >>> at Metabolize.main(Metabolize.java:35) >>> Caused by: java.lang.ClassNotFoundException: >>> net.idea.modbcum.i.exceptions.AmbitException >>> at java.net.URLClassLoader$1.run(URLClassLoader.java:366) >>> at java.net.URLClassLoader$1.run(URLClassLoader.java:355) >>> at java.security.AccessController.doPrivileged(Native Method) >>> at java.net.URLClassLoader.findClass(URLClassLoader.java:354) >>> at java.lang.ClassLoader.loadClass(ClassLoader.java:424) >>> at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308) >>> at java.lang.ClassLoader.loadClass(ClassLoader.java:357) >>> ... 1 more >>> >>> Metabolize.java is the class where I call the main function that uses >>> the AMBIT and CDK modules. I did not have this error before moving to 3.0.0. >>> >> >> Can you give a piece of code we can test? It looks like a missing/ not >> loaded dependency. >> >> Regards, >> Nina >> >> >> >>> Please let me know. >>> >>> Regards, >>> >>> On Tue, Apr 21, 2015 at 10:54 PM, Yannick .Djoumbou < >>> y.d...@gm...> wrote: >>> >>>> Thanks for letting me know. >>>> Regards, >>>> >>>> Yannick >>>> >>>> On Tue, Apr 21, 2015 at 10:44 PM, Nina Jeliazkova < >>>> jel...@gm...> wrote: >>>> >>>>> Yannick, >>>>> >>>>> Just a warning, 3.0.0 is still being tested and not released yet, but >>>>> the SMIRKS package was tested by another group as well and appears to work >>>>> well. >>>>> >>>>> Best regards, >>>>> Nina >>>>> >>>>> >>>>> On 22 April 2015 at 07:38, Yannick .Djoumbou <y.d...@gm...> >>>>> wrote: >>>>> >>>>>> Thanks Nina, >>>>>> >>>>>> first of all, I am really happy that a new release of AMBIT was >>>>>> released and is working with CDK 1.5.10. I'll try that out and also use the >>>>>> aromaticity class. >>>>>> I a looking forward to reading Nick's reply. >>>>>> >>>>>> Regards, >>>>>> >>>>>> Yannick >>>>>> >>>>>> On Tue, Apr 21, 2015 at 10:32 PM, Nina Jeliazkova < >>>>>> jel...@gm...> wrote: >>>>>> >>>>>>> Yannick, >>>>>>> >>>>>>> Nick may reply later this week, but could you please try ambit >>>>>>> 3.0.0-SNAPSHOT (CDK 1.5.10) dependency >>>>>>> >>>>>>> >>>>>>> http://ambit.uni-plovdiv.bg:8083/nexus/#nexus-search;gav~ambit~~3.0.0-SNAPSHOT~~ >>>>>>> >>>>>>> The version you work with is quite outdated and there have been >>>>>>> number of improvements. >>>>>>> >>>>>>> Last but not least, the SMIRKS package expects Kekule structures. >>>>>>> You will NOT get same results if structures are not kekulized. Fortunately, >>>>>>> in CDK 1.5.10 the kekulization works quite well. >>>>>>> >>>>>>> In any case please do not use SMSD* package, it is already >>>>>>> deprecated in CDK as far as I know. Use the new Aromaticity class >>>>>>> >>>>>>> >>>>>>> http://cdk.github.io/cdk/1.5/docs/api/org/openscience/cdk/aromaticity/Aromaticity.html >>>>>>> >>>>>>> Best regards, >>>>>>> Nina >>>>>>> >>>>>>> >>>>>>> On 21 April 2015 at 21:07, Yannick .Djoumbou <y.d...@gm...> >>>>>>> wrote: >>>>>>> >>>>>>>> Hello guys, >>>>>>>> >>>>>>>> I am dealing with an issue here. I would like to apply a >>>>>>>> transformation on the attached molecules. Below is a function that I wrote >>>>>>>> to apply a transformation with single copy for each position (with >>>>>>>> smrkMan.applyTransformationWithSingleCopyForEachPos). Because CDK has >>>>>>>> issues dealing with bond type 4, I tried to transform the same molecule >>>>>>>> (aniline) using different bond types. >>>>>>>> In test1.sdf, the bond types in the benzene ring have type 1 and 2, >>>>>>>> alternatively. This, however produces 5 metabolites. In test2.sdf, >>>>>>>> the aromatic bonds of the molecule are of type 4. The transformation does >>>>>>>> not produce any product, which is wrong. >>>>>>>> >>>>>>>> Procedure: >>>>>>>> ---------- >>>>>>>> (1) I tested whether CDK viewed the input molecule as aromatic or >>>>>>>> not, by checking the bond types. For my own preference, I also >>>>>>>> added explicit hydrogen atoms in order to use my smirks pattern more >>>>>>>> efficiently. For test1, aniline is not first viewed as aromatic. >>>>>>>> Thus, I aromatized it using CDK's SMSDNormalizer.aromatizeMolecule. In >>>>>>>> test2, aniline is viewed as aromatic. Because the bonds in the benzene ring >>>>>>>> are of type 4, I decided to kekulize it, so that CDK with better >>>>>>>> deal with the molecule. Somehow, the resulting molecule still has bond type >>>>>>>> 4. The resulting molecules after these edits are stored in >>>>>>>> test1_after_aromatizing_and_adding_hydrogen.sdf and >>>>>>>> test2_after_kekulizing_and_adding_hydrogen.sdf. Somehow, the molecule in >>>>>>>> the later files does not have explicit hydrogen atoms attached to the >>>>>>>> benzene ring. >>>>>>>> >>>>>>>> (2) Following the first step, I ran >>>>>>>> smrkMan.applyTransformationWithSingleCopyForEachPos on the container >>>>>>>> obtained after the first step, where smrkMan is an instance of the SMRIKS >>>>>>>> Manager. As mentioned earlier, aniline in the first form (ring bonds with >>>>>>>> types 1 and 2) was transformed. the five products are in the file >>>>>>>> test1_metabolites.sdf. In the second file (ring bonds with type 4) >>>>>>>> is not transformed. >>>>>>>> I used the smirks: [c;H1:1]>>[c:1][OX2H1] and [c:1]>>[c:1][OX2H1] >>>>>>>> foe each molecule, which returned the same output. >>>>>>>> This procedure was implemented in the function transform_from_sdf >>>>>>>> below. >>>>>>>> >>>>>>>> >>>>>>>> Could you please help me here? How can I get the same results >>>>>>>> whether I submit my molecule in the kekule or the aromatic form? I have >>>>>>>> tried different things, but without success. by the way, I am using the >>>>>>>> AMBIT 2.6.0 and CDK version 1.5.6 versions. I really need help >>>>>>>> here. >>>>>>>> >>>>>>>> Thank you for your consideration. >>>>>>>> >>>>>>>> Best regards, >>>>>>>> >>>>>>>> Yannick >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> public LinkedHashMap<String, IAtomContainerSet> >>>>>>>> transform_from_sdf(File sdf_input, SMIRKSReaction reaction) throws >>>>>>>> Exception{ >>>>>>>> >>>>>>>> LinkedHashMap<String, IAtomContainerSet> sdf_metabolites = new >>>>>>>> LinkedHashMap<String, IAtomContainerSet>(); >>>>>>>> IteratingSDFReader reader = new IteratingSDFReader(new >>>>>>>> FileInputStream(sdf_input), DefaultChemObjectBuilder.getInstance()); >>>>>>>> SMIRKSManager smrkMan = new >>>>>>>> SMIRKSManager(SilentChemObjectBuilder.getInstance()); >>>>>>>> >>>>>>>> StringWriter writer=new StringWriter(); // >>>>>>>> http://www.programcreek.com/java-api-examples/index.php?api=org.openscience.cdk.AtomContainerSet >>>>>>>> >>>>>>>> StructureDiagramGenerator sdg = new >>>>>>>> StructureDiagramGenerator(); >>>>>>>> DeduceBondSystemTool dbst = new DeduceBondSystemTool(); >>>>>>>> FixBondOrdersTool kekulizer = new FixBondOrdersTool(); >>>>>>>> >>>>>>>> int i = 0; >>>>>>>> while (reader.hasNext()) { >>>>>>>> i = i+1; >>>>>>>> >>>>>>>> IAtomContainer molecule = (IAtomContainer)reader.next(); >>>>>>>> System.out.println("Query molecule: " + molecule); >>>>>>>> >>>>>>>> boolean aromatic_0 = false; >>>>>>>> for (IBond bond : molecule.bonds()) if >>>>>>>> (bond.getFlag(CDKConstants.ISAROMATIC)) {aromatic_0 = true; break;} >>>>>>>> >>>>>>>> System.out.println("IS THE ORIGINAL MOLECULE AROMATIC?: " + >>>>>>>> aromatic_0); >>>>>>>> >>>>>>>> >>>>>>>> StringWriter w = new StringWriter(); >>>>>>>> MDLWriter mw = new MDLWriter(w); >>>>>>>> mw.write(molecule); >>>>>>>> System.out.println("ORIGINAL MOLECULE" + w.toString()); >>>>>>>> >>>>>>>> >>>>>>>> AtomContainerManipulator.convertImplicitToExplicitHydrogens(molecule); >>>>>>>> sdg.setMolecule(molecule); >>>>>>>> sdg.generateCoordinates(); >>>>>>>> IAtomContainer mol_with_hydrogen = sdg.getMolecule(); >>>>>>>> >>>>>>>> >>>>>>>> if(!aromatic_0){ >>>>>>>> SMSDNormalizer.aromatizeMolecule(mol_with_hydrogen); >>>>>>>> boolean aromatic = false; >>>>>>>> for (IBond bond : mol_with_hydrogen.bonds()) if >>>>>>>> (bond.getFlag(CDKConstants.ISAROMATIC)) {aromatic = true; break;} >>>>>>>> System.out.println("HAS THE MOLECULE BEEN AROMATIZED?: >>>>>>>> " + aromatic); >>>>>>>> mw.write(mol_with_hydrogen); >>>>>>>> System.out.println("AROMATIZED MOLECULE WITH HYDROGEN >>>>>>>> EXPLICIT ATOMS" + w.toString()); >>>>>>>> >>>>>>>> } >>>>>>>> else{ >>>>>>>> >>>>>>>> AtomContainerManipulator.percieveAtomTypesAndConfigureAtoms(mol_with_hydrogen); >>>>>>>> mol_with_hydrogen = >>>>>>>> kekulizer.kekuliseAromaticRings(mol_with_hydrogen); >>>>>>>> mw.write(mol_with_hydrogen); >>>>>>>> System.out.println(mol_with_hydrogen); >>>>>>>> System.out.println("AROMATIZED MOLECULE WITH HYDROGEN >>>>>>>> EXPLICIT ATOMS" + w.toString()); >>>>>>>> >>>>>>>> boolean aromatic_3 = false; >>>>>>>> for (IBond bond : mol_with_hydrogen.bonds()) if >>>>>>>> (bond.getFlag(CDKConstants.ISAROMATIC)) {aromatic_3 = true; break;} >>>>>>>> System.out.println("IS AROMATIC AFTER HYDRO?? " + >>>>>>>> aromatic_3); >>>>>>>> } >>>>>>>> >>>>>>>> >>>>>>>> System.out.println(mol_with_hydrogen); >>>>>>>> SmilesGenerator sg = new SmilesGenerator(); >>>>>>>> System.out.println(sg.create(mol_with_hydrogen)); >>>>>>>> >>>>>>>> >>>>>>>> String name = (String) >>>>>>>> molecule.getProperty(CDKConstants.TITLE); >>>>>>>> IAtomContainerSet metabolites = >>>>>>>> generateAllMetabolitesFromAtomContainer(mol_with_hydrogen, reaction, >>>>>>>> smrkMan); >>>>>>>> System.out.println("METABOLITES" + metabolites); >>>>>>>> } >>>>>>>> >>>>>>> >>>>>>> >>>>>> >>>>> >>>> >>> >> > |