pKaTool/pKa_system.py
def stability_on_off(self):
        """Open a window for drawing the stability curve"""
        #
        # Should we open the stability window?
        #
        new=self.stability_var.get()
        if new=='on' and self.old_stab_status!='on':
            #
            # Yes, open it
            #
            self.stab_test_on=1
            self.old_stab_status='on'
            self.stab_window=Toplevel()

            #
            self.stabwidth=1000
            self.stabheight=300
            self.stab_window.geometry('%dx%d+10+20' %(self.stabwidth,self.stabheight))
            self.stab_window.title('pH dependence of protein stability')
            self.stab_tc=Canvas(self.stab_window,bd=5,bg='white',width=self.titwidth,height=self.titheight,scrollregion=(0,0,self.titwidth,self.titheight))
            self.stab_tc.xview("moveto", 0)
            self.stab_tc.yview("moveto", 0)
            self.stab_tc.grid(row=1,column=0)
            #
            # Plotting button
            #
            def print_curve(event=None):
                    Button(self.stab_window,command=print_curve).grid(row=0,column=0)
            # pH axis
            self.stab_startx=80
            self.stab_endx=910
            self.stab_starty=160
            self.stab_endy=10
            self.pH_axis(self.stab_tc,self.stab_startx,self.stab_starty,
                         self.stab_endx,self.stab_endy)
            #
            # Controls for unfolded pKa values
            #
            self.U_control=Toplevel()
            self.U_control.title('Controls for Unfolded form')
            self.U_control.geometry('+10+10')
            self.unfolded_groups={}
            for id_num in range(self.numgrps):
                int_ene=1
                #colour=self.colour_order[id_num%len(self.colour_order)]
                self.unfolded_groups[id_num]=group_control.group_control(self,
                                                                         self.startrow+id_num,id_num,
                                                                         self.numgrps,int_ene,self.colour_order,window=self.U_control)
                #
                # If we are displaying real groups then set the intrinsic pKa to the model pKa value
                #
                if self.parent_application:
                    intpKa_folded=self.groups[id_num].modelpK
                else:
                    intpKa_folded=self.groups[id_num].intpka.get()
                #
                self.unfolded_groups[id_num].intpka.set(intpKa_folded)
            #
            #
            #
            row=self.startrow+self.numgrps+1
            self.show_grp_contribs=IntVar()
            self.show_grp_contribs.set(0)
            grp_contribs=Checkbutton(self.U_control,text='Show residue contributions',
                                     onvalue=1,offvalue=0,variable=self.show_grp_contribs,command=self.update_pkasystem_curves)
            grp_contribs.grid(row=row,column=0)
            #
            # Which contribution should we draw
            #
            self.contrib_type=IntVar()
            self.contrib_type.set(1)
            Radiobutton(self.U_control,text='contributions from pKa shifts',variable=self.contrib_type,value=1,command=self.update_pkasystem_curves).grid(row=row,column=1)
            #Radiobutton(self.U_control,text='charge-charge contributions',variable=self.contrib_type,value=2,command=self.update_curves).grid(row=row,column=2)
            #
            # Should we show min and max stabilisation?
            #
            self.show_min_max_stab=IntVar()
            self.show_min_max_stab.set(1)
            Checkbutton(self.U_control,text='Show min and max stabilisation',
                        onvalue=1,
                        offvalue=0,
                        variable=self.show_min_max_stab,
                        command=self.update_pkasystem_curves).grid(row=row,column=3)
            #
            # Update curves
            #
            self.window.update()
            self.U_control.update()
            self.stab_test_on=None
            self.update_pkasystem_curves()
            #
            # Move the windows to sensible positions
            #
            width,height,xorg,yorg=self.get_geometry(self.win)
            self.U_control.geometry('+%d+%d' %(xorg,yorg+height))
            #
            width,height,xorg,yorg=self.get_geometry(self.U_control)
            self.stab_window.geometry('+%d+%d' %(xorg,yorg+height))
            #
            # Activate the callbacks for the unfolded groups
            #
            self.activate_callbacks()
        else:
            self.old_stab_status='off'
            self.stab_window.destroy()
            self.U_control.destroy()
        return
Open a window for drawing the stability curve
Open a window for drawing the stability curve
Open a window for drawing the stability curve
def stability_on_off(self):
         Should we open the stability window?
        new=self.stability_var.get()
        if new=='on' and self.old_stab_status!='on':
             Yes, open it
            self.stab_test_on=1
            self.old_stab_status='on'
            self.stab_window=Toplevel()
            self.stabwidth=1000
            self.stabheight=300
            self.stab_window.geometry('%dx%d+10+20' %(self.stabwidth,self.stabheight))
            self.stab_window.title('pH dependence of protein stability')
            self.stab_tc=Canvas(self.stab_window,bd=5,bg='white',width=self.titwidth,height=self.titheight,scrollregion=(0,0,self.titwidth,self.titheight))
            self.stab_tc.xview("moveto", 0)
            self.stab_tc.yview("moveto", 0)
            self.stab_tc.grid(row=1,column=0)
             Plotting button
            def print_curve(event=None):
                    Button(self.stab_window,command=print_curve).grid(row=0,column=0)
             pH axis
            self.stab_startx=80
            self.stab_endx=910
            self.stab_starty=160
            self.stab_endy=10
            self.pH_axis(self.stab_tc,self.stab_startx,self.stab_starty,
                         self.stab_endx,self.stab_endy)
             Controls for unfolded pKa values
            self.U_control=Toplevel()
            self.U_control.title('Controls for Unfolded form')
            self.U_control.geometry('+10+10')
            self.unfolded_groups={}
            for id_num in range(self.numgrps):
                int_ene=1
                colour=self.colour_order[id_num%len(self.colour_order)]
                self.unfolded_groups[id_num]=group_control.group_control(self,
                                                                         self.startrow+id_num,id_num,
                                                                         self.numgrps,int_ene,self.colour_order,window=self.U_control)
                 If we are displaying real groups then set the intrinsic pKa to the model pKa value
                if self.parent_application:
                    intpKa_folded=self.groups[id_num].modelpK
                else:
                    intpKa_folded=self.groups[id_num].intpka.get()
                self.unfolded_groups[id_num].intpka.set(intpKa_folded)
            row=self.startrow+self.numgrps+1
            self.show_grp_contribs=IntVar()
            self.show_grp_contribs.set(0)
            grp_contribs=Checkbutton(self.U_control,text='Show residue contributions',
                                     onvalue=1,offvalue=0,variable=self.show_grp_contribs,command=self.update_pkasystem_curves)
            grp_contribs.grid(row=row,column=0)
             Which contribution should we draw
            self.contrib_type=IntVar()
            self.contrib_type.set(1)
            Radiobutton(self.U_control,text='contributions from pKa shifts',variable=self.contrib_type,value=1,command=self.update_pkasystem_curves).grid(row=row,column=1)
            Radiobutton(self.U_control,text='charge-charge contributions',variable=self.contrib_type,value=2,command=self.update_curves).grid(row=row,column=2)
             Should we show min and max stabilisation?
            self.show_min_max_stab=IntVar()
            self.show_min_max_stab.set(1)
            Checkbutton(self.U_control,text='Show min and max stabilisation',
                        onvalue=1,
                        offvalue=0,
                        variable=self.show_min_max_stab,
                        command=self.update_pkasystem_curves).grid(row=row,column=3)
             Update curves
            self.window.update()
            self.U_control.update()
            self.stab_test_on=None
            self.update_pkasystem_curves()
             Move the windows to sensible positions
            width,height,xorg,yorg=self.get_geometry(self.win)
            self.U_control.geometry('+%d+%d' %(xorg,yorg+height))
            width,height,xorg,yorg=self.get_geometry(self.U_control)
            self.stab_window.geometry('+%d+%d' %(xorg,yorg+height))
             Activate the callbacks for the unfolded groups
            self.activate_callbacks()
        else:
            self.old_stab_status='off'
            self.stab_window.destroy()
            self.U_control.destroy()
        return
def stability_on_off ( self ) : new = self . stability_var . get ( ) if new == 'on' and self . old_stab_status != 'on' : self . stab_test_on = 1 self . old_stab_status = 'on' self . stab_window = Toplevel ( ) self . stabwidth = 1000 self . stabheight = 300 self . stab_window . geometry ( '%dx%d+10+20' % ( self . stabwidth , self . stabheight ) ) self . stab_window . title ( 'pH dependence of protein stability' ) self . stab_tc = Canvas ( self . stab_window , bd = 5 , bg = 'white' , width = self . titwidth , height = self . titheight , scrollregion = ( 0 , 0 , self . titwidth , self . titheight ) ) self . stab_tc . xview ( "moveto" , 0 ) self . stab_tc . yview ( "moveto" , 0 ) self . stab_tc . grid ( row = 1 , column = 0 ) def print_curve ( event = None ) : Button ( self . stab_window , command = print_curve ) . grid ( row = 0 , column = 0 ) self . stab_startx = 80 self . stab_endx = 910 self . stab_starty = 160 self . stab_endy = 10 self . pH_axis ( self . stab_tc , self . stab_startx , self . stab_starty , self . stab_endx , self . stab_endy ) self . U_control = Toplevel ( ) self . U_control . title ( 'Controls for Unfolded form' ) self . U_control . geometry ( '+10+10' ) self . unfolded_groups = { } for id_num in range ( self . numgrps ) : int_ene = 1 self . unfolded_groups [ id_num ] = group_control . group_control ( self , self . startrow + id_num , id_num , self . numgrps , int_ene , self . colour_order , window = self . U_control ) if self . parent_application : intpKa_folded = self . groups [ id_num ] . modelpK else : intpKa_folded = self . groups [ id_num ] . intpka . get ( ) self . unfolded_groups [ id_num ] . intpka . set ( intpKa_folded ) row = self . startrow + self . numgrps + 1 self . show_grp_contribs = IntVar ( ) self . show_grp_contribs . set ( 0 ) grp_contribs = Checkbutton ( self . U_control , text = 'Show residue contributions' , onvalue = 1 , offvalue = 0 , variable = self . show_grp_contribs , command = self . update_pkasystem_curves ) grp_contribs . grid ( row = row , column = 0 ) self . contrib_type = IntVar ( ) self . contrib_type . set ( 1 ) Radiobutton ( self . U_control , text = 'contributions from pKa shifts' , variable = self . contrib_type , value = 1 , command = self . update_pkasystem_curves ) . grid ( row = row , column = 1 ) self . show_min_max_stab = IntVar ( ) self . show_min_max_stab . set ( 1 ) Checkbutton ( self . U_control , text = 'Show min and max stabilisation' , onvalue = 1 , offvalue = 0 , variable = self . show_min_max_stab , command = self . update_pkasystem_curves ) . grid ( row = row , column = 3 ) self . window . update ( ) self . U_control . update ( ) self . stab_test_on = None self . update_pkasystem_curves ( ) width , height , xorg , yorg = self . get_geometry ( self . win ) self . U_control . geometry ( '+%d+%d' % ( xorg , yorg + height ) ) width , height , xorg , yorg = self . get_geometry ( self . U_control ) self . stab_window . geometry ( '+%d+%d' % ( xorg , yorg + height ) ) self . activate_callbacks ( ) else : self . old_stab_status = 'off' self . stab_window . destroy ( ) self . U_control . destroy ( ) return
Open a window for drawing the stability curve
Open a window for drawing the stability curve
"""Open a window for drawing the stability curve""" # # Should we open the stability window? # # # Yes, open it # # # # Plotting button # # pH axis # # Controls for unfolded pKa values # #colour=self.colour_order[id_num%len(self.colour_order)] # # If we are displaying real groups then set the intrinsic pKa to the model pKa value # # # # # # # Which contribution should we draw # #Radiobutton(self.U_control,text='charge-charge contributions',variable=self.contrib_type,value=2,command=self.update_curves).grid(row=row,column=2) # # Should we show min and max stabilisation? # # # Update curves # # # Move the windows to sensible positions # # # # Activate the callbacks for the unfolded groups #
self