From: <sh...@us...> - 2008-09-04 17:27:56
|
Revision: 12166 http://cdk.svn.sourceforge.net/cdk/?rev=12166&view=rev Author: shk3 Date: 2008-09-04 17:27:52 +0000 (Thu, 04 Sep 2008) Log Message: ----------- the modelbuilder3d tests work except 1, added test for the fingerprints Modified Paths: -------------- cdk/trunk/.classpath cdk/trunk/src/META-INF/test-builder3d.cdkdepends cdk/trunk/src/main/org/openscience/cdk/modeling/builder3d/TemplateExtractor.java cdk/trunk/src/main/org/openscience/cdk/modeling/builder3d/TemplateHandler3D.java cdk/trunk/src/test/org/openscience/cdk/modeling/builder3d/TemplateHandler3DTest.java Added Paths: ----------- cdk/trunk/src/test/data/mdl/fingerprints_from_modelbuilder3d.sdf Modified: cdk/trunk/.classpath =================================================================== --- cdk/trunk/.classpath 2008-09-04 15:49:41 UTC (rev 12165) +++ cdk/trunk/.classpath 2008-09-04 17:27:52 UTC (rev 12166) @@ -3,6 +3,7 @@ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> <classpathentry kind="src" path="src/main"/> + <classpathentry kind="src" path="src/test"/> <classpathentry exported="true" kind="lib" path="jar/jgrapht-0.6.0.jar" sourcepath="cdksrc.zip"/> <classpathentry exported="true" kind="lib" path="jar/jniinchi-0.4.jar" sourcepath="cdksrc.zip"/> <classpathentry exported="true" kind="lib" path="jar/JRI.jar" sourcepath="cdksrc.zip"/> Modified: cdk/trunk/src/META-INF/test-builder3d.cdkdepends =================================================================== --- cdk/trunk/src/META-INF/test-builder3d.cdkdepends 2008-09-04 15:49:41 UTC (rev 12165) +++ cdk/trunk/src/META-INF/test-builder3d.cdkdepends 2008-09-04 17:27:52 UTC (rev 12166) @@ -15,3 +15,4 @@ cdk-test.jar cdk-isomorphism.jar cdk-testdata.jar +cdk-builder3dtools.jar Modified: cdk/trunk/src/main/org/openscience/cdk/modeling/builder3d/TemplateExtractor.java =================================================================== --- cdk/trunk/src/main/org/openscience/cdk/modeling/builder3d/TemplateExtractor.java 2008-09-04 15:49:41 UTC (rev 12165) +++ cdk/trunk/src/main/org/openscience/cdk/modeling/builder3d/TemplateExtractor.java 2008-09-04 17:27:52 UTC (rev 12166) @@ -372,15 +372,10 @@ } } - public void makeFingerprintFromRingSystems(String dataFileIn, - String dataFileOut, boolean anyAtom, boolean anyAtomAnyBond) - throws Exception { - System.out.println("Start make fingerprint from file:" + dataFileIn - + " ..."); + public List makeFingerprintsFromSdf(boolean anyAtom, boolean anyAtomAnyBond, Map timings, BufferedReader fin, int limit) throws Exception{ AllRingsFinder allRingsFinder = new AllRingsFinder(); allRingsFinder.setTimeout(10000); // 10 seconds - Map timings = new HashMap(); Fingerprinter fingerPrinter = new Fingerprinter(Fingerprinter.DEFAULT_SIZE, Fingerprinter.DEFAULT_SEARCH_DEPTH); IMolecule m = null; @@ -390,19 +385,18 @@ List data = new ArrayList(); try { System.out.print("Read data file in ..."); - BufferedReader fin = new BufferedReader(new FileReader(dataFileIn)); imdl = new IteratingMDLReader(fin, NoNotificationChemObjectBuilder .getInstance()); // fin.close(); System.out.println("ready"); } catch (Exception exc) { - System.out.println("Could not read Molecules from file " - + dataFileIn + " due to: " + exc.getMessage()); + System.out.println("Could not read Molecules from file"+ + " due to: " + exc.getMessage()); } int moleculeCounter = 0; int fingerprintCounter = 0; System.out.print("Generated Fingerprints: " + fingerprintCounter + " "); - while (imdl.hasNext()) { + while (imdl.hasNext() && (moleculeCounter<limit || limit==-1)) { // query=new QueryAtomContainer(); query = builder.newAtomContainer(); m = (IMolecule) imdl.next(); @@ -477,10 +471,22 @@ { exc2.printStackTrace(); } - System.out.print("...ready with:" + moleculeCounter + " molecules\nWrite data...of data vector:" + data.size() + " fingerprintCounter:" + fingerprintCounter); + + return data; + } + + public void makeFingerprintFromRingSystems(String dataFileIn, + String dataFileOut, boolean anyAtom, boolean anyAtomAnyBond) + throws Exception { + Map timings = new HashMap(); + + System.out.println("Start make fingerprint from file:" + dataFileIn + + " ..."); + BufferedReader fin = new BufferedReader(new FileReader(dataFileIn)); + List data=makeFingerprintsFromSdf(anyAtom, anyAtomAnyBond, timings, fin,-1); BufferedWriter fout = null; try { fout = new BufferedWriter(new FileWriter(dataFileOut)); Modified: cdk/trunk/src/main/org/openscience/cdk/modeling/builder3d/TemplateHandler3D.java =================================================================== --- cdk/trunk/src/main/org/openscience/cdk/modeling/builder3d/TemplateHandler3D.java 2008-09-04 15:49:41 UTC (rev 12165) +++ cdk/trunk/src/main/org/openscience/cdk/modeling/builder3d/TemplateHandler3D.java 2008-09-04 17:27:52 UTC (rev 12166) @@ -145,9 +145,9 @@ templatesLoaded = true; } - private BitSet getBitSetFromFile(StringTokenizer st) throws Exception { + public static BitSet getBitSetFromFile(StringTokenizer st) throws Exception { BitSet bitSet = new BitSet(1024); - for (int i = 0; i < st.countTokens(); i++) { + while(st.hasMoreTokens()){ bitSet.set(Integer.parseInt(st.nextToken())); } return bitSet; Added: cdk/trunk/src/test/data/mdl/fingerprints_from_modelbuilder3d.sdf =================================================================== --- cdk/trunk/src/test/data/mdl/fingerprints_from_modelbuilder3d.sdf (rev 0) +++ cdk/trunk/src/test/data/mdl/fingerprints_from_modelbuilder3d.sdf 2008-09-04 17:27:52 UTC (rev 12166) @@ -0,0 +1,475 @@ + + CDK + + 18 22 0 0 0 0 0 0 0 0999 V2000 + 2.0204 1.6683 -2.0632 C 0 0 0 0 0 0 0 0 0 0 0 0 + 1.7089 3.0007 -2.2850 C 0 0 0 0 0 0 0 0 0 0 0 0 + 1.4666 3.6588 -0.9489 C 0 0 0 0 0 0 0 0 0 0 0 0 + 1.2257 2.4605 -0.0521 C 0 0 0 0 0 0 0 0 0 0 0 0 + 1.9460 1.3741 -0.7484 C 0 0 0 0 0 0 0 0 0 0 0 0 + 1.8566 2.7898 -4.6109 C 0 0 0 0 0 0 0 0 0 0 0 0 + 2.2657 1.4798 -4.4252 C 0 0 0 0 0 0 0 0 0 0 0 0 + 2.3489 0.8778 -3.1718 C 0 0 0 0 0 0 0 0 0 0 0 0 + 1.5337 3.5806 -3.5218 C 0 0 0 0 0 0 0 0 0 0 0 0 + 0.2875 4.6001 -1.1701 C 0 0 0 0 0 0 0 0 0 0 0 0 + 0.6855 5.5948 -2.2609 C 0 0 0 0 0 0 0 0 0 0 0 0 + 0.9893 4.9688 -3.6094 C 0 0 0 0 0 0 0 0 0 0 0 0 + 1.8392 6.3827 -1.7893 C 0 0 0 0 0 0 0 0 0 0 0 0 + 2.9795 5.4437 -1.7150 C 0 0 0 0 0 0 0 0 0 0 0 0 + 2.7000 4.4697 -0.5468 C 0 0 0 0 0 0 0 0 0 0 0 0 + -0.2365 2.0733 0.0512 C 0 0 0 0 0 0 0 0 0 0 0 0 + -1.1059 2.6315 -1.0217 C 0 0 0 0 0 0 0 0 0 0 0 0 + -0.8970 3.7771 -1.6100 C 0 0 0 0 0 0 0 0 0 0 0 0 + 2 1 4 0 0 0 0 + 3 2 1 0 0 0 0 + 4 3 1 0 0 0 0 + 4 5 1 0 0 0 0 + 5 1 1 0 0 0 0 + 6 7 4 0 0 0 0 + 8 7 4 0 0 0 0 + 1 8 4 0 0 0 0 + 2 9 4 0 0 0 0 + 9 6 4 0 0 0 0 + 10 11 1 0 0 0 0 + 11 12 1 0 0 0 0 + 9 12 1 0 0 0 0 + 3 10 1 0 0 0 0 + 11 13 1 0 0 0 0 + 14 13 1 0 0 0 0 + 15 14 1 0 0 0 0 + 3 15 1 0 0 0 0 + 16 4 1 0 0 0 0 + 16 17 1 0 0 0 0 + 17 18 2 0 0 0 0 + 18 10 1 0 0 0 0 +M ISO 1 5 4 +M ISO 1 13 2 +M END +$$$$ + + CDK + + 18 21 0 0 0 0 0 0 0 0999 V2000 + 0.4809 -0.4307 -1.3896 C 0 0 0 0 0 0 0 0 0 0 0 0 + 0.0021 -0.0041 0.0020 C 0 0 0 0 0 0 0 0 0 0 0 0 + -0.0189 1.5402 0.0105 C 0 0 0 0 0 0 0 0 0 0 0 0 + 1.4459 1.9971 -0.0010 C 0 0 0 0 0 0 0 0 0 0 0 0 + 2.1726 1.3508 -1.1458 C 0 0 0 0 0 0 0 0 0 0 0 0 + 1.7567 0.2751 -1.7421 C 0 0 0 0 0 0 0 0 0 0 0 0 + 0.6494 -1.9163 -1.4560 C 0 0 0 0 0 0 0 0 0 0 0 0 + -0.2474 -2.3692 -2.4311 C 0 0 0 0 0 0 0 0 0 0 0 0 + -0.9506 -1.3056 -2.9686 C 0 0 0 0 0 0 0 0 0 0 0 0 + -0.5887 -0.1285 -2.4168 C 0 0 0 0 0 0 0 0 0 0 0 0 + 1.4754 -2.7734 -0.7614 C 0 0 0 0 0 0 0 0 0 0 0 0 + 1.3832 -4.1262 -1.0705 C 0 0 0 0 0 0 0 0 0 0 0 0 + 0.5042 -4.5862 -2.0300 C 0 0 0 0 0 0 0 0 0 0 0 0 + -0.3297 -3.7298 -2.7318 C 0 0 0 0 0 0 0 0 0 0 0 0 + 2.5069 2.8733 1.8561 C 0 0 0 0 0 0 0 0 0 0 0 0 + 2.6961 3.7889 0.6104 C 0 0 0 0 0 0 0 0 0 0 0 0 + 1.4967 3.4307 -0.1373 C 0 0 0 0 0 0 0 0 0 0 0 0 + 2.0699 1.6367 1.2413 C 0 0 0 0 0 0 0 0 0 0 0 0 + 2 1 1 0 0 0 0 + 3 2 1 0 0 0 0 + 3 4 1 0 0 0 0 + 5 4 1 0 0 0 0 + 5 6 2 0 0 0 0 + 6 1 1 0 0 0 0 + 1 7 1 0 0 0 0 + 7 8 4 0 0 0 0 + 8 9 1 0 0 0 0 + 10 9 1 0 0 0 0 + 10 1 1 0 0 0 0 + 11 12 4 0 0 0 0 + 12 13 4 0 0 0 0 + 13 14 4 0 0 0 0 + 8 14 4 0 0 0 0 + 7 11 4 0 0 0 0 + 16 15 1 0 0 0 0 + 17 16 1 0 0 0 0 + 17 4 1 0 0 0 0 + 18 4 1 0 0 0 0 + 15 18 1 0 0 0 0 +M ISO 1 9 2 +M ISO 1 17 4 +M ISO 1 18 4 +M END +$$$$ + + CDK + + 10 11 0 0 0 0 0 0 0 0999 V2000 + 1.2431 2.0668 0.0013 C 0 0 0 0 0 0 0 0 0 0 0 0 + 2.3702 1.4061 -0.0117 C 0 0 0 0 0 0 0 0 0 0 0 0 + 2.3488 0.0054 -0.0200 C 0 0 0 0 0 0 0 0 0 0 0 0 + 1.1586 -0.6727 -0.0126 C 0 0 0 0 0 0 0 0 0 0 0 0 + 0.0021 -0.0041 0.0020 C 0 0 0 0 0 0 0 0 0 0 0 0 + -0.0159 1.3225 0.0093 C 0 0 0 0 0 0 0 0 0 0 0 0 + 3.5421 -0.6993 -0.0353 C 0 0 0 0 0 0 0 0 0 0 0 0 + 1.1371 -2.0033 -0.0194 C 0 0 0 0 0 0 0 0 0 0 0 0 + 2.2548 -2.7256 -0.0340 C 0 0 0 0 0 0 0 0 0 0 0 0 + 3.4910 -2.1059 -0.0427 C 0 0 0 0 0 0 0 0 0 0 0 0 + 2 1 2 0 0 0 0 + 3 2 1 0 0 0 0 + 4 3 1 0 0 0 0 + 5 4 1 0 0 0 0 + 6 5 2 0 0 0 0 + 6 1 1 0 0 0 0 + 3 7 1 0 0 0 0 + 4 8 2 0 0 0 0 + 8 9 1 0 0 0 0 + 9 10 2 0 0 0 0 + 10 7 1 0 0 0 0 +M ISO 1 2 2 +M ISO 1 3 2 +M ISO 1 5 2 +M ISO 1 8 2 +M END +$$$$ + + CDK + + 12 14 0 0 0 0 0 0 0 0999 V2000 + 2.0228 -0.0010 1.1875 C 0 0 0 0 0 0 0 0 0 0 0 0 + 0.6860 -0.4754 1.1545 C 0 0 0 0 0 0 0 0 0 0 0 0 + 0.0021 -0.0041 0.0020 C 0 0 0 0 0 0 0 0 0 0 0 0 + 0.7171 -0.4786 -1.2667 C 0 0 0 0 0 0 0 0 0 0 0 0 + 2.1373 0.1045 -1.2849 C 0 0 0 0 0 0 0 0 0 0 0 0 + 2.3256 0.9265 0.0037 C 0 0 0 0 0 0 0 0 0 0 0 0 + -0.0178 1.4600 0.0101 C 0 0 0 0 0 0 0 0 0 0 0 0 + 1.2450 2.0065 0.0009 C 0 0 0 0 0 0 0 0 0 0 0 0 + -0.0405 0.0366 -2.5000 C 0 0 0 0 0 0 0 0 0 0 0 0 + -1.4634 -0.5582 -2.4635 C 0 0 0 0 0 0 0 0 0 0 0 0 + -2.1591 0.0630 -1.2281 C 0 0 0 0 0 0 0 0 0 0 0 0 + -1.4416 -0.5209 0.0068 C 0 0 0 0 0 0 0 0 0 0 0 0 + 2 1 1 0 0 0 0 + 3 2 1 0 0 0 0 + 3 4 1 0 0 0 0 + 4 5 1 0 0 0 0 + 5 6 1 0 0 0 0 + 6 1 1 0 0 0 0 + 7 3 1 0 0 0 0 + 7 8 1 0 0 0 0 + 6 8 1 0 0 0 0 + 4 9 1 0 0 0 0 + 9 10 1 0 0 0 0 + 11 10 1 0 0 0 0 + 12 11 1 0 0 0 0 + 3 12 1 0 0 0 0 +M ISO 1 2 4 +M ISO 1 7 4 +M END +$$$$ + + CDK + + 25 30 0 0 0 0 0 0 0 0999 V2000 + 2.3951 1.5426 -0.0138 C 0 0 0 0 0 0 0 0 0 0 0 0 + 2.5532 0.0947 -0.0272 C 0 0 0 0 0 0 0 0 0 0 0 0 + 1.6332 -0.7373 -0.0230 C 0 0 0 0 0 0 0 0 0 0 0 0 + 0.0021 -0.0041 0.0020 C 0 0 0 0 0 0 0 0 0 0 0 0 + -0.0222 1.7892 0.0119 C 0 0 0 0 0 0 0 0 0 0 0 0 + 1.2393 2.3100 0.0026 C 0 0 0 0 0 0 0 0 0 0 0 0 + 4.0094 -0.2230 -0.0477 C 0 0 0 0 0 0 0 0 0 0 0 0 + 4.7328 0.9769 -0.0423 C 0 0 0 0 0 0 0 0 0 0 0 0 + 3.7763 2.1045 -0.0199 C 0 0 0 0 0 0 0 0 0 0 0 0 + 6.1237 0.9402 -0.0582 C 0 0 0 0 0 0 0 0 0 0 0 0 + 6.7825 -0.2781 -0.0796 C 0 0 0 0 0 0 0 0 0 0 0 0 + 6.0676 -1.4603 -0.0858 C 0 0 0 0 0 0 0 0 0 0 0 0 + 4.6821 -1.4388 -0.0698 C 0 0 0 0 0 0 0 0 0 0 0 0 + -1.9379 -1.2578 -1.2433 C 0 0 0 0 0 0 0 0 0 0 0 0 + -2.3799 -1.5676 0.0348 C 0 0 0 0 0 0 0 0 0 0 0 0 + -1.8150 -1.2111 1.3291 C 0 0 0 0 0 0 0 0 0 0 0 0 + -0.7885 -0.5397 1.5142 C 0 0 0 0 0 0 0 0 0 0 0 0 + -0.8205 -0.5195 -1.5059 C 0 0 0 0 0 0 0 0 0 0 0 0 + -3.5975 -2.3765 0.3292 C 0 0 0 0 0 0 0 0 0 0 0 0 + -3.7361 -2.4835 1.7977 C 0 0 0 0 0 0 0 0 0 0 0 0 + -2.6772 -1.7901 2.3985 C 0 0 0 0 0 0 0 0 0 0 0 0 + -2.5790 -1.7376 3.7839 C 0 0 0 0 0 0 0 0 0 0 0 0 + -4.6826 -3.1179 2.5966 C 0 0 0 0 0 0 0 0 0 0 0 0 + -4.5733 -3.0588 3.9762 C 0 0 0 0 0 0 0 0 0 0 0 0 + -3.5294 -2.3731 4.5669 C 0 0 0 0 0 0 0 0 0 0 0 0 + 1 2 1 0 0 0 0 + 2 3 2 0 0 0 0 + 4 3 1 0 0 0 0 + 5 4 1 0 0 0 0 + 5 6 1 0 0 0 0 + 6 1 2 0 0 0 0 + 2 7 1 0 0 0 0 + 7 8 4 0 0 0 0 + 8 9 1 0 0 0 0 + 1 9 1 0 0 0 0 + 8 10 4 0 0 0 0 + 11 10 4 0 0 0 0 + 12 11 4 0 0 0 0 + 13 12 4 0 0 0 0 + 7 13 4 0 0 0 0 + 14 15 2 0 0 0 0 + 15 16 1 0 0 0 0 + 16 17 2 0 0 0 0 + 4 17 1 0 0 0 0 + 4 18 1 0 0 0 0 + 18 14 1 0 0 0 0 + 15 19 1 0 0 0 0 + 19 20 1 0 0 0 0 + 20 21 4 0 0 0 0 + 21 16 1 0 0 0 0 + 21 22 4 0 0 0 0 + 20 23 4 0 0 0 0 + 23 24 4 0 0 0 0 + 24 25 4 0 0 0 0 + 25 22 4 0 0 0 0 +M CHG 1 3 1 +M CHG 1 4 -2 +M CHG 1 5 1 +M CHG 1 17 1 +M CHG 1 18 1 +M ISO 1 3 4 +M ISO 1 4 44 +M ISO 1 5 4 +M ISO 1 17 4 +M ISO 1 18 4 +M END +$$$$ + + CDK + + 41 46 0 0 0 0 0 0 0 0999 V2000 + -1.9017 2.5349 -1.2428 C 0 0 0 0 0 0 0 0 0 0 0 0 + -1.5299 2.0103 -2.4664 C 0 0 0 0 0 0 0 0 0 0 0 0 + -2.0157 2.6060 -3.6232 C 0 0 0 0 0 0 0 0 0 0 0 0 + -2.9775 3.5944 -3.5699 C 0 0 0 0 0 0 0 0 0 0 0 0 + -3.4023 4.0670 -2.3427 C 0 0 0 0 0 0 0 0 0 0 0 0 + -2.8477 3.5527 -1.1915 C 0 0 0 0 0 0 0 0 0 0 0 0 + -0.0167 1.3830 0.0096 C 0 0 0 0 0 0 0 0 0 0 0 0 + -1.3332 2.0851 0.0718 C 0 0 0 0 0 0 0 0 0 0 0 0 + -1.4247 2.2765 -4.9820 C 0 0 0 0 0 0 0 0 0 0 0 0 + -0.1128 3.0272 -5.0453 C 0 0 0 0 0 0 0 0 0 0 0 0 + 1.0859 2.3615 -5.2269 C 0 0 0 0 0 0 0 0 0 0 0 0 + 2.2787 3.0387 -5.0437 C 0 0 0 0 0 0 0 0 0 0 0 0 + 3.5963 2.2954 -4.9719 C 0 0 0 0 0 0 0 0 0 0 0 0 + 4.2007 2.6625 -3.6335 C 0 0 0 0 0 0 0 0 0 0 0 0 + 3.7484 2.0854 -2.4526 C 0 0 0 0 0 0 0 0 0 0 0 0 + 4.2224 2.5773 -1.2432 C 0 0 0 0 0 0 0 0 0 0 0 0 + 3.7049 2.1140 0.0850 C 0 0 0 0 0 0 0 0 0 0 0 0 + 2.3915 1.3955 0.0337 C 0 0 0 0 0 0 0 0 0 0 0 0 + 1.1845 2.0812 0.0019 C 0 0 0 0 0 0 0 0 0 0 0 0 + 1.2016 -0.6874 0.0120 C 0 0 0 0 0 0 0 0 0 0 0 0 + 0.0021 -0.0041 0.0020 C 0 0 0 0 0 0 0 0 0 0 0 0 + 2.3927 0.0096 0.0366 C 0 0 0 0 0 0 0 0 0 0 0 0 + -1.3114 -2.5286 -3.4502 C 0 0 0 0 0 0 0 0 0 0 0 0 + -0.8379 -1.4738 -2.6124 C 0 0 0 0 0 0 0 0 0 0 0 0 + -0.8008 -0.1671 -3.4146 C 0 0 0 0 0 0 0 0 0 0 0 0 + -0.6991 0.9551 -2.5256 C 0 0 0 0 0 0 0 0 0 0 0 0 + 2.8539 1.0901 -2.4503 C 0 0 0 0 0 0 0 0 0 0 0 0 + 2.8040 -0.1053 -3.2296 C 0 0 0 0 0 0 0 0 0 0 0 0 + 4.2057 -0.6786 -3.4533 C 0 0 0 0 0 0 0 0 0 0 0 0 + 4.2890 -1.9863 -2.8828 C 0 0 0 0 0 0 0 0 0 0 0 0 + 3.5367 -2.8660 -3.7211 C 0 0 0 0 0 0 0 0 0 0 0 0 + 2.4463 -3.5461 -2.8899 C 0 0 0 0 0 0 0 0 0 0 0 0 + 1.7253 -4.4684 -3.7054 C 0 0 0 0 0 0 0 0 0 0 0 0 + 0.6067 -3.7661 -4.2440 C 0 0 0 0 0 0 0 0 0 0 0 0 + -0.5035 -3.6772 -3.1936 C 0 0 0 0 0 0 0 0 0 0 0 0 + 2.2741 4.4067 -4.8384 C 0 0 0 0 0 0 0 0 0 0 0 0 + 1.0689 5.0884 -4.7458 C 0 0 0 0 0 0 0 0 0 0 0 0 + -0.1230 4.3956 -4.8368 C 0 0 0 0 0 0 0 0 0 0 0 0 + 5.1890 3.6296 -3.6148 C 0 0 0 0 0 0 0 0 0 0 0 0 + 5.2119 3.5513 -1.2328 C 0 0 0 0 0 0 0 0 0 0 0 0 + 5.7100 4.0652 -2.4121 C 0 0 0 0 0 0 0 0 0 0 0 0 + 1 2 4 0 0 0 0 + 3 2 4 0 0 0 0 + 4 3 4 0 0 0 0 + 5 4 4 0 0 0 0 + 6 5 4 0 0 0 0 + 1 6 4 0 0 0 0 + 7 8 1 0 0 0 0 + 1 8 1 0 0 0 0 + 3 9 1 0 0 0 0 + 10 9 1 0 0 0 0 + 11 10 4 0 0 0 0 + 12 11 4 0 0 0 0 + 12 13 1 0 0 0 0 + 14 13 1 0 0 0 0 + 14 15 4 0 0 0 0 + 16 15 4 0 0 0 0 + 16 17 1 0 0 0 0 + 18 17 1 0 0 0 0 + 18 19 4 0 0 0 0 + 7 19 4 0 0 0 0 + 21 20 4 0 0 0 0 + 7 21 4 0 0 0 0 + 22 18 4 0 0 0 0 + 20 22 4 0 0 0 0 + 23 24 1 0 0 0 0 + 25 24 1 0 0 0 0 + 26 25 1 0 0 0 0 + 2 26 1 0 0 0 0 + 27 15 1 0 0 0 0 + 27 28 1 0 0 0 0 + 28 29 1 0 0 0 0 + 29 30 1 0 0 0 0 + 30 31 1 0 0 0 0 + 31 32 1 0 0 0 0 + 32 33 1 0 0 0 0 + 33 34 1 0 0 0 0 + 35 34 1 0 0 0 0 + 35 23 1 0 0 0 0 + 36 37 4 0 0 0 0 + 38 37 4 0 0 0 0 + 10 38 4 0 0 0 0 + 36 12 4 0 0 0 0 + 39 14 4 0 0 0 0 + 16 40 4 0 0 0 0 + 40 41 4 0 0 0 0 + 41 39 4 0 0 0 0 +M ISO 1 23 4 +M ISO 1 26 4 +M ISO 1 27 4 +M ISO 1 30 4 +M ISO 1 33 4 +M END +$$$$ + + CDK + + 18 21 0 0 0 0 0 0 0 0999 V2000 + -2.7941 3.4504 -0.5912 C 0 0 0 0 0 0 0 0 0 0 0 0 + -2.3893 2.0959 -0.6453 C 0 0 0 0 0 0 0 0 0 0 0 0 + -1.2166 2.0526 0.0183 C 0 0 0 0 0 0 0 0 0 0 0 0 + -1.2616 3.0923 0.9002 C 0 0 0 0 0 0 0 0 0 0 0 0 + -1.8702 4.0509 0.1785 C 0 0 0 0 0 0 0 0 0 0 0 0 + -0.0144 1.2111 0.0087 C 0 0 0 0 0 0 0 0 0 0 0 0 + -1.2410 5.3913 0.1309 C 0 0 0 0 0 0 0 0 0 0 0 0 + 0.1470 5.2403 0.0225 C 0 0 0 0 0 0 0 0 0 0 0 0 + 0.9712 3.7403 1.0231 C 0 0 0 0 0 0 0 0 0 0 0 0 + 1.1112 2.0456 0.0024 C 0 0 0 0 0 0 0 0 0 0 0 0 + 0.0189 3.4406 2.8864 C 0 0 0 0 0 0 0 0 0 0 0 0 + 1.2162 3.7349 3.7544 C 0 0 0 0 0 0 0 0 0 0 0 0 + 2.2922 4.6687 3.2046 C 0 0 0 0 0 0 0 0 0 0 0 0 + 2.8424 4.2993 1.8390 C 0 0 0 0 0 0 0 0 0 0 0 0 + 0.7193 4.2648 5.1046 C 0 0 0 0 0 0 0 0 0 0 0 0 + 1.9255 4.2656 6.0697 C 0 0 0 0 0 0 0 0 0 0 0 0 + 2.9333 5.2996 5.5149 C 0 0 0 0 0 0 0 0 0 0 0 0 + 3.4697 4.7228 4.1862 C 0 0 0 0 0 0 0 0 0 0 0 0 + 2 1 1 0 0 0 0 + 3 2 1 0 0 0 0 + 3 4 1 0 0 0 0 + 4 5 1 0 0 0 0 + 5 1 1 0 0 0 0 + 6 3 1 0 0 0 0 + 5 7 1 0 0 0 0 + 8 7 1 0 0 0 0 + 9 8 1 0 0 0 0 + 10 9 1 0 0 0 0 + 6 10 1 0 0 0 0 + 11 12 1 0 0 0 0 + 12 13 1 0 0 0 0 + 14 13 1 0 0 0 0 + 9 14 1 0 0 0 0 + 9 11 1 0 0 0 0 + 12 15 1 0 0 0 0 + 15 16 1 0 0 0 0 + 16 17 1 0 0 0 0 + 18 17 1 0 0 0 0 + 13 18 1 0 0 0 0 +M CHG 1 9 -2 +M ISO 1 4 4 +M ISO 1 8 4 +M ISO 1 9 183 +M ISO 1 10 4 +M ISO 1 11 2 +M ISO 1 14 2 +M END +$$$$ + + CDK + + 8 9 0 0 0 0 0 0 0 0999 V2000 + 2.7130 -0.5886 -1.5551 C 0 0 0 0 0 0 0 0 0 0 0 0 + 3.1808 0.8819 -1.4841 C 0 0 0 0 0 0 0 0 0 0 0 0 + 2.0001 1.6849 -1.3320 C 0 0 0 0 0 0 0 0 0 0 0 0 + 1.5180 1.4821 -0.0045 C 0 0 0 0 0 0 0 0 0 0 0 0 + 1.3114 0.0696 0.3162 C 0 0 0 0 0 0 0 0 0 0 0 0 + 2.2535 -0.9590 -0.1299 C 0 0 0 0 0 0 0 0 0 0 0 0 + -0.0184 1.5079 0.0103 C 0 0 0 0 0 0 0 0 0 0 0 0 + 0.0021 -0.0041 0.0020 C 0 0 0 0 0 0 0 0 0 0 0 0 + 1 2 1 0 0 0 0 + 3 2 1 0 0 0 0 + 4 3 1 0 0 0 0 + 5 4 1 0 0 0 0 + 5 6 1 0 0 0 0 + 1 6 1 0 0 0 0 + 7 4 1 0 0 0 0 + 7 8 1 0 0 0 0 + 8 5 1 0 0 0 0 +M ISO 1 3 4 +M ISO 1 5 2 +M END +$$$$ + + CDK + + 10 11 0 0 0 0 0 0 0 0999 V2000 + 1.1408 1.9086 0.0078 C 0 0 0 0 0 0 0 0 0 0 0 0 + 1.1061 3.2764 0.0103 C 0 0 0 0 0 0 0 0 0 0 0 0 + 2.2390 3.9824 0.0011 C 0 0 0 0 0 0 0 0 0 0 0 0 + 3.4097 3.3814 -0.0108 C 0 0 0 0 0 0 0 0 0 0 0 0 + 3.4845 1.9842 -0.0132 C 0 0 0 0 0 0 0 0 0 0 0 0 + 2.3366 1.2570 -0.0040 C 0 0 0 0 0 0 0 0 0 0 0 0 + -0.0729 3.9006 0.0223 C 0 0 0 0 0 0 0 0 0 0 0 0 + -1.1998 3.1978 0.0267 C 0 0 0 0 0 0 0 0 0 0 0 0 + -1.1754 1.8698 0.0245 C 0 0 0 0 0 0 0 0 0 0 0 0 + -0.0148 1.2148 0.0176 C 0 0 0 0 0 0 0 0 0 0 0 0 + 1 2 1 0 0 0 0 + 2 3 1 0 0 0 0 + 3 4 2 0 0 0 0 + 5 4 1 0 0 0 0 + 6 5 2 0 0 0 0 + 1 6 1 0 0 0 0 + 2 7 2 0 0 0 0 + 8 7 1 0 0 0 0 + 9 8 2 0 0 0 0 + 10 9 1 0 0 0 0 + 10 1 1 0 0 0 0 +M ISO 1 1 2 +M ISO 1 3 2 +M ISO 1 7 2 +M ISO 1 9 2 +M END +$$$$ + + CDK + + 12 14 0 0 0 0 0 0 0 0999 V2000 + -2.2442 3.8002 -3.5208 C 0 0 0 0 0 0 0 0 0 0 0 0 + -1.2486 3.1504 -2.7818 C 0 0 0 0 0 0 0 0 0 0 0 0 + -1.2682 3.1628 -1.5031 C 0 0 0 0 0 0 0 0 0 0 0 0 + -2.1931 3.7659 -0.6958 C 0 0 0 0 0 0 0 0 0 0 0 0 + -3.2235 4.4376 -1.4216 C 0 0 0 0 0 0 0 0 0 0 0 0 + -3.2278 4.4403 -2.8282 C 0 0 0 0 0 0 0 0 0 0 0 0 + -1.2430 3.1491 1.5705 C 0 0 0 0 0 0 0 0 0 0 0 0 + -0.0299 2.3557 0.0150 C 0 0 0 0 0 0 0 0 0 0 0 0 + -2.2248 3.7875 0.7096 C 0 0 0 0 0 0 0 0 0 0 0 0 + -4.2556 5.1099 -0.7441 C 0 0 0 0 0 0 0 0 0 0 0 0 + -4.2684 5.1184 0.6229 C 0 0 0 0 0 0 0 0 0 0 0 0 + -3.2758 4.4731 1.3333 C 0 0 0 0 0 0 0 0 0 0 0 0 + 2 1 4 0 0 0 0 + 3 2 4 0 0 0 0 + 3 4 4 0 0 0 0 + 4 5 4 0 0 0 0 + 5 6 4 0 0 0 0 + 1 6 4 0 0 0 0 + 8 7 1 0 0 0 0 + 8 3 1 0 0 0 0 + 4 9 4 0 0 0 0 + 7 9 1 0 0 0 0 + 5 10 4 0 0 0 0 + 10 11 4 0 0 0 0 + 12 11 4 0 0 0 0 + 9 12 4 0 0 0 0 +M CHG 1 3 1 +M CHG 1 8 -2 +M ISO 1 3 2 +M ISO 1 7 2 +M ISO 1 8 183 +M END +$$$$ Modified: cdk/trunk/src/test/org/openscience/cdk/modeling/builder3d/TemplateHandler3DTest.java =================================================================== --- cdk/trunk/src/test/org/openscience/cdk/modeling/builder3d/TemplateHandler3DTest.java 2008-09-04 15:49:41 UTC (rev 12165) +++ cdk/trunk/src/test/org/openscience/cdk/modeling/builder3d/TemplateHandler3DTest.java 2008-09-04 17:27:52 UTC (rev 12166) @@ -20,11 +20,18 @@ */ package org.openscience.cdk.modeling.builder3d; +import java.io.BufferedReader; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.util.BitSet; +import java.util.HashMap; +import java.util.List; +import java.util.StringTokenizer; + import org.junit.Assert; import org.junit.Test; -import org.openscience.cdk.modeling.builder3d.TemplateHandler3D; +import org.openscience.cdk.NewCDKTestCase; import org.openscience.cdk.nonotify.NNAtomContainer; -import org.openscience.cdk.NewCDKTestCase; /** * @cdk.module test-builder3d @@ -42,5 +49,28 @@ th3d.mapTemplates(new NNAtomContainer(), 0); Assert.assertEquals(10751, th3d.getTemplateCount()); } + + @Test + public void testFingerprints() throws Exception{ + BitSet[] bsmb=new BitSet[10]; + bsmb[0]=(BitSet) TemplateHandler3D.getBitSetFromFile(new StringTokenizer("{29, 40, 110, 138, 144, 184, 202, 204, 248, 510, 553, 571, 644, 710, 727, 741, 746, 775, 780, 792, 823, 863, 898, 917, 925, 957, 978, 1000, 1005};", "\t ;{, }")); + bsmb[1]=(BitSet) TemplateHandler3D.getBitSetFromFile(new StringTokenizer("{29, 40, 110, 138, 144, 184, 202, 204, 248, 510, 553, 571, 644, 710, 727, 741, 746, 775, 780, 792, 823, 863, 898, 917, 925, 957, 978, 1000, 1005}", "\t ;{, }")); + bsmb[2]=(BitSet) TemplateHandler3D.getBitSetFromFile(new StringTokenizer("{29, 40, 70, 137, 156, 184, 203, 220, 222, 248, 361, 406, 458, 461, 491, 518, 520, 542, 545, 547, 563, 571, 643, 648, 688, 694, 698, 710, 727, 741, 743, 757, 775, 792, 797, 864, 866, 898, 916, 925, 952, 954, 963, 978, 990, 1005, 1006}", "\t ;{, }")); + bsmb[3]=(BitSet) TemplateHandler3D.getBitSetFromFile(new StringTokenizer("{29, 184, 553, 644, 741, 775, 823, 898, 1000}", "\t ;{, }")); + bsmb[4]=(BitSet) TemplateHandler3D.getBitSetFromFile(new StringTokenizer("{29, 40, 53, 70, 109, 110, 138, 140, 144, 156, 184, 202, 203, 204, 220, 222, 248, 361, 429, 458, 472, 486, 510, 518, 520, 542, 547, 553, 571, 579, 643, 644, 645, 648, 688, 694, 698, 710, 727, 741, 743, 746, 757, 775, 780, 792, 823, 863, 866, 898, 916, 917, 924, 925, 952, 954, 957, 963, 978, 982, 990, 1000, 1005, 1006}", "\t ;{, }")); + bsmb[5]=(BitSet) TemplateHandler3D.getBitSetFromFile(new StringTokenizer("{29, 184, 553, 644, 741, 775, 823, 898, 1000}", "\t ;{, }")); + bsmb[6]=(BitSet) TemplateHandler3D.getBitSetFromFile(new StringTokenizer("{29, 184, 553, 644, 741, 775, 823, 898, 1000}", "\t ;{, }")); + bsmb[7]=(BitSet) TemplateHandler3D.getBitSetFromFile(new StringTokenizer("{29, 184, 644, 741, 775, 823, 898, 1000}", "\t ;{, }")); + bsmb[8]=(BitSet) TemplateHandler3D.getBitSetFromFile(new StringTokenizer("{29, 40, 70, 137, 156, 184, 203, 220, 222, 248, 361, 406, 458, 461, 491, 518, 520, 542, 545, 547, 563, 571, 643, 648, 688, 694, 698, 710, 727, 741, 743, 757, 775, 792, 797, 864, 866, 898, 916, 925, 952, 954, 963, 978, 990, 1005, 1006}", "\t ;{, }")); + bsmb[9]=(BitSet) TemplateHandler3D.getBitSetFromFile(new StringTokenizer("{29, 184, 553, 644, 741, 775, 823, 898, 1000}", "\t ;{, }")); + + String filename = "data/mdl/fingerprints_from_modelbuilder3d.sdf"; + InputStream ins = this.getClass().getClassLoader().getResourceAsStream(filename); + List data=new TemplateExtractor().makeFingerprintsFromSdf(true,false, new HashMap(), new BufferedReader ( new InputStreamReader ( ins ) ),10); + for(int i=0;i<data.size();i++){ + BitSet bs=(BitSet) data.get(i); + Assert.assertEquals(bs,bsmb[i]); + } + } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |