pKaTool/CCPS_stab_opt.py
def _Stability(self,spec):
        """Score the stability of the system"""
        if not self.Stability_pH_vals:
            self.Stability_pH_vals=self.get_pH_range(spec['pH']['var'].get())
        #
        # Score the stability
        #
        opttype=spec['opttype']['var'].get()
        cutoff=spec['cutoff']['var'].get()
        if opttype=='maximise':
            # Maximising stability means minimising the dG of folding
            sum_stab=0
            count=0
            for pH in self.Stability_pH_vals:
                if self.stability[pH]>cutoff:
                    sum_stab=sum_stab+self.stability[pH]-cutoff
                    count=count+1
            if count>1:
                sum_stab=sum_stab/float(count)
        else:
            raise Exeption
        import math
        sum_stab=sum_stab*spec['weight']['var'].get()
        #print 'Stability',math.exp(sum_stab)
        return sum_stab
Score the stability of the system
Score the stability of the system
Score the stability of the system
def _Stability(self,spec):
        if not self.Stability_pH_vals:
            self.Stability_pH_vals=self.get_pH_range(spec['pH']['var'].get())
         Score the stability
        opttype=spec['opttype']['var'].get()
        cutoff=spec['cutoff']['var'].get()
        if opttype=='maximise':
             Maximising stability means minimising the dG of folding
            sum_stab=0
            count=0
            for pH in self.Stability_pH_vals:
                if self.stability[pH]>cutoff:
                    sum_stab=sum_stab+self.stability[pH]-cutoff
                    count=count+1
            if count>1:
                sum_stab=sum_stab/float(count)
        else:
            raise Exeption
        import math
        sum_stab=sum_stab*spec['weight']['var'].get()
        print 'Stability',math.exp(sum_stab)
        return sum_stab
def _Stability ( self , spec ) : if not self . Stability_pH_vals : self . Stability_pH_vals = self . get_pH_range ( spec [ 'pH' ] [ 'var' ] . get ( ) ) opttype = spec [ 'opttype' ] [ 'var' ] . get ( ) cutoff = spec [ 'cutoff' ] [ 'var' ] . get ( ) if opttype == 'maximise' : sum_stab = 0 count = 0 for pH in self . Stability_pH_vals : if self . stability [ pH ] > cutoff : sum_stab = sum_stab + self . stability [ pH ] - cutoff count = count + 1 if count > 1 : sum_stab = sum_stab / float ( count ) else : raise Exeption import math sum_stab = sum_stab * spec [ 'weight' ] [ 'var' ] . get ( ) return sum_stab
Score the stability of the system
Score the stability of the system
"""Score the stability of the system""" # # Score the stability # # Maximising stability means minimising the dG of folding #print 'Stability',math.exp(sum_stab)
self
spec