锘??xml version="1.0" encoding="utf-8" standalone="yes"?>在线观看视频免费一区二区三区,国产天堂在线播放视频,99精品视频免费观看http://www.aygfsteel.com/rain1102/category/42240.html<br/><font color="green" style="font-family: 鍗庢枃琛屾シ;font-size:16px;">鍖栧緇撴瀯鎼滅儲錛屽寲瀛︿俊鎭錛岀敓鐗╀俊鎭錛屽疄楠屽淇℃伅瀛︾瓑 銆?lt;/font><br/><font color="#3C1435">浠ラ珮縐戞妧鐨勭敓鐗┿佸寲瀛︿俊鎭妧鏈疄鐜扮敓鍛界瀛﹂鍩熶腑涓撲笟鏁版嵁鐨勮綆楀拰綆$悊銆佹彁楂樼爺鍙戣兘鍔涖佸寮哄湪縐戠爺鍜屾垚鏈晥鐜囨柟闈㈢殑鍥介檯绔炰簤鍔涳紝涓虹敓鐗┿佸寲瀛︺佸尰鑽拰瀛︽湳鏈烘瀯鎻愪緵涓嫻佺殑瑙e喅鏂規(guī)鍜屾妧鏈挩璇€?lt;/font><br/> <br/><font color="green" style="font-family: 鍗庢枃琛屾シ;font-size:16px;">瀛愭洶錛氬嵄閭︿笉鍏ワ紝涔遍偊涓嶅眳銆傚ぉ涓嬫湁閬撳垯瑙侊紝鏃犻亾鍒欓殣銆?lt;/font><font color="#3C1435"></font><br/> zh-cnThu, 30 Jun 2011 03:15:00 GMTThu, 30 Jun 2011 03:15:00 GMT60瀛樺偍BitSet鍒癕ySQL涓?-鐩鎬技搴︽悳绱?/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[鍒嗗瓙緇撴瀯寮忕浉浼煎害鎼滅儲浣跨敤鐨勬槸fingerprint榪涜姣旇緝錛岃?div style="display: inline-block; "></div>fingerprint鏄竴涓簩榪涘埗鏁版嵁錛孋DK涓嬌鐢˙itSet鏉ュ瓨鍌ㄨ淇℃伅錛屽鏋滆姣忔姣斿閮藉幓鐢熸垚BitSet錛岄偅涔熷お鑰楁椂闂翠簡錛屾墍浠ユ垜浠渶瑕佸瓨鍌?div style="display: inline-block; "></div>fingerprint淇℃伅鍒版暟鎹簱涓紝姣旇緝鐨勬椂鍊欙紝鐩存帴璇誨彇錛岃孧ySQL涓嶆敮鎸佸瓨鍌˙itSet鏁版嵁錛岀綉绔欐壘浜嗕竴涓嬶紝鏈変漢鎯沖埌鎶?div style="display: inline-block; "></div>BitSet杞崲鎴怋lob淇℃伅榪涜瀛樺偍錛岀劧鍚庡彇鐨勬椂鍊欏啀杞崲鍥炴潵錛屼笉鎰ф槸涓ソ鐨勬柟娉曘備笅闈㈡潵鐪嬬湅浠g爜瀹炵幇錛?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 />閫氳繃浠ヤ笂浠g爜錛屾垜浠氨鍙互鎶奻ingerprint鐨勫艱綆楀嚭鏉ワ紝鐒跺悗瀛樺偍鍒癕ySQL鏁版嵁搴撲腑浜嗐?br />榪涜鐩鎬技搴︽悳绱㈢殑鏃跺欙紝鍊奸渶瑕佸彇鍑哄凡緇忓瓨鍌ㄧ殑鍊艱繘琛屾瘮瀵瑰氨鍙互浜嗐?br /><div>float coefficient = Tanimoto.calculate(query, MySQLUtil.blobToBitSet(results.getBlob("bits")));<br />絎旇呮祴璇曚簡187586鏉$粨鏋勬暟鎹紝澶ф闇瑕?2縐掑乏鍙籌紝鍩烘湰婊¤凍涓鑸渶姹傘?/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涓婇潰鏈変竴綃囨枃绔狅紝璁茶В濡備綍鎻愰珮瀛愮粨鏋勬悳绱㈤熷害錛?a >http://www.daylight.com/meetings/emug00/Sayle/substruct.html
鍏跺ぇ姒傛剰鎬濆氨鏄厛閫氳繃Fingerprint榪涜絳涢夛紝榪欐牱鍙互蹇熺殑絳涢夋帀涓閮ㄥ垎鏁版嵁錛屽浜庡鏉傜粨鏋勬洿鏈夋晥錛涘彟澶栧氨鏄牴鎹師瀛愪釜鏁版垨鑰呯壒孌婂師瀛愪釜鏁拌繘琛屾瘮杈冿紝濡傛灉鏌ヨ緇撴瀯鍖呭惈涓変釜“N”鍘熷瓙錛岄偅涔堟墍瑕佹煡璇㈠嚭鐨勭粨鏋勬墍鍚湁“N”鐨勪釜鏁板繀欏誨ぇ浜庣瓑浜?錛岃繖鏍峰浜庡寘鍚竴浜涚壒孌婂厓绱犵殑鏁堟灉鏄壒鍒殑濂斤紱榪樻湁灝辨槸鏍規(guī)嵁鍒嗗瓙鐨勪竴浜涙ц川榪涜絳涢夎繃婊わ紝姣斿鑺抽鎬х瓑錛涙渶鍚庡啀榪涜鍖歸厤錛岃繖鏍蜂竴鏉ュ浜庡鏉傜粨鏋勪互鍙?qiáng)鍚壱?guī)畩鍏冪礌鐨勬煡璇㈤熷害浼?xì)鎻愰珮寰堝銆?br />      鏈鍚庢枃绔犱腑榪樼粰鍑烘祴璇曟暟鎹紝浠庝腑鍙互鐪嬪嚭錛岄熷害涓鑸彁楂樹簡涓夊嶅乏鍙籌細(xì)
      
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涓垎瀛愭弿榪扮璁$畻錛坢olecular descriptor calculator錛夊畬鎴?/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鐨凜DKDescUI浠g爜錛屽凡緇忔妸CDK鐨勫垎瀛愭弿榪扮璁$畻錛坢olecular descriptor calculator錛夐泦鎴愬埌chemtoolkits涓簡錛屽叾涓寘鍚?4涓弿榪扮銆?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榪涜鍖栧悎鐗╃粨鏋勮仛綾誨鐞?/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涓嬮潰闆嗘垚浜咰DK宸ュ叿鍖咃紝浠ユ鏉ラ氳繃CDK鐢熸垚鐨勫寲瀛︽ц川鏁版嵁榪涜鏇存繁灞傛鐨勭粺璁″垎鏋愶紝涓嬮潰鏉ョ湅鐪嬪湪rcdk涓浣曡繘琛屽涓寲鍚堢墿緇撴瀯鐨勮仛綾匯?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)閮ㄥ垎鍔熻兘鍜岀晫闈㈠凡緇忓畬鎴愶紝鐩墠緗戠珯鐨勪富瑕佽緟鍔╂х殑鍔熻兘宸茬粡鍔犲叆錛屾瘮濡傛柊闂匯佹枃绔犮佺暀璦浠ュ強(qiáng)鍏朵粬淇℃伅鍐呭銆傚寲瀛︿俊鎭鏂歸潰鐨勭洰鍓嶅彧鏁村悎浜嗛噷瀹炬柉鍩轟簲瑙勫垯璁$畻錛屼互鍙?qiáng)姣旇緝娴佽鐨凮SIRIS 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涓牴鎹畇miles璁$畻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鐢熸垚鍒嗗瓙緇撴瀯鍥?/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榪涜瀛愮粨鏋勬悳绱?/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鍊艱繘琛屽瓙緇撴瀯鎼滅儲,  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> //閲嶆柊璁劇疆鍖歸厤鐨剆miles鍊?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鏂規(guī)硶閫熷害寰堟參, 涓鑸竴涓粨鏋勯渶瑕?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瑙f瀽SDF鏂囦歡http://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榪涜鐩鎬技搴︽悳绱?/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 />     //鏍規(guī)嵁緇撴瀯鏁版嵁鐢熸垚鍒嗗瓙瀵硅薄<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)鏂規(guī)硶,鏄氳繃姣旇緝涓や釜鍒嗗瓙鐨刦ingerprint鐨勪綅,鏉ヨ綆楃浉浼煎害.閫氳繃BitSet鐨刟nd鎿嶄綔寰楀埌鍏卞悓鐨勪釜鏁?鐒跺悗鍦ㄩ櫎浠ユ誨叡涓簍rue鐨勪釜鏁?榪欐牱灝卞緱鍒扮浉浼煎?</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鍖栧緇撴瀯鐨凧ava紼嬪簭)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鍒癹sp欏甸潰閲?

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

闆嗘垚ViewerApplet鍒癹sp欏甸潰閲?
<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 鍙戣〃璇勮
]]>
主站蜘蛛池模板: 花垣县| 鄂托克旗| 工布江达县| 勃利县| 友谊县| 和顺县| 陆川县| 丰宁| 东方市| 东丰县| 巴南区| 阿拉善盟| 张北县| 望奎县| 顺昌县| 临清市| 左贡县| 佛教| 乳源| 靖州| 海淀区| 改则县| 保山市| 金堂县| 泸定县| 青岛市| 金华市| 曲阳县| 黄平县| 双辽市| 宜宾市| 宁国市| 丰台区| 铜鼓县| 专栏| 五河县| 象州县| 平乡县| 洞头县| 吴川市| 扎囊县|