From: Nikolay K. <ni...@un...> - 2014-03-05 07:57:39
|
Hi Yannick, Nina has given you good advices concerning the compilation and integration problems (I will not add to these). I would like to add few comments on the test cases mentioned in your first mail. I tested all these SMIRKS in pure java approach and they work fine. The first test case ([*;#6:1][C:2]#[C:3][*;#6:4]>>[*:1]/[C:2](/[H])=[*:3](/[H])[C:4]) generates parser error. I clarified this below after the java code. The second test case in my mail is the first test corrected in order to be parsed without problems. Here is the testing code for my tests (it is quite analogous to the one shown in the examples on the Ambit web page) public void testSMIRKS(String smirks, String targetSmiles)throws Exception { System.out.println("Testing SMIRKS: " + smirks); SMIRKSManager smrkMan = new SMIRKSManager(SilentChemObjectBuilder.getInstance()); SMIRKSReaction reaction = smrkMan.parse(smirks); if (!smrkMan.getErrors().equals("")) { System.out.println(smrkMan.getErrors()); return; } if (targetSmiles.equals("")) return; IAtomContainer target = SmartsHelper.getMoleculeFromSmiles(targetSmiles); smrkMan.applyTransformation(target, reaction); String transformedSmiles = SmartsHelper.moleculeToSMILES(target); System.out.println("Reaction application: " + targetSmiles + " --> " + transformedSmiles); } ... testSMIRKS("[*;#6:1][C:2]#[C:3][*;#6:4]>>[*:1]/[C:2](/[H])=[*:3](/[H])[C:4]","COCCCC#CCCC"); testSMIRKS("[*:1][C:2]#[C:3][*;#6:4]>>[*:1]/[C:2](/[H])=[C:3](/[H])[C:4]","COCCCC#CCCC"); //corercted one testSMIRKS("[*;#6:1][C:2]=[O:3]>>[*;#6:1][C:2]-[O:3][*;#6]","CCCC=O"); testSMIRKS("[C:1]=O>>[C:1]1OCCO1","CCCCCCC=O"); testSMIRKS("[*:1]C(=O)O>>[*:1]C(N)=O","CCCCCCC(=O)O"); And here is the result output from the code above: Testing SMIRKS: [*;#6:1][C:2]#[C:3][*;#6:4]>>[*:1]/[C:2](/[H])=[*:3](/[H])[C:4] Map 1 atom types are inconsistent! Map 3 atom types are inconsistent! Testing SMIRKS: [*:1][C:2]#[C:3][*;#6:4]>>[*:1]/[C:2](/[H])=[C:3](/[H])[C:4] Reaction application: COCCCC#CCCC --> [H]C(=C([H])CCCOC)CCC Testing SMIRKS: [*;#6:1][C:2]=[O:3]>>[*;#6:1][C:2]-[O:3][*;#6] Reaction application: CCCC=O --> COCCCC Testing SMIRKS: [C:1]=O>>[C:1]1OCCO1 Reaction application: CCCCCCC=O --> C1COC(O1)CCCCCC Testing SMIRKS: [*:1]C(=O)O>>[*:1]C(N)=O Reaction application: CCCCCCC(=O)O --> NC(=O)CCCCCC Just few comments for the first test case: Ambit SMARTS/SMIRKS parser has STRICT rules for the mapped atom types. The atom types corresponding to the same mapping index on the left (reactant) and on the right (products) must be of the same type otherwise parser interprets this as an error. For the following SMIRKS [*;#6:1][C:2]#[C:3][*;#6:4]>>[*:1]/[C:2](/[H])=[*:3](/[H])[C:4] we have [*;#6:1] >> [*:1] i.e. the left is carbon and right is any atom (wild card only) Also bear in mind that [*;#6:1] is equivalent to [#6:1] so the first token '*' is not needed. Analogously parser produces error message for: [*;#6:4] >> [*:3] This requirement for same atoms types is not applied for NOT-MAPPED atoms in the SMIRKS expression. Actually not mapped atoms are interpreted as atoms(fragments) been removed on the left and atoms (fragments) been added on the right. That is why it is not required to be of the same type. For example: this SMIRKS is OK [C:1]N>>[C:1]O I hope my comments would be helpful as well. Best regards Nick On 2014-03-04 20:39, Yannick .Djoumbou wrote: > Hi Nina, > > According to your last email and to the information on this file [4], > there is a separate ambit-smirks-2.5.4- module, which is an extension > of ambit-smarts. Well, I could not find a downloadable jar file on the > web. Looking at the file I attached, is it OK to have those require > libraries, or do i explicitly require the ambit-smirks library beside > ambit-core, ambit-smarts, and ambit-core? > > Cheers, > > Yannick > > On Mon, Mar 3, 2014 at 11:54 PM, Yannick <y.d...@gm...> wrote: > >> Hi Nina, >> >> Thanks for your reply. I changed the cdm version to 1.4.11. However, >> I still have the same error messages. >> >> Thanks in advance for your help. >> >> Yannick >> >> On 2014-03-03, at 11:30 PM, Nina Jeliazkova >> <jel...@gm...> wrote: >> >> Dear Yannick, >> >> Thanks for your interest in ambit-smirks. >> >> (cc: to Nick Kochev, who is the author of the package). >> >> I am not familiar with Ruby/JRuby, but the NoMethodError >> newInstance means some of the dependencies is missing and the >> corresponding class could not be instantiated. >> >> ambit-smirks 2.5.4-x depends on CDK 1.4.11 and has not been tested >> with CDK 1.4.19 - quite probably this might be the reason. Could you >> try changing the CDK dependency to 1.4.11 . >> >> Best regards, >> Nina >> >> On 3 March 2014 23:39, Yannick .Djoumbou <y.d...@gm...> >> wrote: >> >> Hello, >> >> I am a new user of AMBIT. I would like to use SMIRKS and I have >> browsed through some examples on this web page [1]. >> I have tried some examples with several SMIRKS but I have add >> several issues. >> In the attached file, I show a prototype of the JRuby code I use. >> All the libraries have been imported properly. >> Please have a look at the examples provided in the file above. >> >> Would you please let me know what is the cause for this? I have >> looked at the source code but I could find a solution. >> >> Cheers, >> >> Yannick >> > ------------------------------------------------------------------------------ >> Subversion Kills Productivity. Get off Subversion & Make the Move >> to Perforce. >> With Perforce, you get hassle-free workflows. Merge that actually >> works. >> Faster operations. Version large binaries. Built-in WAN >> optimization and the >> freedom to use Git, Perforce or both. Make the move to Perforce. >> > http://pubads.g.doubleclick.net/gampad/clk?id=122218951&iu=/4140/ostg.clktrk >> [2] >> _______________________________________________ >> Ambit-users mailing list >> Amb...@li... >> https://lists.sourceforge.net/lists/listinfo/ambit-users [3] > > > > Links: > ------ > [1] > http://ambit.sourceforge.net/AMBIT2-LIBS/ambit2-smarts/examples.html#SMIRKS > [2] > http://pubads.g.doubleclick.net/gampad/clk?id=122218951&iu=/4140/ostg.clktrk > [3] https://lists.sourceforge.net/lists/listinfo/ambit-users > [4] > file:///Users/yandj/Programming/Projects/drug_metabolism/opentoxeuro2013_submission_20.pdf |