posts - 431,  comments - 344,  trackbacks - 0

          package com.founder.openbabel;

          import org.openbabel.OBConversion;
          import org.openbabel.OBMol;
          import org.openbabel.OBSmartsPattern;

          public class Test {

           public static void main(String[] args) {
                  // Initialise
                  System.loadLibrary("openbabel_java");

                  // Read molecule from SMILES string
                  OBConversion conv = new OBConversion();
                  OBMol mol = new OBMol();
                  conv.SetInFormat("smi");
                  conv.ReadString(mol, "C(Cl)(=O)CCC(=O)Cl");

                  // What are the indices of the carbon atoms
                  // of the acid chloride groups?
                  OBSmartsPattern acidpattern = new OBSmartsPattern();
                  acidpattern.Init("C(=O)Cl");
                  long t1 = System.currentTimeMillis();
                  boolean flag = acidpattern.Match(mol);
                  long t2 = System.currentTimeMillis();
                  System.out.println("Cost time:" + (t2-t1) + "ms");
                  System.out.println(flag);
              }

          }

          posted on 2009-10-21 08:55 周銳 閱讀(546) 評論(0)  編輯  收藏 所屬分類: ChemistryOpenbabel
          主站蜘蛛池模板: 增城市| 庆城县| 那曲县| 罗田县| 蛟河市| 顺昌县| 保康县| 连州市| 曲周县| 洮南市| 巨野县| 海晏县| 滨海县| 安丘市| 武汉市| 驻马店市| 武穴市| 芜湖市| 涟水县| 望都县| 越西县| 永州市| 东山县| 山东| 剑河县| 长宁县| 兴城市| 神木县| 柘荣县| 昭通市| 东至县| 德昌县| 西城区| 连云港市| 曲靖市| 张掖市| 阳谷县| 昌宁县| 博客| 凌海市| 同江市|