{"id":143,"date":"2009-04-20T16:08:52","date_gmt":"2009-04-20T14:08:52","guid":{"rendered":"http:\/\/www.steinbeck-molecular.de\/steinblog\/?p=143"},"modified":"2009-05-19T13:42:12","modified_gmt":"2009-05-19T11:42:12","slug":"egons-introductory-talk-about-getting-started-with-cdk","status":"publish","type":"post","link":"http:\/\/www.steinbeck-molecular.de\/steinblog\/index.php\/2009\/04\/20\/egons-introductory-talk-about-getting-started-with-cdk\/","title":{"rendered":"Egon&#8217;s introductory talk about getting started with CDK"},"content":{"rendered":"<p>After my opening talk at the CDK workshop, Egon Willighagen gave an introduction on how to get started with the CDK. He uses the scripting environment Groovy to demonstrate things.<\/p>\n<p>Egon has prepared a <a href=\"http:\/\/www.scribd.com\/doc\/14446588\/CDK-Workshop-2009-Intro-Course-Material\" target=\"_blank\">LaTeX document with his teaching material<\/a> as well as the code examples on at <a href=\"http:\/\/pele.farmbio.uu.se\/groovy\" target=\"_blank\">http:\/\/pele.farmbio.uu.se\/groovy<\/a>. Turns out that Groovy scripting is a really nice environment for writing CDK code. You can say things like<\/p>\n<blockquote><p>import org.openscience.cdk.interfaces.*;<br \/>\nimport org.openscience.cdk.*;<br \/>\nimport org.openscience.cdk.atomtype.*;<br \/>\nimport org.openscience.cdk.config.*;<br \/>\nimport org.openscience.cdk.tools.manipulator.*;<br \/>\nimport javax.vecmath.Point3d;<\/p>\n<p>molecule = new Molecule();<br \/>\natom = new Atom(Elements.CARBON);<br \/>\nmolecule.addAtom(atom);<br \/>\nmatcher = CDKAtomTypeMatcher.getInstance(<br \/>\nDefaultChemObjectBuilder.getInstance()<br \/>\n);<br \/>\ntype = matcher.findMatchingAtomType(molecule, atom);<br \/>\nAtomTypeManipulator.configure(atom, type);<br \/>\nprintln &#8220;Atom type: $type.atomTypeName&#8221;<\/p><\/blockquote>\n<p>As you can see, you do not need to handle things like Exceptions or Data Types. Groovy, like most other scripting environments will handle that for you.<\/p>\n<p>If CDK.jar is in your CLASSPATH, you can run this code inside GroovyConsole and you&#8217;ll get &#8220;C.sp3&#8221; as an output.<\/p>\n<p>Egon&#8217;s course material have many more examples.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>After my opening talk at the CDK workshop, Egon Willighagen gave an introduction on how to get started with the CDK. He uses the scripting environment Groovy to demonstrate things. Egon has prepared a LaTeX document with his teaching material as well as the code examples on at http:\/\/pele.farmbio.uu.se\/groovy. Turns out that Groovy scripting is [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[23,5,15,14,7,19,29],"tags":[42,34,43,72],"class_list":["post-143","post","type-post","status-publish","format-standard","hentry","category-chemistry-development-kit","category-chemoinformatics","category-conferences-and-meetings","category-life-of-chris","category-open-science","category-people","category-scientific-culture","tag-cdk","tag-cdkws2009","tag-cheminformatics","tag-open-source"],"_links":{"self":[{"href":"http:\/\/www.steinbeck-molecular.de\/steinblog\/index.php\/wp-json\/wp\/v2\/posts\/143"}],"collection":[{"href":"http:\/\/www.steinbeck-molecular.de\/steinblog\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.steinbeck-molecular.de\/steinblog\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.steinbeck-molecular.de\/steinblog\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/www.steinbeck-molecular.de\/steinblog\/index.php\/wp-json\/wp\/v2\/comments?post=143"}],"version-history":[{"count":2,"href":"http:\/\/www.steinbeck-molecular.de\/steinblog\/index.php\/wp-json\/wp\/v2\/posts\/143\/revisions"}],"predecessor-version":[{"id":205,"href":"http:\/\/www.steinbeck-molecular.de\/steinblog\/index.php\/wp-json\/wp\/v2\/posts\/143\/revisions\/205"}],"wp:attachment":[{"href":"http:\/\/www.steinbeck-molecular.de\/steinblog\/index.php\/wp-json\/wp\/v2\/media?parent=143"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.steinbeck-molecular.de\/steinblog\/index.php\/wp-json\/wp\/v2\/categories?post=143"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.steinbeck-molecular.de\/steinblog\/index.php\/wp-json\/wp\/v2\/tags?post=143"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}