0
|
1 CDK The Chemical Development Kit
|
|
2
|
|
3 Copyright 1997-2007 The CDK Development Team
|
|
4 License: LGPL, see doc/lgpl.license
|
|
5
|
|
6 1. Introduction
|
|
7
|
|
8 You are currently reading the README file for the Chemistry Development Project (CDK).
|
|
9 This project is hosted under http://cdk.sourceforge.net
|
|
10 Please refer to these pages for updated information and the latest version of the CDK.
|
|
11
|
|
12 The CDK is an open-source library of algorithms for structural chemo- and bioinformatics, implemented in
|
|
13 the programming language Java(tm). The library is published under terms of the the
|
|
14 GNU Lesser General Public License. This has implications on what you can do with sources and
|
|
15 binaries of the CDK library. For details, please refer to the file LICENSE, which should have been
|
|
16 provided with this distribution.
|
|
17
|
|
18 PLEASE NOTE: This is a library of useful data structures and algorithms to manipulated them
|
|
19 from the area of structural chemo- and bioinformatics. As such, it is intended for the use by
|
|
20 programmers, who wish to save some effort by reusing code. It is not intended for the enduser.
|
|
21 If you consider yourself to be more like user, you might not find what you wanted.
|
|
22 Please refer to other projects like the JChemPaint project (http://jchempaint.sourceforge.net)
|
|
23 or the Jmol project (http://jmol.sourceforge.net) for programs that actually take advantage of the
|
|
24 CDK library.
|
|
25
|
|
26 2. Compiling
|
|
27
|
|
28 Compiling and jar-ing the software is done with Jakarta's
|
|
29 Ant (http://jakarta.apache.org/ant/) and requires Java 1.5.0 or better:
|
|
30
|
|
31 cdk/$ ls build.xml
|
|
32 build.xml
|
|
33 cdk/$ ant
|
|
34
|
|
35 "ant -p" gives a list of possible compilation targets. The default target is 'dist-all', which
|
|
36 creates a number of .jar files in the 'dist' directory corresponding to subsets of the CDK
|
|
37 functionality. For convenience, one large .jar file containing everything can be created using the
|
|
38 target 'dist-large' (using the command "ant dist-large"). This is also created in dist/jar and is
|
|
39 typically named something like 'cdk-cvs-20060303.jar'.
|
|
40
|
|
41 2.1 Creating the JavaDoc documentation for the API
|
|
42
|
|
43 The JavaDoc documentation for the API describes all of the CDK classes in detail. It functions as
|
|
44 the user manual for the CDK, although you should also look at the list of examples and tutorials
|
|
45 below. This documentation is created by 'ant' from the Java source code for the CDK as follows:
|
|
46
|
|
47 cdk/$ ls javadoc.xml
|
|
48 javadoc.xml
|
|
49 cdk/$ ant -buildfile javadoc.xml
|
|
50
|
|
51 The documenation is created as a series of .html pages in doc/api. If you use firefox, you can read
|
|
52 the documentation using the following command:
|
|
53
|
|
54 cdk/$ firefox doc/api/index.html
|
|
55
|
|
56 3. Running tests
|
|
57
|
|
58 After you compiled the code, you can do "ant test-all" to run the test suite of non-interactive, automated
|
|
59 tests. You might need to copy an appropriate junit.jar into your $ANT_HOME/lib
|
|
60 directory or somewhere else in your classpath.
|
|
61 Upon "ant dist-all test-dist-all test-all", you should see something like:
|
|
62
|
|
63 test:
|
|
64 Running org.openscience.cdk.test.CDKTests
|
|
65 Tests run: 1065, Failures: 7, Errors: 1, Time elapsed: 27,55 sec
|
|
66
|
|
67 As you can see, the vast majority of tests ran successfully, but that there
|
|
68 are failures and errors. The $CDK_HOME/reports/results.txt file contains
|
|
69 information about the outcome of the tests. Some tests might fail intentionally
|
|
70 to mark know issues in CDK.
|
|
71
|
|
72 There are also run interactive tests, like the Controller2DTest. In order to try them, you can edit the "run"
|
|
73 target in the build.xml file to look like this:
|
|
74
|
|
75 <target name="run" depends="dist">
|
|
76 <java classname="org.openscience.cdk.test.ControllerTest" fork="yes">
|
|
77 <arg value=""/>
|
|
78 <classpath>
|
|
79 <pathelement location="${dist}/jar/cdk.jar"/>
|
|
80 <pathelement path="${java.class.path}"/>
|
|
81 <pathelement location="."/>
|
|
82 <fileset dir="jar">
|
|
83 <include name="*.jar"/>
|
|
84 </fileset>
|
|
85 </classpath>
|
|
86 </java>
|
|
87 </target>
|
|
88
|
|
89 Then, a "ant run" should give you a window where you can add bonds to a given structure.
|
|
90 Currently, there are more than 2500 test, of which a large part tests the data, datadebug and
|
|
91 nonotify classes.
|
|
92
|
|
93 4. Using CDK
|
|
94
|
|
95 CDK is a class library intended to be used by other programs. It will not run
|
|
96 as a stand-alone program, although it contains some GUI- and command
|
|
97 line applications. In order to use the CDK in your program, you need to build
|
|
98 the distribution jars by running "ant dist-all". They will end up in
|
|
99 $CDK_HOME/dist/jar. Copy all cdk-*.jars as well as all jars from $CDK_HOME/jar
|
|
100 to the lib directory of the project for which you intend to have CDK support and
|
|
101 use them as you would use any other third party jar.
|
|
102
|
|
103 Alternatively, run "ant dist-large" to create a jar cdk-svn-YYYYMMDD.jar in
|
|
104 $CDK_HOME/dist/jar. This large jar contains all the CDK code and all third
|
|
105 party libraries that code depends on.
|
|
106
|
|
107 5. Examples and tutorials
|
|
108
|
|
109 To get started using the CDK, you may be interested in the following websites which contain
|
|
110 examples and tutorials:
|
|
111 * http://www.chemistry-development-kit.org
|
|
112 * http://blue.chem.psu.edu/~rajarshi/code/java
|
|
113 * http://www.redbrick.dcu.ie/~noel/CDKJython.html
|
|
114
|
|
115 Further examples can also be found in issues of the CDK News:
|
|
116 * http://cdknews.org/
|
|
117
|