pKaTool/pKaTool_main.py
def model_rest_of_protein(self,model,set_pH):
        """Compile the information for modelling the rest of teh protein
        model 0 = ignore
        model 1 = non-titrating point charges (select charge at pH 7.0)
        model 2 = fixed titrating charges
        """
        wait_win=Toplevel()
        self.set_geometry(self.master,wait_win)
        wait_win.title('Please wait')
        Label(wait_win,text='Calculating cumulated effect of all other groups').grid(row=0,column=0)
        self.master.update_idletasks()
        wait_win.update_idletasks()
        if model==0:
            wait_win.destroy()
            return None
        elif model==2 or model==1:
            #
            # Initialise the array that holds information on all other groups
            #
            non_system_groups={}
            #
            # Get the interactions with all other groups at each pH value
            #
            group_id=0
            for group_name in self.selected_groups:
                #
                #
                non_system_groups[group_id]={}
                for pH in range(0,201):
                    real_pH=float(pH)/10.0
                    sum_interaction=0.0
                    for group2_name in self.matrix[group_name].keys():
                        if group2_name in self.selected_groups:
                            #
                            # Don't include the selected groups
                            #
                            pass
                        else:
                            #
                            # For all other groups calculate the interaction at each pH
                            #
                            record=self.matrix[group_name][group2_name]
                            intene=record[0]-record[1]-record[2]+record[3]
                            #
                            # Get the charge for this group at this pH
                            #
                            if model==2:
                                #
                                # Get charge at the right pH
                                #
                                charge=self.get_charge(group2_name,real_pH)
                            elif model==1:
                                #
                                # Just grab charge at the pH specified
                                #
                                charge=self.get_charge(group2_name,float(set_pH))
                            else:
                                print 'Model undefined'
                                raise Exception
                            if charge is None:
                                import tkMessageBox
                                tkMessageBox.showwarning("Could not find charge",
                                                         "Could not find charge for %s at pH %5.2f\nDid you calculate charges for a wide enough pH range?\nIgnoring all other groups for now..." %(group2_name,real_pH),
                                                         parent=self.master)
                                return None
                            sum_interaction=sum_interaction+intene*abs(charge) # The intene has the right sign already
                    #
                    # Store the info
                    #
                    non_system_groups[group_id][real_pH]=sum_interaction
                #
                # Update id
                #
                group_id=group_id+1
        wait_win.destroy()
        return non_system_groups
Compile the information for modelling the rest of teh protein
        model 0 = ignore
        model 1 = non-titrating point charges (select charge at pH 7.0)
        model 2 = fixed titrating charges
        
Compile the information for modelling the rest of teh protein
model 0 = ignore
model 1 = non-titrating point charges (select charge at pH 7.0)
model 2 = fixed titrating charges
Compile the information for modelling the rest of teh protein model 0 = ignore model 1 = non - titrating point charges ( select charge at pH 7 . 0 ) model 2 = fixed titrating charges
def model_rest_of_protein(self,model,set_pH):
        wait_win=Toplevel()
        self.set_geometry(self.master,wait_win)
        wait_win.title('Please wait')
        Label(wait_win,text='Calculating cumulated effect of all other groups').grid(row=0,column=0)
        self.master.update_idletasks()
        wait_win.update_idletasks()
        if model==0:
            wait_win.destroy()
            return None
        elif model==2 or model==1:
             Initialise the array that holds information on all other groups
            non_system_groups={}
             Get the interactions with all other groups at each pH value
            group_id=0
            for group_name in self.selected_groups:
                non_system_groups[group_id]={}
                for pH in range(0,201):
                    real_pH=float(pH)/10.0
                    sum_interaction=0.0
                    for group2_name in self.matrix[group_name].keys():
                        if group2_name in self.selected_groups:
                             Don't include the selected groups
                            pass
                        else:
                             For all other groups calculate the interaction at each pH
                            record=self.matrix[group_name][group2_name]
                            intene=record[0]-record[1]-record[2]+record[3]
                             Get the charge for this group at this pH
                            if model==2:
                                 Get charge at the right pH
                                charge=self.get_charge(group2_name,real_pH)
                            elif model==1:
                                 Just grab charge at the pH specified
                                charge=self.get_charge(group2_name,float(set_pH))
                            else:
                                print 'Model undefined'
                                raise Exception
                            if charge is None:
                                import tkMessageBox
                                tkMessageBox.showwarning("Could not find charge",
                                                         "Could not find charge for %s at pH %5.2f\nDid you calculate charges for a wide enough pH range?\nIgnoring all other groups for now..." %(group2_name,real_pH),
                                                         parent=self.master)
                                return None
                            sum_interaction=sum_interaction+intene*abs(charge)  The intene has the right sign already
                     Store the info
                    non_system_groups[group_id][real_pH]=sum_interaction
                 Update id
                group_id=group_id+1
        wait_win.destroy()
        return non_system_groups
def model_rest_of_protein ( self , model , set_pH ) : wait_win = Toplevel ( ) self . set_geometry ( self . master , wait_win ) wait_win . title ( 'Please wait' ) Label ( wait_win , text = 'Calculating cumulated effect of all other groups' ) . grid ( row = 0 , column = 0 ) self . master . update_idletasks ( ) wait_win . update_idletasks ( ) if model == 0 : wait_win . destroy ( ) return None elif model == 2 or model == 1 : non_system_groups = { } group_id = 0 for group_name in self . selected_groups : non_system_groups [ group_id ] = { } for pH in range ( 0 , 201 ) : real_pH = float ( pH ) / 10.0 sum_interaction = 0.0 for group2_name in self . matrix [ group_name ] . keys ( ) : if group2_name in self . selected_groups : pass else : record = self . matrix [ group_name ] [ group2_name ] intene = record [ 0 ] - record [ 1 ] - record [ 2 ] + record [ 3 ] if model == 2 : charge = self . get_charge ( group2_name , real_pH ) elif model == 1 : charge = self . get_charge ( group2_name , float ( set_pH ) ) else : print 'Model undefined' raise Exception if charge is None : import tkMessageBox tkMessageBox . showwarning ( "Could not find charge" , "Could not find charge for %s at pH %5.2f\nDid you calculate charges for a wide enough pH range?\nIgnoring all other groups for now..." % ( group2_name , real_pH ) , parent = self . master ) return None sum_interaction = sum_interaction + intene * abs ( charge ) non_system_groups [ group_id ] [ real_pH ] = sum_interaction group_id = group_id + 1 wait_win . destroy ( ) return non_system_groups
Compile the information for modelling the rest of teh protein
model 0 = ignore
model 1 = non-titrating point charges (select charge at pH 7.0)
model 2 = fixed titrating charges
Compile the information for modelling the rest of teh protein model 0 = ignore model 1 = non - titrating point charges ( select charge at pH 7 . 0 ) model 2 = fixed titrating charges
"""Compile the information for modelling the rest of teh protein
        model 0 = ignore
        model 1 = non-titrating point charges (select charge at pH 7.0)
        model 2 = fixed titrating charges
        """ # # Initialise the array that holds information on all other groups # # # Get the interactions with all other groups at each pH value # # # # # Don't include the selected groups # # # For all other groups calculate the interaction at each pH # # # Get the charge for this group at this pH # # # Get charge at the right pH # # # Just grab charge at the pH specified # # The intene has the right sign already # # Store the info # # # Update id #
self
model
set_pH