pKaTool/pKaTool_main.py
def show_details_table(self,event=None):
        """Open a new window with all details for the groups selected"""
        details_win=Toplevel()
        import pKarun.pKa_general
        X=pKarun.pKa_general.pKanalyse()
        row=0
        order=['Group','modelpK','desolv','backgr','intpKa','delec','dpKa','pKa','HH fit','HH fit pKa']
        #
        # Insert table headings
        #
        column=0
        for key in order:
            tl=Label(details_win,text=key,anchor='e',borderwidth=2,width=10,relief='ridge')
            tl.grid(row=row,column=column)
            column=column+1
        row=row+1
        #
        # Insert the data
        #
        for group in self.selected_groups:
            unit_dict={'modelpK':'','desolv':'pKa units','backgr':'pKa units','delec':'pKa units','dpKa':'pKa units','pKa':'','intpKa':''}
            tl=Label(details_win,text=group,anchor='e',borderwidth=2,relief='ridge',width=10)
            tl.grid(row=row,column=0)
            column=1
            for key in order:
                #
                # We've already inserted the name, and we will insert the HH parms later
                #
                if key in ['Group','HH fit','HH fit pKa']:
                    continue
                #
                # Inser the rest
                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='%5.1f' %(self.pkavals[group][key])
                else:
                    text='%5s' %('Unknown')
                #
                # Fill the cell
                #
                tl=Label(details_win,text=text,anchor='e',borderwidth=2,width=10,relief='ridge')
                tl.grid(row=row,column=column)
                column=column+1
            #
            # Insert the fit to the Henderson-Hasselbalch equation
            #
            solution,sq=X.fit_to_henderson(self.titration_curves[group])
            tl=Label(details_win,text='%5.2f' %(abs(solution[0])),anchor='e',borderwidth=2,width=10,relief='ridge')
            tl.grid(row=row,column=column)
            column=column+1

            tl=Label(details_win,text='%5.2f' %(abs(solution[1])),anchor='e',borderwidth=2,width=10,relief='ridge')
            tl.grid(row=row,column=column)
            #
            row=row+1
        
        return
Open a new window with all details for the groups selected
Open a new window with all details for the groups selected
Open a new window with all details for the groups selected
def show_details_table(self,event=None):
        details_win=Toplevel()
        import pKarun.pKa_general
        X=pKarun.pKa_general.pKanalyse()
        row=0
        order=['Group','modelpK','desolv','backgr','intpKa','delec','dpKa','pKa','HH fit','HH fit pKa']
         Insert table headings
        column=0
        for key in order:
            tl=Label(details_win,text=key,anchor='e',borderwidth=2,width=10,relief='ridge')
            tl.grid(row=row,column=column)
            column=column+1
        row=row+1
         Insert the data
        for group in self.selected_groups:
            unit_dict={'modelpK':'','desolv':'pKa units','backgr':'pKa units','delec':'pKa units','dpKa':'pKa units','pKa':'','intpKa':''}
            tl=Label(details_win,text=group,anchor='e',borderwidth=2,relief='ridge',width=10)
            tl.grid(row=row,column=0)
            column=1
            for key in order:
                 We've already inserted the name, and we will insert the HH parms later
                if key in ['Group','HH fit','HH fit pKa']:
                    continue
                 Inser the rest
                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='%5.1f' %(self.pkavals[group][key])
                else:
                    text='%5s' %('Unknown')
                 Fill the cell
                tl=Label(details_win,text=text,anchor='e',borderwidth=2,width=10,relief='ridge')
                tl.grid(row=row,column=column)
                column=column+1
             Insert the fit to the Henderson-Hasselbalch equation
            solution,sq=X.fit_to_henderson(self.titration_curves[group])
            tl=Label(details_win,text='%5.2f' %(abs(solution[0])),anchor='e',borderwidth=2,width=10,relief='ridge')
            tl.grid(row=row,column=column)
            column=column+1
            tl=Label(details_win,text='%5.2f' %(abs(solution[1])),anchor='e',borderwidth=2,width=10,relief='ridge')
            tl.grid(row=row,column=column)
            row=row+1
        return
def show_details_table ( self , event = None ) : details_win = Toplevel ( ) import pKarun . pKa_general X = pKarun . pKa_general . pKanalyse ( ) row = 0 order = [ 'Group' , 'modelpK' , 'desolv' , 'backgr' , 'intpKa' , 'delec' , 'dpKa' , 'pKa' , 'HH fit' , 'HH fit pKa' ] column = 0 for key in order : tl = Label ( details_win , text = key , anchor = 'e' , borderwidth = 2 , width = 10 , relief = 'ridge' ) tl . grid ( row = row , column = column ) column = column + 1 row = row + 1 for group in self . selected_groups : unit_dict = { 'modelpK' : '' , 'desolv' : 'pKa units' , 'backgr' : 'pKa units' , 'delec' : 'pKa units' , 'dpKa' : 'pKa units' , 'pKa' : '' , 'intpKa' : '' } tl = Label ( details_win , text = group , anchor = 'e' , borderwidth = 2 , relief = 'ridge' , width = 10 ) tl . grid ( row = row , column = 0 ) column = 1 for key in order : if key in [ 'Group' , 'HH fit' , 'HH fit pKa' ] : continue 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 = '%5.1f' % ( self . pkavals [ group ] [ key ] ) else : text = '%5s' % ( 'Unknown' ) tl = Label ( details_win , text = text , anchor = 'e' , borderwidth = 2 , width = 10 , relief = 'ridge' ) tl . grid ( row = row , column = column ) column = column + 1 solution , sq = X . fit_to_henderson ( self . titration_curves [ group ] ) tl = Label ( details_win , text = '%5.2f' % ( abs ( solution [ 0 ] ) ) , anchor = 'e' , borderwidth = 2 , width = 10 , relief = 'ridge' ) tl . grid ( row = row , column = column ) column = column + 1 tl = Label ( details_win , text = '%5.2f' % ( abs ( solution [ 1 ] ) ) , anchor = 'e' , borderwidth = 2 , width = 10 , relief = 'ridge' ) tl . grid ( row = row , column = column ) row = row + 1 return
Open a new window with all details for the groups selected
Open a new window with all details for the groups selected
"""Open a new window with all details for the groups selected""" # # Insert table headings # # # Insert the data # # # We've already inserted the name, and we will insert the HH parms later # # # Inser the rest # # Insert the text # # # Fill the cell # # # Insert the fit to the Henderson-Hasselbalch equation # #
self
event