pKaTool/pKaTool_main.py
def add_group_to_details(self,group):
        """Add the details of a single group to the details window"""
        X=pKarun.pKa_general.pKanalyse()
        order=['modelpK','desolv','backgr','intpKa','delec','dpKa','pKa']
        unit_dict={'modelpK':'','desolv':'pKa units','backgr':'pKa units','delec':'pKa units','dpKa':'pKa units','pKa':'','intpKa':''}
        self.details.insert(END,'%-10s: %s\n' %('Name',group))
        for key in order:
            unit=unit_dict[key]
            if key=='intpKa':
                try:
                    self.pkavals[group]['intpKa']=self.pkavals[group]['modelpK']+self.pkavals[group]['desolv']+self.pkavals[group]['backgr']
                except:
                    self.pkavals[group]['intpKa']=None
            elif key=='dpKa':
                if self.pkavals[group]['pKa']:
                    self.pkavals[group]['dpKa']=self.pkavals[group]['pKa']-self.pkavals[group]['modelpK']
                else:
                    self.pkavals[group]['dpKa']=None
            #
            # Insert the text
            #
            if self.pkavals[group][key]:
                text='%-10s: %5.1f %s\n' %(key,self.pkavals[group][key],unit)
            else:
                text='%-10s: %5s %s\n' %(key,'Unknown',unit)
            self.details.insert(END,text)
        #
        # Insert the fit to the Henderson-Hasselbalch equation
        #
        solution,sq=X.fit_to_henderson(self.titration_curves[group])
        self.details.insert(END,'Fit to Henderson-Hasselbalch\na %.2f (1 for perfect HH)\npKa value from HH fit: %5.2f\n' %(abs(solution[0]),abs(solution[1])))
        self.details.insert(END,'---------------------\n\n')
        return
Add the details of a single group to the details window
Add the details of a single group to the details window
Add the details of a single group to the details window
def add_group_to_details(self,group):
        X=pKarun.pKa_general.pKanalyse()
        order=['modelpK','desolv','backgr','intpKa','delec','dpKa','pKa']
        unit_dict={'modelpK':'','desolv':'pKa units','backgr':'pKa units','delec':'pKa units','dpKa':'pKa units','pKa':'','intpKa':''}
        self.details.insert(END,'%-10s: %s\n' %('Name',group))
        for key in order:
            unit=unit_dict[key]
            if key=='intpKa':
                try:
                    self.pkavals[group]['intpKa']=self.pkavals[group]['modelpK']+self.pkavals[group]['desolv']+self.pkavals[group]['backgr']
                except:
                    self.pkavals[group]['intpKa']=None
            elif key=='dpKa':
                if self.pkavals[group]['pKa']:
                    self.pkavals[group]['dpKa']=self.pkavals[group]['pKa']-self.pkavals[group]['modelpK']
                else:
                    self.pkavals[group]['dpKa']=None
             Insert the text
            if self.pkavals[group][key]:
                text='%-10s: %5.1f %s\n' %(key,self.pkavals[group][key],unit)
            else:
                text='%-10s: %5s %s\n' %(key,'Unknown',unit)
            self.details.insert(END,text)
         Insert the fit to the Henderson-Hasselbalch equation
        solution,sq=X.fit_to_henderson(self.titration_curves[group])
        self.details.insert(END,'Fit to Henderson-Hasselbalch\na %.2f (1 for perfect HH)\npKa value from HH fit: %5.2f\n' %(abs(solution[0]),abs(solution[1])))
        self.details.insert(END,'---------------------\n\n')
        return
def add_group_to_details ( self , group ) : X = pKarun . pKa_general . pKanalyse ( ) order = [ 'modelpK' , 'desolv' , 'backgr' , 'intpKa' , 'delec' , 'dpKa' , 'pKa' ] unit_dict = { 'modelpK' : '' , 'desolv' : 'pKa units' , 'backgr' : 'pKa units' , 'delec' : 'pKa units' , 'dpKa' : 'pKa units' , 'pKa' : '' , 'intpKa' : '' } self . details . insert ( END , '%-10s: %s\n' % ( 'Name' , group ) ) for key in order : unit = unit_dict [ key ] if key == 'intpKa' : try : self . pkavals [ group ] [ 'intpKa' ] = self . pkavals [ group ] [ 'modelpK' ] + self . pkavals [ group ] [ 'desolv' ] + self . pkavals [ group ] [ 'backgr' ] except : self . pkavals [ group ] [ 'intpKa' ] = None elif key == 'dpKa' : if self . pkavals [ group ] [ 'pKa' ] : self . pkavals [ group ] [ 'dpKa' ] = self . pkavals [ group ] [ 'pKa' ] - self . pkavals [ group ] [ 'modelpK' ] else : self . pkavals [ group ] [ 'dpKa' ] = None if self . pkavals [ group ] [ key ] : text = '%-10s: %5.1f %s\n' % ( key , self . pkavals [ group ] [ key ] , unit ) else : text = '%-10s: %5s %s\n' % ( key , 'Unknown' , unit ) self . details . insert ( END , text ) solution , sq = X . fit_to_henderson ( self . titration_curves [ group ] ) self . details . insert ( END , 'Fit to Henderson-Hasselbalch\na %.2f (1 for perfect HH)\npKa value from HH fit: %5.2f\n' % ( abs ( solution [ 0 ] ) , abs ( solution [ 1 ] ) ) ) self . details . insert ( END , '---------------------\n\n' ) return
Add the details of a single group to the details window
Add the details of a single group to the details window
"""Add the details of a single group to the details window""" # # Insert the text # # # Insert the fit to the Henderson-Hasselbalch equation #
self
group