pKaTool/pKa_system_help.py
def measure_change(self,reference=None,absolut=False):
        """Measure the difference in the titration curve as compared to the wt situration"""
        X=self.update_pkasystem_curves(doit=1)
        #
        # Should we update the display?
        #
        if self.draw:
            self.titwin.update()
        else:
            if self.counter%10==0:
                self.titwin.update()
        #
        # Get the reference
        #
        if not reference:
            reference=self.WT
        #
        this_diff=0.0
        self.counter=self.counter+1
        import time
        timenow=time.time()
        time_passed=timenow-self.starttime
        fraction_completed=float(self.counter)/float(self.do_states)
        time_to_finish=(1.0-fraction_completed)/(fraction_completed/time_passed)
        txt='%d seconds' %(time_to_finish)
        if time_to_finish/60.0/60.0/24.0>365:
            txt='%5.2f years' %(time_to_finish/60.0/60.0/24.0/365.0)  
        elif time_to_finish/60.0/60.0>24:
            txt='%5.2f days' %(time_to_finish/60.0/60.0/24.0)    
        elif time_to_finish/60.0>60:
            txt='%5.2f hours' %(time_to_finish/60.0/60.0)
        elif time_to_finish>60:
            txt='%5.2f minutes' %(time_to_finish/60.0)
        self.progress.set('%.2f %% done (%5.2e of %5.2e). Finish in %s' %(fraction_completed*100.0,self.counter,self.do_states,txt))
        #
        # Measure the change
        #
        for group_test in self.ids.keys():
            id=self.ids[group_test]
            if self.monitor[id].get()==1:
                for pH in X.pHvalues:
                    new_crg=X.prot_states[group_test][pH]
                    old_crg=reference.prot_states[group_test][pH]
                    if absolut:
                        this_diff=this_diff+abs(new_crg-old_crg)*self.pHstep.get()
                    else:
                        this_diff=this_diff+(new_crg-old_crg)*self.pHstep.get()
        #
        # Store this difference
        #
        if abs(this_diff)>0.0:
            state=self.pack_configuration()
            self.curv_diffs.append([state,this_diff])
            #
            # Sort by largest difference
            #
            
            self.curv_diffs.sort(lambda x, y: -cmp(abs(x[1]),abs(y[1])))
            if self.curv_diffs[-1][0]==self.wt_state:
                self.curv_diffs=[[self.wt_state,0.0]]+self.curv_diffs
                del self.curv_diffs[-1]
            else:
                self.curv_diffs=[[self.wt_state,0.0]]+self.curv_diffs
            #self.curv_diffs=self.curv_diffs[:100000]
        return this_diff
Measure the difference in the titration curve as compared to the wt situration
Measure the difference in the titration curve as compared to the wt situration
Measure the difference in the titration curve as compared to the wt situration
def measure_change(self,reference=None,absolut=False):
        X=self.update_pkasystem_curves(doit=1)
         Should we update the display?
        if self.draw:
            self.titwin.update()
        else:
            if self.counter%10==0:
                self.titwin.update()
         Get the reference
        if not reference:
            reference=self.WT
        this_diff=0.0
        self.counter=self.counter+1
        import time
        timenow=time.time()
        time_passed=timenow-self.starttime
        fraction_completed=float(self.counter)/float(self.do_states)
        time_to_finish=(1.0-fraction_completed)/(fraction_completed/time_passed)
        txt='%d seconds' %(time_to_finish)
        if time_to_finish/60.0/60.0/24.0>365:
            txt='%5.2f years' %(time_to_finish/60.0/60.0/24.0/365.0)  
        elif time_to_finish/60.0/60.0>24:
            txt='%5.2f days' %(time_to_finish/60.0/60.0/24.0)    
        elif time_to_finish/60.0>60:
            txt='%5.2f hours' %(time_to_finish/60.0/60.0)
        elif time_to_finish>60:
            txt='%5.2f minutes' %(time_to_finish/60.0)
        self.progress.set('%.2f %% done (%5.2e of %5.2e). Finish in %s' %(fraction_completed*100.0,self.counter,self.do_states,txt))
         Measure the change
        for group_test in self.ids.keys():
            id=self.ids[group_test]
            if self.monitor[id].get()==1:
                for pH in X.pHvalues:
                    new_crg=X.prot_states[group_test][pH]
                    old_crg=reference.prot_states[group_test][pH]
                    if absolut:
                        this_diff=this_diff+abs(new_crg-old_crg)*self.pHstep.get()
                    else:
                        this_diff=this_diff+(new_crg-old_crg)*self.pHstep.get()
         Store this difference
        if abs(this_diff)>0.0:
            state=self.pack_configuration()
            self.curv_diffs.append([state,this_diff])
             Sort by largest difference
            self.curv_diffs.sort(lambda x, y: -cmp(abs(x[1]),abs(y[1])))
            if self.curv_diffs[-1][0]==self.wt_state:
                self.curv_diffs=[[self.wt_state,0.0]]+self.curv_diffs
                del self.curv_diffs[-1]
            else:
                self.curv_diffs=[[self.wt_state,0.0]]+self.curv_diffs
            self.curv_diffs=self.curv_diffs[:100000]
        return this_diff
def measure_change ( self , reference = None , absolut = False ) : X = self . update_pkasystem_curves ( doit = 1 ) if self . draw : self . titwin . update ( ) else : if self . counter % 10 == 0 : self . titwin . update ( ) if not reference : reference = self . WT this_diff = 0.0 self . counter = self . counter + 1 import time timenow = time . time ( ) time_passed = timenow - self . starttime fraction_completed = float ( self . counter ) / float ( self . do_states ) time_to_finish = ( 1.0 - fraction_completed ) / ( fraction_completed / time_passed ) txt = '%d seconds' % ( time_to_finish ) if time_to_finish / 60.0 / 60.0 / 24.0 > 365 : txt = '%5.2f years' % ( time_to_finish / 60.0 / 60.0 / 24.0 / 365.0 ) elif time_to_finish / 60.0 / 60.0 > 24 : txt = '%5.2f days' % ( time_to_finish / 60.0 / 60.0 / 24.0 ) elif time_to_finish / 60.0 > 60 : txt = '%5.2f hours' % ( time_to_finish / 60.0 / 60.0 ) elif time_to_finish > 60 : txt = '%5.2f minutes' % ( time_to_finish / 60.0 ) self . progress . set ( '%.2f %% done (%5.2e of %5.2e). Finish in %s' % ( fraction_completed * 100.0 , self . counter , self . do_states , txt ) ) for group_test in self . ids . keys ( ) : id = self . ids [ group_test ] if self . monitor [ id ] . get ( ) == 1 : for pH in X . pHvalues : new_crg = X . prot_states [ group_test ] [ pH ] old_crg = reference . prot_states [ group_test ] [ pH ] if absolut : this_diff = this_diff + abs ( new_crg - old_crg ) * self . pHstep . get ( ) else : this_diff = this_diff + ( new_crg - old_crg ) * self . pHstep . get ( ) if abs ( this_diff ) > 0.0 : state = self . pack_configuration ( ) self . curv_diffs . append ( [ state , this_diff ] ) self . curv_diffs . sort ( lambda x , y : - cmp ( abs ( x [ 1 ] ) , abs ( y [ 1 ] ) ) ) if self . curv_diffs [ - 1 ] [ 0 ] == self . wt_state : self . curv_diffs = [ [ self . wt_state , 0.0 ] ] + self . curv_diffs del self . curv_diffs [ - 1 ] else : self . curv_diffs = [ [ self . wt_state , 0.0 ] ] + self . curv_diffs return this_diff
Measure the difference in the titration curve as compared to the wt situration
Measure the difference in the titration curve as compared to the wt situration
"""Measure the difference in the titration curve as compared to the wt situration""" # # Should we update the display? # # # Get the reference # # # # Measure the change # # # Store this difference # # # Sort by largest difference # #self.curv_diffs=self.curv_diffs[:100000]
self
reference
absolut