From: Yannick .D. <y.d...@gm...> - 2014-03-04 18:39:57
|
require 'java' require 'lib/cdk/cdk-1.4.19.jar' require 'lib/ambit2/ambit2-core-2.5.4-20140227.134038-19.jar' require 'lib/ambit2/ambit2-base-2.5.4-20140227.134038-19.jar' require 'lib/ambit2/ambit2-smarts-2.5.4-20140104.083219-2.jar' import java.util.Vector import 'ambit2.smarts.SMIRKSManager' import 'ambit2.smarts.SMIRKSReaction' import 'ambit2.smarts.SMIRKSTransform' import 'ambit2.smarts.query.SmartsPatternCDK' import 'org.openscience.cdk.AtomContainer' import 'org.openscience.cdk.smiles.SmilesParser' import 'org.openscience.cdk.smiles.SmilesGenerator' import 'org.openscience.cdk.smiles.smarts.SMARTSQueryTool' import 'org.openscience.cdk.silent.SilentChemObjectBuilder' import 'org.openscience.cdk.tools.manipulator.AtomContainerManipulator' import 'org.openscience.cdk.interfaces.IChemObjectBuilder' builder = SilentChemObjectBuilder.getInstance() sg = SmilesGenerator.new sp = SmilesParser.new(builder) cob = IChemObjectBuilder.new() smrkMan = SMIRKSManager.new(cob) reaction = smrkMan.parse(a given SMIRKS string) molecule = sp.parseSmiles(the query smiles) if smrkMan.applyTransformation(molecule, reaction) return target end Example 1 #SMIRKS / SMILES [*;#6:1][C:2]#[C:3][*;#6:4]>>[*:1]/[C:2](/[H])=[*:3](/[H])[C:4] COCCCC#CCCC Error: Vector.java:744:in `get': java.lang.ArrayIndexOutOfBoundsException: Array index out of range: 0 from SMIRKSManager.java:512:in `applyTransformAtLocation' from SMIRKSManager.java:286:in `applyTransformation' from SMIRKSManager.java:194:in `applyTransformation' from NativeMethodAccessorImpl.java:-2:in `invoke0' from NativeMethodAccessorImpl.java:57:in `invoke' from DelegatingMethodAccessorImpl.java:43:in `invoke' from Method.java:606:in `invoke' from JavaMethod.java:470:in `invokeDirectWithExceptionHandling' from JavaMethod.java:328:in `invokeDirect' from InstanceMethodInvoker.java:71:in `call' from CachingCallSite.java:346:in `cacheAndCall' from CachingCallSite.java:204:in `call' Example 2 #SMIRKS / SMILES [*;#6:1][C:2]=[O:3]>>[*;#6:1][C:2]-[O:3][*;#6] CCC=O Error: No error Example 3 #SMIRKS / SMILES [C:1]=O>>[C:1]1OCCO1 # Taken from the Daylight SMIRKS examples page CCCCCCC=O Error: NoMethodError: undefined method `newInstance' for #<#<Class:0xfb0d6fe>:0x22f2c5be> newInstance at org/jruby/gen/InterfaceImpl765047607.gen:13 (root) at metabolize-with-ambit-cdk.jrb: xxx ==> This refers to the line 29 "if smrkMan.applyTransformation(molecule, reaction)" Example 4 #SMIRKS / SMILES [*:1]C(=O)O>>[*:1]C(N)=O # Taken from the Daylight SMIRKS examples page CCCCCCC(=O)O Error: NoMethodError: undefined method `newInstance' for #<#<Class:0xfb0d6fe>:0x22f2c5be> newInstance at org/jruby/gen/InterfaceImpl765047607.gen:13 (root) at metabolize-with-ambit-cdk.jrb: xxx ==> This refers to the line 29 "if smrkMan.applyTransformation(molecule, reaction)" It looks like the smirks is wrong but I do not think so. I have tried many others but I get a lot of these errors. |