def logKOH_T(self):
        from .matrix.koh import kohX
        # KOH 温度依附性模型, 有温度参数
        #CAS-Number X% EHOMO Mor29u NdsCH GATS1e X3A 1/T SdsCH nR=Cp F02[F-Br] RDF015m BIC1 SpMin8_Bh(p) NssssC
        abstract_value = self.dragon_model.extractparameter([
            "X%", "EHOMO", "Mor29u", "NdsCH", "GATS1e", "X3A", "SdsCH",
            "nR=Cp", "F02[F-Br]", "RDF015m", "BIC1", "SpMin8_Bh(p)", "NssssC"
        ])

        for smilenum in abstract_value:
            if smilenum not in self.predict_result:
                self.predict_result[smilenum] = defaultdict(dict)

            abstract_value[smilenum]['EHOMO'] = fetch_ehomo(
                smilenum, 'logKOH_T')

            value = -8.613 - \
                0.02100 * abstract_value[smilenum]['X%'] + \
                14.38 * abstract_value[smilenum]['EHOMO'] - \
                0.6430 * abstract_value[smilenum]['Mor29u'] + \
                0.5870 * abstract_value[smilenum]['NdsCH'] + \
                0.5870 * abstract_value[smilenum]['GATS1e'] + \
                0.5770 * abstract_value[smilenum]['X3A'] - \
                0.2450 * abstract_value[smilenum]['SdsCH'] - \
                167.0 * (1 / self.T) + \
                1.103 * abstract_value[smilenum]['BIC1'] + \
                0.1170 * abstract_value[smilenum]['RDF015m'] - \
                1.044 * abstract_value[smilenum]['SpMin8_Bh(p)'] + \
                0.2390 * abstract_value[smilenum]['nR=Cp'] - \
                0.1980 * abstract_value[smilenum]['NssssC'] - \
                0.5080 * abstract_value[smilenum]['F02[F-Br]']

            self.predict_result[smilenum]['logKOH_T']['value'] = self.round(
                value)

            chemistry_logger.info('koh_t(%s) dragon: %s' %
                                  (smilenum, abstract_value[smilenum]))

            x = matrix([[
                abstract_value[smilenum]['X%'],
                abstract_value[smilenum]['EHOMO'],
                abstract_value[smilenum]['Mor29u'],
                abstract_value[smilenum]['NdsCH'],
                abstract_value[smilenum]['GATS1e'],
                abstract_value[smilenum]['X3A'], 1.0 / self.T,
                abstract_value[smilenum]['SdsCH'],
                abstract_value[smilenum]['nR=Cp'],
                abstract_value[smilenum]['F02[F-Br]'],
                abstract_value[smilenum]['RDF015m'],
                abstract_value[smilenum]['BIC1'],
                abstract_value[smilenum]['SpMin8_Bh(p)'],
                abstract_value[smilenum]['NssssC']
            ]])
            williams = self.get_williams(kohX, x)
            self.predict_result[smilenum]['logKOH_T'].update(williams)
    def logKOH_T(self):
        from .matrix.koh import kohX
        # KOH 温度依附性模型, 有温度参数
        #CAS-Number X% EHOMO Mor29u NdsCH GATS1e X3A 1/T SdsCH nR=Cp F02[F-Br] RDF015m BIC1 SpMin8_Bh(p) NssssC
        abstract_value = self.dragon_model.extractparameter([
            "X%", "EHOMO", "Mor29u", "NdsCH", "GATS1e", "X3A", "SdsCH",
            "nR=Cp", "F02[F-Br]", "RDF015m", "BIC1", "SpMin8_Bh(p)", "NssssC"])

        for smilenum in abstract_value:
            if smilenum not in self.predict_result:
                self.predict_result[smilenum] = defaultdict(dict)

            abstract_value[smilenum]['EHOMO'] = fetch_ehomo(smilenum, 'logKOH_T')

            value = -8.613 - \
                0.02100 * abstract_value[smilenum]['X%'] + \
                14.38 * abstract_value[smilenum]['EHOMO'] - \
                0.6430 * abstract_value[smilenum]['Mor29u'] + \
                0.5870 * abstract_value[smilenum]['NdsCH'] + \
                0.5870 * abstract_value[smilenum]['GATS1e'] + \
                0.5770 * abstract_value[smilenum]['X3A'] - \
                0.2450 * abstract_value[smilenum]['SdsCH'] - \
                167.0 * (1 / self.T) + \
                1.103 * abstract_value[smilenum]['BIC1'] + \
                0.1170 * abstract_value[smilenum]['RDF015m'] - \
                1.044 * abstract_value[smilenum]['SpMin8_Bh(p)'] + \
                0.2390 * abstract_value[smilenum]['nR=Cp'] - \
                0.1980 * abstract_value[smilenum]['NssssC'] - \
                0.5080 * abstract_value[smilenum]['F02[F-Br]']
            
            self.predict_result[smilenum]['logKOH_T']['value'] = self.round(value)

            chemistry_logger.info('koh_t(%s) dragon: %s' % (smilenum, abstract_value[smilenum]))

            x = matrix([[abstract_value[smilenum]['X%'],
                         abstract_value[smilenum]['EHOMO'],
                         abstract_value[smilenum]['Mor29u'],
                         abstract_value[smilenum]['NdsCH'],
                         abstract_value[smilenum]['GATS1e'],
                         abstract_value[smilenum]['X3A'],
                         1.0 / self.T,
                         abstract_value[smilenum]['SdsCH'],
                         abstract_value[smilenum]['nR=Cp'],
                         abstract_value[smilenum]['F02[F-Br]'],
                         abstract_value[smilenum]['RDF015m'],
                         abstract_value[smilenum]['BIC1'],
                         abstract_value[smilenum]['SpMin8_Bh(p)'],
                         abstract_value[smilenum]['NssssC']
                         ]])
            williams = self.get_williams(kohX, x)
            self.predict_result[smilenum]['logKOH_T'].update(williams)
    def logKOH(self):
        from .matrix.koh_298k import koh_298kX
        # KOH 298K预测模型, 无温度参数
        #CAS-Number EHOMO AMW NdsCH Mor14i nP nR=Cp X% nRCHO C-020 SpMaxA_AEA(dm) nCbH CATS2D_03_DL
        abstract_value = self.dragon_model.extractparameter([
            "EHOMO", "AMW", "NdsCH", "Mor14i", "nP", "nR=Cp", "X%", "nRCHO",
            "C-020", "SpMaxA_AEA(dm)", "nCbH", "CATS2D_03_DL"
        ])

        for smilenum in abstract_value:
            if smilenum not in self.predict_result:
                self.predict_result[smilenum] = defaultdict(dict)

            abstract_value[smilenum]['EHOMO'] = fetch_ehomo(smilenum, 'logKOH')

            value = -6.511 + \
                15.85 * abstract_value[smilenum]['EHOMO'] - \
                0.03800 * abstract_value[smilenum]['AMW'] + \
                0.1300 * abstract_value[smilenum]['NdsCH'] + \
                0.1630 * abstract_value[smilenum]['Mor14i'] + \
                0.7790 * abstract_value[smilenum]['nP'] + \
                0.3170 * abstract_value[smilenum]['nR=Cp'] - \
                0.01900 * abstract_value[smilenum]['X%'] + \
                0.3930 * abstract_value[smilenum]['nRCHO'] + \
                0.5890 * abstract_value[smilenum]['C-020'] - \
                0.4550 * abstract_value[smilenum]['SpMaxA_AEA(dm)'] - \
                0.05600 * abstract_value[smilenum]['nCbH'] + \
                0.1410 * abstract_value[smilenum]['CATS2D_03_DL']

            self.predict_result[smilenum]['logKOH']['value'] = self.round(
                value)

            chemistry_logger.info('koh(%s) dragon: %s' %
                                  (smilenum, abstract_value[smilenum]))

            x = matrix([[
                abstract_value[smilenum]['EHOMO'],
                abstract_value[smilenum]['AMW'],
                abstract_value[smilenum]['NdsCH'],
                abstract_value[smilenum]['Mor14i'],
                abstract_value[smilenum]['nP'],
                abstract_value[smilenum]['nR=Cp'],
                abstract_value[smilenum]['X%'],
                abstract_value[smilenum]['nRCHO'],
                abstract_value[smilenum]['C-020'],
                abstract_value[smilenum]['SpMaxA_AEA(dm)'],
                abstract_value[smilenum]['nCbH'],
                abstract_value[smilenum]['CATS2D_03_DL']
            ]])
            williams = self.get_williams(koh_298kX, x)
            self.predict_result[smilenum]['logKOH'].update(williams)
    def logKOH(self):
        from .matrix.koh_298k import koh_298kX
        # KOH 298K预测模型, 无温度参数
        #CAS-Number EHOMO AMW NdsCH Mor14i nP nR=Cp X% nRCHO C-020 SpMaxA_AEA(dm) nCbH CATS2D_03_DL
        abstract_value = self.dragon_model.extractparameter([
            "EHOMO", "AMW", "NdsCH", "Mor14i", "nP", "nR=Cp",
            "X%", "nRCHO", "C-020", "SpMaxA_AEA(dm)",
            "nCbH", "CATS2D_03_DL"])

        for smilenum in abstract_value:
            if smilenum not in self.predict_result:
                self.predict_result[smilenum] = defaultdict(dict)

            abstract_value[smilenum]['EHOMO'] = fetch_ehomo(smilenum, 'logKOH')

            value = -6.511 + \
                15.85 * abstract_value[smilenum]['EHOMO'] - \
                0.03800 * abstract_value[smilenum]['AMW'] + \
                0.1300 * abstract_value[smilenum]['NdsCH'] + \
                0.1630 * abstract_value[smilenum]['Mor14i'] + \
                0.7790 * abstract_value[smilenum]['nP'] + \
                0.3170 * abstract_value[smilenum]['nR=Cp'] - \
                0.01900 * abstract_value[smilenum]['X%'] + \
                0.3930 * abstract_value[smilenum]['nRCHO'] + \
                0.5890 * abstract_value[smilenum]['C-020'] - \
                0.4550 * abstract_value[smilenum]['SpMaxA_AEA(dm)'] - \
                0.05600 * abstract_value[smilenum]['nCbH'] + \
                0.1410 * abstract_value[smilenum]['CATS2D_03_DL']
            
            self.predict_result[smilenum]['logKOH']['value'] = self.round(value)

            chemistry_logger.info('koh(%s) dragon: %s' % (smilenum, abstract_value[smilenum]))

            x = matrix([[abstract_value[smilenum]['EHOMO'],
                         abstract_value[smilenum]['AMW'],
                         abstract_value[smilenum]['NdsCH'],
                         abstract_value[smilenum]['Mor14i'],
                         abstract_value[smilenum]['nP'],
                         abstract_value[smilenum]['nR=Cp'],
                         abstract_value[smilenum]['X%'],
                         abstract_value[smilenum]['nRCHO'],
                         abstract_value[smilenum]['C-020'],
                         abstract_value[smilenum]['SpMaxA_AEA(dm)'],
                         abstract_value[smilenum]['nCbH'],
                         abstract_value[smilenum]['CATS2D_03_DL']]])
            williams = self.get_williams(koh_298kX, x)
            self.predict_result[smilenum]['logKOH'].update(williams)