ï»??xml version="1.0" encoding="utf-8" standalone="yes"?>av影片在线看,在线欧美福利,亚洲男人天堂http://www.aygfsteel.com/rain1102/category/42240.html<br/><font color="green" style="font-family: 华文行楷;font-size:16px;">化学¾l“构搜烦åQŒåŒ–学信息学åQŒç”Ÿç‰©ä¿¡æ¯å­¦åQŒå®žéªŒå®¤ä¿¡æ¯å­¦ç­‰ ã€?lt;/font><br/><font color="#3C1435">以高¿U‘技的生物、化学信息技术实现生命科学领域中专业数据的计½Ž—å’Œ½Ž¡ç†ã€æé«˜ç ”发能力、增强在¿U‘研和成本效率方面的国际竞争力,为生物、化学、医药和学术机构提供一‹¹çš„解决æ–ÒŽ¡ˆå’ŒæŠ€æœ¯å’¨è¯¢ã€?lt;/font><br/> <br/><font color="green" style="font-family: 华文行楷;font-size:16px;">子曰åQšå±é‚¦ä¸å…¥ï¼Œä¹±é‚¦ä¸å±…。天下有道则见,无道则隐ã€?lt;/font><font color="#3C1435"></font><br/> zh-cnThu, 30 Jun 2011 03:15:00 GMTThu, 30 Jun 2011 03:15:00 GMT60存储BitSet到MySQLä¸?-ç›æ€¼¼åº¦æœç´?/title><link>http://www.aygfsteel.com/rain1102/archive/2011/06/29/353331.html</link><dc:creator>周锐</dc:creator><author>周锐</author><pubDate>Wed, 29 Jun 2011 02:20:00 GMT</pubDate><guid>http://www.aygfsteel.com/rain1102/archive/2011/06/29/353331.html</guid><wfw:comment>http://www.aygfsteel.com/rain1102/comments/353331.html</wfw:comment><comments>http://www.aygfsteel.com/rain1102/archive/2011/06/29/353331.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/rain1102/comments/commentRss/353331.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/rain1102/services/trackbacks/353331.html</trackback:ping><description><![CDATA[分子¾l“构式相似度搜烦使用的是fingerprint˜q›è¡Œæ¯”较åQŒè€?div style="display: inline-block; "></div>fingerprint是一个二˜q›åˆ¶æ•°æ®åQŒCDK中ä‹É用BitSet来存储该信息åQŒå¦‚果要每次比对都去生成BitSetåQŒé‚£ä¹Ÿå¤ªè€—时间了åQŒæ‰€ä»¥æˆ‘们需要存å‚?div style="display: inline-block; "></div>fingerprint信息到数据库中,比较的时候,直接è¯Õd–åQŒè€ŒMySQL不支持存储BitSet数据åQŒç½‘站找了一下,有äh惛_ˆ°æŠ?div style="display: inline-block; "></div>BitSet转换成Blob信息˜q›è¡Œå­˜å‚¨åQŒç„¶åŽå–的时候再转换回来åQŒä¸æ„§æ˜¯ä¸ªå¥½çš„æ–¹æ³•。下面来看看代码实现åQ?br /><br /><div><div>/*</div><div> * Copyright (c) 2010-2020 Founder Ltd. All Rights Reserved.</div><div> *</div><div> * This software is the confidential and proprietary information of</div><div> * Founder. You shall not disclose such Confidential Information</div><div> * and shall use it only in accordance with the terms of the agreements</div><div> * you entered into with Founder.</div><div> *</div><div> */</div><div>package com.founder.mysql;</div><div></div><div>import java.sql.Blob;</div><div>import java.sql.Connection;</div><div>import java.sql.SQLException;</div><div>import java.util.BitSet;</div><div></div><div>public class MySQLUtil {</div><div></div><div><span style="white-space:pre"> </span>public static Blob bitsetToBlob(BitSet myBitSet, Connection con) throws SQLException {</div><div><span style="white-space:pre"> </span>    byte[] byteArray = toByteArray(myBitSet);</div><div><span style="white-space:pre"> </span>    Blob blob = con.createBlob();</div><div><span style="white-space:pre"> </span>    blob.setBytes(1, byteArray);</div><div><span style="white-space:pre"> </span>    return blob;</div><div><span style="white-space:pre"> </span>}</div><div></div><div><span style="white-space:pre"> </span>private static byte[] toByteArray(BitSet bits) {</div><div><span style="white-space:pre"> </span>    byte[] bytes = new byte[bits.length()/8+1];</div><div><span style="white-space:pre"> </span>    for (int i=0; i<bits.length(); i++) {</div><div><span style="white-space:pre"> </span>        if (bits.get(i)) {</div><div><span style="white-space:pre"> </span>            bytes[bytes.length-i/8-1] |= 1<<(i%8);</div><div><span style="white-space:pre"> </span>        }</div><div><span style="white-space:pre"> </span>    }</div><div><span style="white-space:pre"> </span>    return bytes;</div><div><span style="white-space:pre"> </span>}</div><div><span style="white-space:pre"> </span></div><div><span style="white-space:pre"> </span>public static BitSet blobToBitSet(Blob blob) throws SQLException {</div><div><span style="white-space:pre"> </span>    byte[] bytes = blob.getBytes(1, (int)blob.length());</div><div><span style="white-space:pre"> </span>    BitSet bitSet = fromByteArray(bytes);</div><div></div><div><span style="white-space:pre"> </span>    return bitSet;</div><div><span style="white-space:pre"> </span>}</div><div></div><div><span style="white-space:pre"> </span>private static BitSet fromByteArray(byte[] bytes) {</div><div><span style="white-space:pre"> </span>    BitSet bits = new BitSet(1024);  </div><div><span style="white-space:pre"> </span>    for (int i=0; i<bytes.length*8; i++) {</div><div><span style="white-space:pre"> </span>        if ((bytes[bytes.length-i/8-1]&(1<<(i%8))) > 0) {</div><div><span style="white-space:pre"> </span>            bits.set(i);</div><div><span style="white-space:pre"> </span>        }</div><div><span style="white-space:pre"> </span>    }</div><div><span style="white-space:pre"> </span>    return bits;</div><div><span style="white-space:pre"> </span>}</div><div>}</div></div><div><br />通过以上代码åQŒæˆ‘们就可以把fingerprintçš„å€ÆD®¡½Ž—出来,然后存储到MySQL数据库中了ã€?br />˜q›è¡Œç›æ€¼¼åº¦æœç´¢çš„æ—¶å€™ï¼Œå€¼éœ€è¦å–出已¾lå­˜å‚¨çš„倯D¿›è¡Œæ¯”对就可以了ã€?br /><div>float coefficient = Tanimoto.calculate(query, MySQLUtil.blobToBitSet(results.getBlob("bits")));<br />½W”者测试了187586条结构数据,大概需è¦?2¿U’左叻I¼ŒåŸºæœ¬æ»¡èƒö一般需求ã€?/div></div><img src ="http://www.aygfsteel.com/rain1102/aggbug/353331.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/rain1102/" target="_blank">周锐</a> 2011-06-29 10:20 <a href="http://www.aygfsteel.com/rain1102/archive/2011/06/29/353331.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Improved SMILES Substructure Searching-提高子结构搜索速度http://www.aygfsteel.com/rain1102/archive/2011/06/27/353100.html周锐周锐Mon, 27 Jun 2011 13:50:00 GMThttp://www.aygfsteel.com/rain1102/archive/2011/06/27/353100.htmlhttp://www.aygfsteel.com/rain1102/comments/353100.htmlhttp://www.aygfsteel.com/rain1102/archive/2011/06/27/353100.html#Feedback0http://www.aygfsteel.com/rain1102/comments/commentRss/353100.htmlhttp://www.aygfsteel.com/rain1102/services/trackbacks/353100.htmldaylight上面有一½‹‡æ–‡ç« ï¼Œè®²è§£å¦‚何提高子结构搜索速度åQ?a >http://www.daylight.com/meetings/emug00/Sayle/substruct.html
其大概意思就是先通过Fingerprint˜q›è¡Œ½{›é€‰ï¼Œ˜q™æ ·å¯ä»¥å¿«é€Ÿçš„½{›é€‰æŽ‰ä¸€éƒ¨åˆ†æ•°æ®åQŒå¯¹äºŽå¤æ‚结构更有效åQ›å¦å¤–就是根据原子个数或者特ŒDŠåŽŸå­ä¸ªæ•°è¿›è¡Œæ¯”è¾ƒï¼Œå¦‚æžœæŸ¥è¯¢¾l“构包含三个“N”原子åQŒé‚£ä¹ˆæ‰€è¦æŸ¥è¯¢å‡ºçš„结构所含有“N”的个数必™åÕd¤§äºŽç­‰äº?åQŒè¿™æ ·å¯¹äºŽåŒ…含一些特ŒDŠå…ƒç´ çš„æ•ˆæžœæ˜¯ç‰¹åˆ«çš„好;˜q˜æœ‰ž®±æ˜¯æ ÒŽ®åˆ†å­çš„一些性质˜q›è¡Œ½{›é€‰è¿‡æ»¤ï¼Œæ¯”如芳香性等åQ›æœ€åŽå†˜q›è¡ŒåŒšw…åQŒè¿™æ ·ä¸€æ¥å¯¹äºŽå¤æ‚结构以及含ç‰ÒŽ®Šå…ƒç´ çš„æŸ¥è¯¢é€Ÿåº¦ä¼šæé«˜å¾ˆå¤šã€?br />      最后文章中˜q˜ç»™å‡ºæµ‹è¯•数据,从中可以看出åQŒé€Ÿåº¦ä¸€èˆ¬æé«˜äº†ä¸‰å€å·¦å»I¼š
      
Name SMILES Correct FP Triage Before After Latest
Propane CCC 65337 66352 42411 42.59 17.99 14.34
Selenium [Se] 246 995 225 0.80 0.83 0.52
Benzene c1ccccc1 79426 79486 50893 72.69 27.56 20.29
Methane C 118519 118524 118511 61.29 5.47 4.25
Amido NC=O 25695 26975 14702 18.89 9.84 8.16
Methylbenzene Cc1ccccc1 54529 56869 20490 54.76 35.58 25.90
Carboxy OC=O 33009 34369 17809 23.86 12.48 10.24
Chlorine Cl 19424 23318 19424 11.23 1.38 1.12
Cyclopropane C1CC1 863 4358 484 8.24 7.78 5.02
Biphenyl c1ccccc1c2ccccc2 2967 5142 146 21.94 21.65 11.44
Dopamine NCCc1ccc(O)c(O)c1 829 913 23 1.85 2.09 1.47
Sulfisoxazole 7 8 3 0.50 0.88 0.51
BetaCarotene 2 16 1 0.48 0.68 0.58
Nitrofurantoin 0 0 0 0.42 0.58 0.52



周锐 2011-06-27 21:50 发表评论
]]>
chemtoolkits中分子描˜q°ç¬¦è®¡ç®—åQˆmolecular descriptor calculatoråQ‰å®Œæˆ?/title><link>http://www.aygfsteel.com/rain1102/archive/2011/04/12/348175.html</link><dc:creator>周锐</dc:creator><author>周锐</author><pubDate>Tue, 12 Apr 2011 14:54:00 GMT</pubDate><guid>http://www.aygfsteel.com/rain1102/archive/2011/04/12/348175.html</guid><wfw:comment>http://www.aygfsteel.com/rain1102/comments/348175.html</wfw:comment><comments>http://www.aygfsteel.com/rain1102/archive/2011/04/12/348175.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/rain1102/comments/commentRss/348175.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/rain1102/services/trackbacks/348175.html</trackback:ping><description><![CDATA[     摘要: 参照Rajarshi Guhaçš„CDKDescUI代码åQŒå·²¾læŠŠCDK的分子描˜q°ç¬¦è®¡ç®—åQˆmolecular descriptor calculatoråQ‰é›†æˆåˆ°chemtoolkits中了åQŒå…¶ä¸­åŒ…å?4个描˜q°ç¬¦ã€?nbsp; <a href='http://www.aygfsteel.com/rain1102/archive/2011/04/12/348175.html'>阅读全文</a><img src ="http://www.aygfsteel.com/rain1102/aggbug/348175.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/rain1102/" target="_blank">周锐</a> 2011-04-12 22:54 <a href="http://www.aygfsteel.com/rain1102/archive/2011/04/12/348175.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>使用rcdk˜q›è¡ŒåŒ–合物结构聚¾cÕd¤„ç?/title><link>http://www.aygfsteel.com/rain1102/archive/2011/04/11/348097.html</link><dc:creator>周锐</dc:creator><author>周锐</author><pubDate>Mon, 11 Apr 2011 13:41:00 GMT</pubDate><guid>http://www.aygfsteel.com/rain1102/archive/2011/04/11/348097.html</guid><wfw:comment>http://www.aygfsteel.com/rain1102/comments/348097.html</wfw:comment><comments>http://www.aygfsteel.com/rain1102/archive/2011/04/11/348097.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/rain1102/comments/commentRss/348097.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/rain1102/services/trackbacks/348097.html</trackback:ping><description><![CDATA[     摘要: rcdk, 是在R下面集成了CDK工具包,以此来通过CDK生成的化学性质数据˜q›è¡Œæ›´æ·±å±‚次的统计分析,下面来看看在rcdk中如何进行多个化合物¾l“构的聚¾c…R€?nbsp; <a href='http://www.aygfsteel.com/rain1102/archive/2011/04/11/348097.html'>阅读全文</a><img src ="http://www.aygfsteel.com/rain1102/aggbug/348097.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/rain1102/" target="_blank">周锐</a> 2011-04-11 21:41 <a href="http://www.aygfsteel.com/rain1102/archive/2011/04/11/348097.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>chemtoolkits(CTK)部分功能和界é?/title><link>http://www.aygfsteel.com/rain1102/archive/2011/04/09/347957.html</link><dc:creator>周锐</dc:creator><author>周锐</author><pubDate>Sat, 09 Apr 2011 09:16:00 GMT</pubDate><guid>http://www.aygfsteel.com/rain1102/archive/2011/04/09/347957.html</guid><wfw:comment>http://www.aygfsteel.com/rain1102/comments/347957.html</wfw:comment><comments>http://www.aygfsteel.com/rain1102/archive/2011/04/09/347957.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/rain1102/comments/commentRss/347957.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/rain1102/services/trackbacks/347957.html</trackback:ping><description><![CDATA[     摘要: Chemtoolkits(CTK)部分功能和界面已¾lå®Œæˆï¼Œç›®å‰¾|‘站的主要辅助性的功能已经加入åQŒæ¯”如新闅R€æ–‡ç« ã€ç•™­a€ä»¥åŠå…¶ä»–信息内容。化学信息学斚w¢çš„目前只整合了里宾斯åŸÞZº”规则计算åQŒä»¥åŠæ¯”较流行的OSIRIS Property Explorer (LogP, 溶解度、成药可能性预‹¹?ž®å·¥å…—÷€?nbsp; <a href='http://www.aygfsteel.com/rain1102/archive/2011/04/09/347957.html'>阅读全文</a><img src ="http://www.aygfsteel.com/rain1102/aggbug/347957.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/rain1102/" target="_blank">周锐</a> 2011-04-09 17:16 <a href="http://www.aygfsteel.com/rain1102/archive/2011/04/09/347957.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>CDK中根据smiles计算Fingerprinterå€?/title><link>http://www.aygfsteel.com/rain1102/archive/2009/10/26/299848.html</link><dc:creator>周锐</dc:creator><author>周锐</author><pubDate>Mon, 26 Oct 2009 14:24:00 GMT</pubDate><guid>http://www.aygfsteel.com/rain1102/archive/2009/10/26/299848.html</guid><wfw:comment>http://www.aygfsteel.com/rain1102/comments/299848.html</wfw:comment><comments>http://www.aygfsteel.com/rain1102/archive/2009/10/26/299848.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/rain1102/comments/commentRss/299848.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/rain1102/services/trackbacks/299848.html</trackback:ping><description><![CDATA[<p>package com.founder.cdk;</p> <p>import <a title="Java爱好è€? href="http://www.aygfsteel.com/rain1102" >Java</a>.util.BitSet;</p> <p>import org.openscience.cdk.DefaultChemObjectBuilder;<br /> import org.openscience.cdk.exception.CDKException;<br /> import org.openscience.cdk.exception.InvalidSmilesException;<br /> import org.openscience.cdk.fingerprint.ExtendedFingerprinter;<br /> import org.openscience.cdk.smiles.SmilesParser;</p> <p>public class FingerprinterTest {</p> <p> /**<br />   * @param args<br />   * @throws CDKException <br />   * @throws InvalidSmilesException <br />   */<br />  public static void main(String[] args) throws InvalidSmilesException, CDKException {<br />   ExtendedFingerprinter fingerprinter = new ExtendedFingerprinter();<br />   SmilesParser sp = new SmilesParser(DefaultChemObjectBuilder.getInstance());<br />   BitSet bt = fingerprinter.getFingerprint(sp.parseSmiles("c2ccc1ccccc1c2"));<br />  }</p> <p>}<br /> </p><img src ="http://www.aygfsteel.com/rain1102/aggbug/299848.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/rain1102/" target="_blank">周锐</a> 2009-10-26 22:24 <a href="http://www.aygfsteel.com/rain1102/archive/2009/10/26/299848.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>使用CDK生成分子¾l“æž„å›?/title><link>http://www.aygfsteel.com/rain1102/archive/2009/10/22/299271.html</link><dc:creator>周锐</dc:creator><author>周锐</author><pubDate>Thu, 22 Oct 2009 00:51:00 GMT</pubDate><guid>http://www.aygfsteel.com/rain1102/archive/2009/10/22/299271.html</guid><wfw:comment>http://www.aygfsteel.com/rain1102/comments/299271.html</wfw:comment><comments>http://www.aygfsteel.com/rain1102/archive/2009/10/22/299271.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/rain1102/comments/commentRss/299271.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/rain1102/services/trackbacks/299271.html</trackback:ping><description><![CDATA[<p>import <a title="Java爱好è€? href="http://www.aygfsteel.com/rain1102" >Java</a>.awt.Dimension;<br /> import <a title="Java爱好è€? href="http://www.aygfsteel.com/rain1102" >Java</a>.awt.Graphics2D;<br /> import <a title="Java爱好è€? href="http://www.aygfsteel.com/rain1102" >Java</a>.awt.geom.Rectangle2D;<br /> import <a title="Java爱好è€? href="http://www.aygfsteel.com/rain1102" >Java</a>.awt.image.BufferedImage;<br /> import <a title="Java爱好è€? href="http://www.aygfsteel.com/rain1102" >Java</a>.io.OutputStream;<br /> import <a title="Java爱好è€? href="http://www.aygfsteel.com/rain1102" >Java</a>.io.StringReader;<br /> import <a title="Java爱好è€? href="http://www.aygfsteel.com/rain1102" >Java</a>.util.Iterator;</p> <p>import javax.servlet.http.HttpServletResponse;<br /> import javax.vecmath.Point2d;</p> <p>import org.apache.log4j.Logger;<br /> import org.openscience.cdk.Molecule;<br /> import org.openscience.cdk.interfaces.IAtom;<br /> import org.openscience.cdk.interfaces.IMolecule;<br /> import org.openscience.cdk.io.MDLReader;<br /> import org.openscience.cdk.layout.StructureDiagramGenerator;<br /> import org.openscience.cdk.renderer.Renderer2DModel;<br /> import org.openscience.cdk.renderer.SimpleRenderer2D;</p> <p>public class ImageTypeExporterUtil {<br />  private static final Logger logger = Logger.getLogger(ImageTypeExporterUtil.class);<br />  <br />  /**<br />   * show molecule structure to image type (png, jpeg)<br />   * <br />   * @param mol String molecule stucture<br />   * @param length width and height<br />   * @param response HttpServletResponse object<br />   * @throws Exception<br />   *             if occurred exception ,then throw Exception<br />   */<br />  public static void showAsImage(String stucture, Integer length, HttpServletResponse response) throws Exception {<br />   logger.debug("ImageTypeExporterUtil.showAsImage..");<br />   <br />   StringReader mdl = new StringReader(stucture);<br />   MDLReader cdkMDL = new MDLReader(mdl);<br />   Molecule mol = new Molecule();<br />   cdkMDL.read(mol);<br />   // null coordinates<br />   Iterator<IAtom> itatoms = mol.atoms();<br />   while (itatoms.hasNext()) {<br />    IAtom atom = itatoms.next();<br />    atom.setPoint2d(null);<br />    atom.setPoint3d(null);<br />   }<br />   // generate 2D coordinates<br />   StructureDiagramGenerator sdg = new StructureDiagramGenerator();<br />   sdg.setMolecule(mol);<br />   try {<br />    sdg.generateCoordinates();<br />   } catch (Exception ex) {<br />    ex.printStackTrace();<br />   }<br />   IMolecule layedOutMol = sdg.getMolecule();<br />   // scale molecule<br />   final double UNDEF_POS = 100000;<br />   double minX = UNDEF_POS, minY = UNDEF_POS, maxX = UNDEF_POS, maxY = UNDEF_POS;<br />   itatoms = layedOutMol.atoms();<br />   while (itatoms.hasNext()) {<br />    IAtom atom = itatoms.next();<br />    Point2d point2d = atom.getPoint2d();<br />    if (minX == UNDEF_POS || minX > point2d.x)<br />     minX = point2d.x;<br />    if (minY == UNDEF_POS || minY > point2d.y)<br />     minY = point2d.y;<br />    if (maxX == UNDEF_POS || maxX < point2d.x)<br />     maxX = point2d.x;<br />    if (maxY == UNDEF_POS || maxY < point2d.y)<br />     maxY = point2d.y;<br />   }<br />   double scaleX = length / (maxX - minX + 1);<br />   double scaleY = length / (maxY - minY + 1);<br />   double scale = scaleX > scaleY ? scaleY : scaleX;<br />   double centreX = scale * (maxX + minX) / 2.;<br />   double centreY = scale * (maxY + minY) / 2.;<br />   double offsetX = length / 2. - centreX;<br />   double offsetY = length / 2. - centreY;<br />   itatoms = layedOutMol.atoms();<br />   while (itatoms.hasNext()) {<br />    IAtom atom = itatoms.next();<br />    Point2d a = atom.getPoint2d();<br />    Point2d b = new Point2d();<br />    b.x = a.x * scale + offsetX;<br />    b.y = a.y * scale + offsetY;<br />    atom.setPoint2d(b);<br />   }<br />   // set rendering properties<br />   Renderer2DModel r2dm = new Renderer2DModel();<br />   r2dm.setDrawNumbers(false);<br />   r2dm.setUseAntiAliasing(true);<br />   r2dm.setColorAtomsByType(true);<br />   r2dm.setShowAtomTypeNames(false);<br />   r2dm.setShowAromaticity(true);<br />   r2dm.setShowImplicitHydrogens(false);<br />   r2dm.setShowReactionBoxes(false);<br />   r2dm.setKekuleStructure(false);<br />   Dimension dim = new Dimension();<br />   dim.setSize(length, length);<br />   r2dm.setBackgroundDimension(dim);<br />   r2dm.setBackColor(java.awt.Color.WHITE);<br />   // render the image<br />   SimpleRenderer2D renderer = new SimpleRenderer2D();<br />   renderer.setRenderer2DModel(r2dm);<br />   BufferedImage bufferedImage = new BufferedImage(length, length,<br />     BufferedImage.TYPE_INT_RGB);<br />   Graphics2D graphics = bufferedImage.createGraphics();<br />   graphics.setPaint(java.awt.Color.WHITE);<br />   Rectangle2D.Float rectangle = new Rectangle2D.Float(0, 0, length, length);<br />   graphics.fill(rectangle);<br />   renderer.paintMolecule(layedOutMol, graphics);<br />   // write the image to response<br />   response.setContentType("image/png");<br />   OutputStream out = response.getOutputStream();<br />   try {<br />    javax.imageio.ImageIO.write(bufferedImage, "png", out);<br />   } finally {<br />    out.close();<br />   }<br />  }<br /> }<br /> </p><img src ="http://www.aygfsteel.com/rain1102/aggbug/299271.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/rain1102/" target="_blank">周锐</a> 2009-10-22 08:51 <a href="http://www.aygfsteel.com/rain1102/archive/2009/10/22/299271.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>使用CDK˜q›è¡Œå­ç»“构搜ç´?/title><link>http://www.aygfsteel.com/rain1102/archive/2009/10/20/298919.html</link><dc:creator>周锐</dc:creator><author>周锐</author><pubDate>Tue, 20 Oct 2009 00:33:00 GMT</pubDate><guid>http://www.aygfsteel.com/rain1102/archive/2009/10/20/298919.html</guid><wfw:comment>http://www.aygfsteel.com/rain1102/comments/298919.html</wfw:comment><comments>http://www.aygfsteel.com/rain1102/archive/2009/10/20/298919.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/rain1102/comments/commentRss/298919.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/rain1102/services/trackbacks/298919.html</trackback:ping><description><![CDATA[CDK提供了通过smiles倯D¿›è¡Œå­¾l“构搜烦,  org.openscience.cdk.smiles.smarts.SMARTSQueryTool<br /> <p>package com.founder.cdk;</p> <p>import <a title="Java爱好è€? href="http://www.aygfsteel.com/rain1102">Java</a>.io.File;<br /> import <a title="Java爱好è€? href="http://www.aygfsteel.com/rain1102">Java</a>.io.FileNotFoundException;<br /> import <a title="Java爱好è€? href="http://www.aygfsteel.com/rain1102">Java</a>.io.FileReader;<br /> import <a title="Java爱好è€? href="http://www.aygfsteel.com/rain1102">Java</a>.util.ArrayList;<br /> import <a title="Java爱好è€? href="http://www.aygfsteel.com/rain1102">Java</a>.util.List;</p> <p>import org.openscience.cdk.ChemFile;<br /> import org.openscience.cdk.ChemObject;<br /> import org.openscience.cdk.exception.CDKException;<br /> import org.openscience.cdk.interfaces.IAtomContainer;<br /> import org.openscience.cdk.io.MDLV2000Reader;<br /> import org.openscience.cdk.smiles.smarts.SMARTSQueryTool;<br /> import org.openscience.cdk.tools.manipulator.ChemFileManipulator;</p> <p>public class SMARTSQueryToolTest {</p> <p> static SMARTSQueryTool sqt;static {<br />         try {<br />             sqt = new <span style="color: #008000">SMARTSQueryTool</span>("c2ccc1ccccc1c2");<br />         } catch (CDKException e) {            <br />         }<br />     }</p> <p> /**<br />   * @param args<br />   */<br />  public static void main(String[] args) {<br />   String filename = "H:\\molecules.sdf";<br />   try {<br />             MDLV2000Reader reader = new MDLV2000Reader(new FileReader(new File(filename)));<br />             ChemFile chemFile = (ChemFile) reader.read((ChemObject) new ChemFile());<br />             List<IAtomContainer> containersList = ChemFileManipulator.getAllAtomContainers(chemFile);<br />             <br />             List<IAtomContainer> substructureList = new ArrayList<IAtomContainer>();<br />             <br />             <span style="color: #008000">sqt.setSmarts("c1ccc3c(c1)ccc4c2ccccc2ccc34"); </span> //重新讄¡½®åŒšw…çš„smileså€?br />             boolean matched = false;<br />             for (IAtomContainer molecule : containersList) {<br />                 <span style="color: #008000">matched = sqt.matches(molecule);</span><br />                 if (matched){<br />                  substructureList.add(molecule);<br />                 } <br />             }<br />             System.out.println(substructureList.size());<br />             <br />             for (IAtomContainer molecule : substructureList) {<br />                  System.out.println(molecule.getProperty("ID"));<br />             }<br />             <br />         } catch (CDKException e) {<br />             e.printStackTrace();<br />         } catch (FileNotFoundException e) {<br />            e.printStackTrace();<br />         }</p> <p> }</p> <p>}<br /> <br /> 通过‹¹‹è¯•, matchesæ–ÒŽ³•速度很慢, 一般一个结构需è¦?00ms-1000ms左右.<br /> </p><img src ="http://www.aygfsteel.com/rain1102/aggbug/298919.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/rain1102/" target="_blank">周锐</a> 2009-10-20 08:33 <a href="http://www.aygfsteel.com/rain1102/archive/2009/10/20/298919.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>使用CDK解析SDFæ–‡äšghttp://www.aygfsteel.com/rain1102/archive/2009/10/19/298802.html周锐周锐Mon, 19 Oct 2009 01:45:00 GMThttp://www.aygfsteel.com/rain1102/archive/2009/10/19/298802.htmlhttp://www.aygfsteel.com/rain1102/comments/298802.htmlhttp://www.aygfsteel.com/rain1102/archive/2009/10/19/298802.html#Feedback0http://www.aygfsteel.com/rain1102/comments/commentRss/298802.htmlhttp://www.aygfsteel.com/rain1102/services/trackbacks/298802.htmlpackage com.founder.cdk;

import Java.io.File;
import Java.io.FileNotFoundException;
import Java.io.FileReader;
import Java.util.List;

import org.openscience.cdk.ChemFile;
import org.openscience.cdk.ChemObject;
import org.openscience.cdk.Molecule;
import org.openscience.cdk.exception.CDKException;
import org.openscience.cdk.interfaces.IAtomContainer;
import org.openscience.cdk.io.MDLReader;
import org.openscience.cdk.io.MDLV2000Reader;
import org.openscience.cdk.tools.manipulator.ChemFileManipulator;

public class ReadSDFTest {

 /**
  * @param args
  * @throws CDKException
  * @throws FileNotFoundException
  */
 public static void main(String[] args) throws CDKException, FileNotFoundException {
  String filename = "H:\\molecules.sdf";
       
//  InputStream ins = ReadSDFTest.class.getClassLoader().getResourceAsStream(filename);
//  MDLReader reader = new MDLReader(ins);

   //alternatively, you can specify a file directly
   MDLV2000Reader reader = new MDLV2000Reader(new FileReader(new File(filename)));

  ChemFile chemFile = (ChemFile)reader.read((ChemObject)new ChemFile());
  
  List<IAtomContainer> containersList = ChemFileManipulator.getAllAtomContainers(chemFile);
  
  Molecule molecule = null;
  for (IAtomContainer mol : containersList) {
   molecule = (Molecule) mol;
   System.out.println(molecule.getProperties());
   System.out.println(molecule.getProperty("CD_MOLWEIGHT"));
//   Fingerprinter fp = new Fingerprinter();
//   BitSet bt = fp.getFingerprint(molecule);
//   System.out.println(bt);
  }
 }

}



周锐 2009-10-19 09:45 发表评论
]]>
使用CDK˜q›è¡Œç›æ€¼¼åº¦æœç´?/title><link>http://www.aygfsteel.com/rain1102/archive/2009/10/19/298801.html</link><dc:creator>周锐</dc:creator><author>周锐</author><pubDate>Mon, 19 Oct 2009 01:37:00 GMT</pubDate><guid>http://www.aygfsteel.com/rain1102/archive/2009/10/19/298801.html</guid><wfw:comment>http://www.aygfsteel.com/rain1102/comments/298801.html</wfw:comment><comments>http://www.aygfsteel.com/rain1102/archive/2009/10/19/298801.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/rain1102/comments/commentRss/298801.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/rain1102/services/trackbacks/298801.html</trackback:ping><description><![CDATA[<p>package com.founder.cdk;</p> <p>import <a title="Java爱好è€? href="http://www.aygfsteel.com/rain1102">Java</a>.io.StringReader;<br /> import <a title="Java爱好è€? href="http://www.aygfsteel.com/rain1102">Java</a>.sql.Connection;<br /> import <a title="Java爱好è€? href="http://www.aygfsteel.com/rain1102">Java</a>.sql.ResultSet;<br /> import <a title="Java爱好è€? href="http://www.aygfsteel.com/rain1102">Java</a>.sql.SQLException;<br /> import <a title="Java爱好è€? href="http://www.aygfsteel.com/rain1102">Java</a>.util.ArrayList;<br /> import <a title="Java爱好è€? href="http://www.aygfsteel.com/rain1102">Java</a>.util.BitSet;<br /> import <a title="Java爱好è€? href="http://www.aygfsteel.com/rain1102">Java</a>.util.List;</p> <p>import org.openscience.cdk.Molecule;<br /> import org.openscience.cdk.exception.CDKException;<br /> import org.openscience.cdk.fingerprint.Fingerprinter;<br /> import org.openscience.cdk.io.MDLReader;<br /> import org.openscience.cdk.similarity.Tanimoto;</p> <p>public class CDKTest {</p> <p> /**<br />   * @param args<br />   */<br />  public static void main(String[] args) {<br />   <br />   // MySQL<br />   long t1 = System.currentTimeMillis();<br />   try {<br />    Class.forName("com.mysql.jdbc.Driver").newInstance();<br />    Connection con = <a title="Java爱好è€? href="http://www.aygfsteel.com/rain1102">Java</a>.sql.DriverManager<br />      .getConnection(<br />        "jdbc:mysql://localhost/coocoo?useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull",<br />        "root", "root");<br />    </p> <p>   ResultSet results = null;<br />    String querySQL = "select id, structure from structure ";<br />    <br />    results = con.createStatement().executeQuery(querySQL);<br />  <br />    // dump out the results</p> <p>   List<Molecule> list = new ArrayList<Molecule>();<br />    Fingerprinter fp = new Fingerprinter();<br />    BitSet bt = null;<br />    while (results.next()) {<br />     Long id = results.getLong("id");<br />     <br />     //æ ÒŽ®¾l“构数据生成分子对象<br />     <span style="color: #008000">StringReader mdl = new StringReader(results.getString("structure"));<br />     MDLReader cdkMDL = new MDLReader(mdl);<br />     Molecule molecule = new Molecule();<br />     cdkMDL.read(molecule);</span><br />     if (id == 1220) {<br />      bt = fp.getFingerprint(molecule);<br />     }<br />     list.add(molecule);<br />     <br />    } <br />    System.out.println("size:=" + list.size());<br />    <br />    List<Molecule> resultList = new ArrayList<Molecule>();<br />          <br />          long t2 = System.currentTimeMillis();<br />          System.out.println("Thread: collection data in " + (t2 - t1) + " ms.");<br />          for (Molecule molecule : list) {<br />              try {<br />                  <span style="color: #008000">float coefficient = Tanimoto.calculate(fp.getFingerprint(molecule), bt);  //è®¡ç®—ç›æ€¼¼åº?br /> </span>                 if (coefficient > 0.9) {<br />                   resultList.add(molecule);<br />                  }<br />              } catch (CDKException e) {</p> <p>             }<br />          }<br />          long t3 = System.currentTimeMillis();<br />          <br />          System.out.println(resultList.size());<br />          System.out.println("Thread: Search in " + (t3 - t2) + " ms.");<br />          <br />    con.close();<br />   } catch (InstantiationException e) {<br />    e.printStackTrace();<br />   } catch (IllegalAccessException e) {<br />    e.printStackTrace();<br />   } catch (ClassNotFoundException e) {<br />    e.printStackTrace();<br />   } catch (SQLException e) {<br />    e.printStackTrace();<br />   } catch (CDKException e) {<br />    e.printStackTrace();<br />   } <br />   long t4 = System.currentTimeMillis();<br />         System.out.println("Thread: all in " + (t4 - t1) + " ms.");<br />  }</p> <p>}<br /> </p><img src ="http://www.aygfsteel.com/rain1102/aggbug/298801.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/rain1102/" target="_blank">周锐</a> 2009-10-19 09:37 <a href="http://www.aygfsteel.com/rain1102/archive/2009/10/19/298801.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Faster Fingerprint Search with Java & CDKhttp://www.aygfsteel.com/rain1102/archive/2009/10/18/298745.html周锐周锐Sun, 18 Oct 2009 06:09:00 GMThttp://www.aygfsteel.com/rain1102/archive/2009/10/18/298745.htmlhttp://www.aygfsteel.com/rain1102/comments/298745.htmlhttp://www.aygfsteel.com/rain1102/archive/2009/10/18/298745.html#Feedback0http://www.aygfsteel.com/rain1102/comments/commentRss/298745.htmlhttp://www.aygfsteel.com/rain1102/services/trackbacks/298745.html

Rich Apodaca wrote a great serious posts named Fast Substructure Search Using Open Source Tools providing details on substructure search with MySQL. But, however, poor binary data operation functions of MySQL limited the implementation of similar structure search which typically depends on the calculation of Tanimato coefficient. We are going to use Java & CDK to add this feature.

As default output of CDK fingerprint, java.util.BitSet with Serializable interface is perfect data format of fingerprint data storage. Java itself provides several collections such as ArrayList, LinkedList, Vector class in package Java.util. To provide web access to the search engine, thread unsafe ArrayList and LinkedList have to be kicked out. How about Vector? Once all the fingerprint data is well prepared, the collection  function we need to do similarity search is just iteration. No add, no delete. So, a light weight array is enough.

Most of the molecule information is stored in MySQL database, so we are going to map fingerprint to corresponding row in data table. Here is the MolDFData class, we use a long variable to store corresponding primary key in data table.

public class MolDFData implements Serializable {
    private long id;
   private BitSet fingerprint;
    public MolDFData(long id, BitSet fingerprint) {
        this.id = id;
        this.fingerprint = fingerprint;
    }
    public long getId() {
        return id;
    }
    public void setId(long id) {
        this.id = id;
    }
    public BitSet getFingerprint() {
        return fingerprint;
    }
    public void setFingerprint(BitSet fingerprint) {
        this.fingerprint = fingerprint;
    }
}

This is how we storage our fingerprints.

private MolFPData[] arrayData;

No big deal with similarity search. Just calculate the Tanimoto coefficient, if it’s bigger than minimal  similarity you set, add this one into result.

    public List searchTanimoto(BitSet bt, float minSimlarity) {

        List resultList = new LinkedList();
        int i;
        for (i = 0; i < arrayData.length; i++) {
            MolDFData aListData = arrayData[i];
            try {
                float coefficient = Tanimoto.calculate(aListData.getFingerprint(), bt);
                if (coefficient > minSimlarity) {
                    resultList.add(new SearchResultData(aListData.getId(), coefficient));
                }
            } catch (CDKException e) {
            }
            Collections.sort(resultList);
        }
        return resultList;
    }
Pretty ugly code?  Maybe. But it really works, at a acceptable speed.

Tests were done using the code blow on a macbook(Intel Core Due 1.83 GHz, 2G RAM).

long t3 = System.currentTimeMillis();
List<SearchResultData> listResult = se.searchTanimoto(bs, 0.8f);
long t4 = System.currentTimeMillis();
System.out.println("Thread: Search done in " + (t4 - t3) + " ms.");

In my database of 87364 commercial compounds, it takes 335 ms.



周锐 2009-10-18 14:09 发表评论
]]>
CDKä¸­çš„ç›æ€¼¼åº¦æœç´?/title><link>http://www.aygfsteel.com/rain1102/archive/2009/10/18/298744.html</link><dc:creator>周锐</dc:creator><author>周锐</author><pubDate>Sun, 18 Oct 2009 05:36:00 GMT</pubDate><guid>http://www.aygfsteel.com/rain1102/archive/2009/10/18/298744.html</guid><wfw:comment>http://www.aygfsteel.com/rain1102/comments/298744.html</wfw:comment><comments>http://www.aygfsteel.com/rain1102/archive/2009/10/18/298744.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/rain1102/comments/commentRss/298744.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/rain1102/services/trackbacks/298744.html</trackback:ping><description><![CDATA[<p>/*  $RCSfile$<br />  *  $Author$<br />  *  $Date$<br />  *  $Revision$<br />  *<br />  *  Copyright (C) 1997-2007  The Chemistry Development Kit (CDK) project<br />  *<br />  *  Contact: cdk-devel@lists.sourceforge.net<br />  *<br />  *  This program is free software; you can redistribute it and/or<br />  *  modify it under the terms of the GNU Lesser General Public License<br />  *  as published by the Free Software Foundation; either version 2.1<br />  *  of the License, or (at your option) any later version.<br />  *  All we ask is that proper credit is given for our work, which includes<br />  *  - but is not limited to - adding the above copyright notice to the beginning<br />  *  of your source code files, and to any copyright notice that you may distribute<br />  *  with programs based on this work.<br />  *<br />  *  This program is distributed in the hope that it will be useful,<br />  *  but WITHOUT ANY WARRANTY; without even the implied warranty of<br />  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the<br />  *  GNU Lesser General Public License for more details.<br />  *<br />  *  You should have received a copy of the GNU Lesser General Public License<br />  *  along with this program; if not, write to the Free Software<br />  *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.<br />  *<br />  */<br /> package org.openscience.cdk.similarity;</p> <p><br /> import org.openscience.cdk.annotations.TestClass;<br /> import org.openscience.cdk.annotations.TestMethod;<br /> import org.openscience.cdk.exception.CDKException;</p> <p>import <a title="Java爱好è€? href="http://www.aygfsteel.com/rain1102" >Java</a>.util.BitSet;</p> <p>/**<br />  *  Calculates the Tanimoto coefficient for a given pair of two <br />  *  fingerprint bitsets or real valued feature vectors.<br />  *<br />  *  The Tanimoto coefficient is one way to <br />  *  quantitatively measure the "distance" or similarity of <br />  *  two chemical structures. <br />  *<br />  *  <p>You can use the FingerPrinter class to retrieve two fingerprint bitsets.<br />  *  We assume that you have two structures stored in cdk.Molecule objects.<br />  *  A tanimoto coefficient can then be calculated like:<br />  *  <pre><br />  *   BitSet fingerprint1 = Fingerprinter.getFingerprint(molecule1);<br />  *   BitSet fingerprint2 = Fingerprinter.getFingerprint(molecule2);<br />  *   float tanimoto_coefficient = Tanimoto.calculate(fingerprint1, fingerprint2);<br />  *  </pre><br />  *<br />  *  <p>The FingerPrinter assumes that hydrogens are explicitely given, if this <br />  *  is desired! <br />  *  <p>Note that the continuous Tanimoto coefficient does not lead to a metric space<br />  *<br />  *@author         steinbeck<br />  * @cdk.githash<br />  *@cdk.created    2005-10-19<br />  *@cdk.keyword    jaccard<br />  *@cdk.keyword    similarity, tanimoto<br />  * @cdk.module fingerprint<br />  */<br /> @TestClass("org.openscience.cdk.similarity.TanimotoTest")<br /> public class Tanimoto <br /> {</p> <p>    /**<br />      * Evaluates Tanimoto coefficient for two bit sets.<br />      *<br />      * @param bitset1 A bitset (such as a fingerprint) for the first molecule<br />      * @param bitset2 A bitset (such as a fingerprint) for the second molecule<br />      * @return The Tanimoto coefficient<br />      * @throws org.openscience.cdk.exception.CDKException  if bitsets are not of the same length<br />      */<br />     @TestMethod("testTanimoto1,testTanimoto2")<br />     public static float <span style="color: red">calculate</span>(BitSet bitset1, BitSet bitset2) throws CDKException<br />     {<br />         float _bitset1_cardinality = bitset1.cardinality();<br />         float _bitset2_cardinality = bitset2.cardinality();<br />         if (bitset1.size() != bitset2.size()) {<br />             throw new CDKException("Bisets must have the same bit length");<br />         }<br />         BitSet one_and_two = (BitSet)bitset1.clone();<br />         one_and_two.and(bitset2);<br />         float _common_bit_count = one_and_two.cardinality();<br />         return _common_bit_count/(_bitset1_cardinality + _bitset2_cardinality - _common_bit_count);<br />     }<br />     <br />     /**<br />      * Evaluates the continuous Tanimoto coefficient for two real valued vectors.<br />      *<br />      * @param features1 The first feature vector<br />      * @param features2 The second feature vector<br />      * @return The continuous Tanimoto coefficient<br />      * @throws org.openscience.cdk.exception.CDKException  if the features are not of the same length<br />      */<br />     @TestMethod("testTanimoto3")<br />     public static float <span style="color: red">calculate</span>(double[] features1, double[] features2) throws CDKException {</p> <p>        if (features1.length != features2.length) {<br />             throw new CDKException("Features vectors must be of the same length");<br />         }</p> <p>        int n = features1.length;<br />         double ab = 0.0;<br />         double a2 = 0.0;<br />         double b2 = 0.0;</p> <p>        for (int i = 0; i < n; i++) {<br />             ab += features1[i] * features2[i];<br />             a2 += features1[i]*features1[i];<br />             b2 += features2[i]*features2[i];<br />         }<br />         return (float)ab/(float)(a2+b2-ab);<br />     }<br /> }<br /> <br /> 通过源码可以看出<span style="color: red">calculate</span>(BitSet bitset1, BitSet bitset2)æ–ÒŽ³•,是通过比较两个分子的fingerprint的位,来计½Ž—相似度.通过BitSetçš„and操作得到共同的个æ•?然后在除以æ€Õd…±ä¸ºtrue的个æ•?˜q™æ ·ž®±å¾—到相似å€?</p><img src ="http://www.aygfsteel.com/rain1102/aggbug/298744.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/rain1102/" target="_blank">周锐</a> 2009-10-18 13:36 <a href="http://www.aygfsteel.com/rain1102/archive/2009/10/18/298744.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>JChemPaint (ç”?D化学¾l“构的Java½E‹åº)http://www.aygfsteel.com/rain1102/archive/2009/10/17/298709.html周锐周锐Sat, 17 Oct 2009 13:53:00 GMThttp://www.aygfsteel.com/rain1102/archive/2009/10/17/298709.htmlhttp://www.aygfsteel.com/rain1102/comments/298709.htmlhttp://www.aygfsteel.com/rain1102/archive/2009/10/17/298709.html#Feedback0http://www.aygfsteel.com/rain1102/comments/commentRss/298709.htmlhttp://www.aygfsteel.com/rain1102/services/trackbacks/298709.htmlJChemPaint (or JCP for short here) is the editor and viewer included in CDK for 2D chemical structures. It is implemented in several forms: a Java application and two varieties of Java applet.

JChemPaint was started by Christoph Steinbeck in the late 1990's to be the complementary structure editor to Jmol. It was then co-developed by Egon Willighagen and others. Jmol again is a visualisation and analysis tool for 3D molecular structures, started by Dan Gezelter at Notre Dame University, initiator of the Open Science Project and, like JChemPaint, developed by an international team of opensource programmers.

In at least three aspects JChemPaint is different from other 2D editors:

  • JChemPaint is open source and free software. We believe that scientific software, especially when its development was publicly funded, should be free. As the GNU people put it: «`Free software´ is a matter of liberty, not price. To understand the concept, you should think of `free speech´, not `free beer´». Everyone can participate in the development of the program. Everyone can download and change the source code, provided that they make the changes publicly available again, according to the GNU Lesser General Public License, LGPL. This ensures that the community can take advantage of any bugfix or enhancement made to the system. It also ensures that a scientist, who needs a standard piece of software like a structure editor as a helper application in his/her new program, does not have to reinvent the wheel over and over again because all the structure editors that have been written before are now proprietary software. If there is a free structure editor, he/she can focus on the real science.
  • JChemPaint is in constant development and you can help (see below).
  • Since JChemPaint is written in Java, it runs on any computing platform and operating system for which a Java Virtual Machine (of version >= 1.3 up to JCP 2.4 and version >= 1.5 for JCP > 2.4) has been implemented (like Linux, Windows, Solaris, AIX and others).
  • JChemPaint is available free of charge.
  • JChemPaint is translated into several languages: Dutch, French, German, Polish, Portuguese and Spanish.
集成EditorApplett到jsp™åµé¢é‡?

<applet code="org.openscience.jchempaint.applet.JChemPaintEditorApplet"
archive="jchempaint-applet-core.jar" name="Editor"
width="550" height="400">
</applet>

集成ViewerApplet到jsp™åµé¢é‡?
<applet code="org.openscience.jchempaint.applet.JChemPaintViewerApplet"
archive="jchempaint-applet-core.jar"
width="550" height="400">

Applet methods:

Reading from the applet

  • getMolFile()
  • getSmiles()
  • getSmilesChiral()
  • getParameter()
  • getParameterInfo()
  • getAppletInfo()
  • getLocale()
  • getImage()
  • getTheJcpp()

Writing to the applet

  • setMolFile()
  • setMolFileWithReplace()
  • addMolFileWithReplace()
  • loadModelFromUrl()
  • loadModelFromSmiles()
  • clear()
  • selectAtom()
  • init()
  • start()
  • stop()
  • initPanelAndModel()
  • setTheJcpp()
  • setTheModel()


周锐 2009-10-17 21:53 发表评论
]]>
Ö÷Õ¾Ö©Öë³ØÄ£°å£º ÓÎÏ·| µÂ²ýÏØ| ½ºÓÏØ| Îİ²ÏØ| ½«ÀÖÏØ| ÅæÏØ| ÓÜÖÐÏØ| µÂÑôÊÐ| Æ½Ë³ÏØ| ÌìµÈÏØ| ×¼¸ñ¶ûÆì| ¾Å½­ÏØ| äü¹ØÏØ| ÇɼÒÏØ| ʯ³ÇÏØ| íã¿ÚÏØ| ÎäÇ¿ÏØ| ÂêÇúÏØ| Á®½­ÊÐ| ¹«°²ÏØ| Íò°²ÏØ| »ôÁÖ¹ùÀÕÊÐ| ÇàÌïÏØ| ·ÊÏçÏØ| º£Ô­ÏØ| ÷ÖÝÊÐ| Æ½ÒØÏØ| ÌìÕòÏØ| ²¼¶û½òÏØ| äØÌ¶ÏØ| ¶«·áÏØ| ÇúËÉÏØ| ²Æ¾­| ·ï³ÇÊÐ| ±±º£ÊÐ| ÓñϪÊÐ| ¿Æ¼¼| Æ¤É½ÏØ| °ÍÁÖ×óÆì| ÇßË®ÏØ| ¾®ÚêÏØ|