pKaTool/pKa_system.py
def calc_pKas_from_scales(self,group_array):
        """Calculate pKa values for the system"""
        #
        # Fill instance with data
        #
        X=self.pkamethods[self.pkamethod_sel.get()]()
        MCsteps=0
        if self.pkamethod_sel.get()=='Monte Carlo':
            MCsteps=self.MCsteps.get()
            self.mcsteps_scale.configure(state=ACTIVE)
        elif self.pkamethod_sel.get()=='Monte Carlo (C++)':
            MCsteps=200000
        else:
            self.mcsteps_scale.configure(state=DISABLED)
        #
        matrix_dummy=self.setup_system(group_array,X)
        #
        # Set the pKa value variables
        #
        X.groups=X.intrinsic_pKa.keys()
        X.groups.sort()
        #
        # Make a list of experimental pH values to include in calculation
        #
        exp_pHs =[]
        if getattr(self,'titration_data',None):
            for group in self.titration_data.keys():
                for pH in self.titration_data[group].keys():
                    if exp_pHs.count(pH) == 0:
                        exp_pHs.append(pH)
        #
        # also include pH values from loaded ph-activity profile
        #
        if getattr(self,'activity_data',None):
            for pH in self.activity_data.keys():
                if exp_pHs.count(pH) == 0:
                        exp_pHs.append(pH)
        #
        # and also from ftir data
        #
        if getattr(self, 'FTIR_win',None):
            for pH in self.FTIR_win.ftir_data.keys():
                if exp_pHs.count(pH) ==0:
                    exp_pHs.append(pH)
        #
        # Include the effect of non-system groups?
        #
        if hasattr(self,'non_system_groups'):
            if self.non_system_groups:
                X.non_system_groups={}
                for group_id in self.non_system_groups.keys():
                    name=self.names[group_id]
                    X.non_system_groups[name]=self.non_system_groups[group_id].copy()
        #
        # Get the pKa values
        #
        pKa_values,prot_states=X._calc_pKas(mcsteps=MCsteps,
                                            phstep=self.pHstep.get(),
                                            phstart=self.pHstart,
                                            phend=self.pHend,
                                            exp_pHs=exp_pHs,
                                            verbose=1)
        return X,pKa_values,prot_states
Calculate pKa values for the system
Calculate pKa values for the system
Calculate pKa values for the system
def calc_pKas_from_scales(self,group_array):
         Fill instance with data
        X=self.pkamethods[self.pkamethod_sel.get()]()
        MCsteps=0
        if self.pkamethod_sel.get()=='Monte Carlo':
            MCsteps=self.MCsteps.get()
            self.mcsteps_scale.configure(state=ACTIVE)
        elif self.pkamethod_sel.get()=='Monte Carlo (C++)':
            MCsteps=200000
        else:
            self.mcsteps_scale.configure(state=DISABLED)
        matrix_dummy=self.setup_system(group_array,X)
         Set the pKa value variables
        X.groups=X.intrinsic_pKa.keys()
        X.groups.sort()
         Make a list of experimental pH values to include in calculation
        exp_pHs =[]
        if getattr(self,'titration_data',None):
            for group in self.titration_data.keys():
                for pH in self.titration_data[group].keys():
                    if exp_pHs.count(pH) == 0:
                        exp_pHs.append(pH)
         also include pH values from loaded ph-activity profile
        if getattr(self,'activity_data',None):
            for pH in self.activity_data.keys():
                if exp_pHs.count(pH) == 0:
                        exp_pHs.append(pH)
         and also from ftir data
        if getattr(self, 'FTIR_win',None):
            for pH in self.FTIR_win.ftir_data.keys():
                if exp_pHs.count(pH) ==0:
                    exp_pHs.append(pH)
         Include the effect of non-system groups?
        if hasattr(self,'non_system_groups'):
            if self.non_system_groups:
                X.non_system_groups={}
                for group_id in self.non_system_groups.keys():
                    name=self.names[group_id]
                    X.non_system_groups[name]=self.non_system_groups[group_id].copy()
         Get the pKa values
        pKa_values,prot_states=X._calc_pKas(mcsteps=MCsteps,
                                            phstep=self.pHstep.get(),
                                            phstart=self.pHstart,
                                            phend=self.pHend,
                                            exp_pHs=exp_pHs,
                                            verbose=1)
        return X,pKa_values,prot_states
def calc_pKas_from_scales ( self , group_array ) : X = self . pkamethods [ self . pkamethod_sel . get ( ) ] ( ) MCsteps = 0 if self . pkamethod_sel . get ( ) == 'Monte Carlo' : MCsteps = self . MCsteps . get ( ) self . mcsteps_scale . configure ( state = ACTIVE ) elif self . pkamethod_sel . get ( ) == 'Monte Carlo (C++)' : MCsteps = 200000 else : self . mcsteps_scale . configure ( state = DISABLED ) matrix_dummy = self . setup_system ( group_array , X ) X . groups = X . intrinsic_pKa . keys ( ) X . groups . sort ( ) exp_pHs = [ ] if getattr ( self , 'titration_data' , None ) : for group in self . titration_data . keys ( ) : for pH in self . titration_data [ group ] . keys ( ) : if exp_pHs . count ( pH ) == 0 : exp_pHs . append ( pH ) if getattr ( self , 'activity_data' , None ) : for pH in self . activity_data . keys ( ) : if exp_pHs . count ( pH ) == 0 : exp_pHs . append ( pH ) if getattr ( self , 'FTIR_win' , None ) : for pH in self . FTIR_win . ftir_data . keys ( ) : if exp_pHs . count ( pH ) == 0 : exp_pHs . append ( pH ) if hasattr ( self , 'non_system_groups' ) : if self . non_system_groups : X . non_system_groups = { } for group_id in self . non_system_groups . keys ( ) : name = self . names [ group_id ] X . non_system_groups [ name ] = self . non_system_groups [ group_id ] . copy ( ) pKa_values , prot_states = X . _calc_pKas ( mcsteps = MCsteps , phstep = self . pHstep . get ( ) , phstart = self . pHstart , phend = self . pHend , exp_pHs = exp_pHs , verbose = 1 ) return X , pKa_values , prot_states
Calculate pKa values for the system
Calculate pKa values for the system
"""Calculate pKa values for the system""" # # Fill instance with data # # # # Set the pKa value variables # # # Make a list of experimental pH values to include in calculation # # # also include pH values from loaded ph-activity profile # # # and also from ftir data # # # Include the effect of non-system groups? # # # Get the pKa values #
self
group_array