pKaTool/pKa_calc.py
def calc_pKas(self,mcsteps=2000,phstep=0.1,phstart=2.0,phend=14.0,verbose=1,complete_pka=None,exp_pHs=[]):
        """Calculate pKa values for the system"""
        #
        # Init
        #
        # Set a few constants
        #
        # KBol and Temp are equal to 1.0 everywhere in this derived class!
        #
        # Check that all dictionaries have been filled
        #
        self.groups=self.desolv.keys()
        self.groups.sort()
        b_groups=self.backgr.keys()
        b_groups.sort()
        m_groups=self.matrix.keys()
        m_groups.sort()
        #
        if self.groups!=b_groups or self.groups!=m_groups:
            print
            print 'Inconsistent desolv, backgr and matrix dictionaries'
            print
            ndes=len(self.desolv.keys())
            nback=len(self.backgr.keys())
            nmat=len(self.matrix.keys())
            print 'Groups in desolv: %3d, groups in backgr: %3d, groups in matrix: %3d \n' %(ndes,nback,nmat)
            groups=self.backgr.keys()+self.desolv.keys()+self.matrix.keys()
            g_dict={}
            for group in groups:
                g_dict[group]=1
            groups=g_dict.keys()
            groups.sort()
            for group in groups:
                has=['-','-','-']
                if self.desolv.has_key(group):
                    has[0]='+'
                if self.backgr.has_key(group):
                    has[1]='+'
                if self.matrix.has_key(group):
                    has[2]='+'
                print '%14s Desolv: %s, Backgr: %s, Matrix: %s' %(group,has[0],has[1],has[2])
                print 'Done with ',group
            print 'Totally done'
            import sys
            sys.stdout.flush()
            raise 'Error in Python Monte Carlo routine'
        #
        # Prepare the matrix
        #
        self.prepare_matrix()
        #
        # Calculate the intrinsic pKa values
        #
        self.calc_intpKas()
        #
        # Calculate pKa values
        #
        return self._calc_pKas(mcsteps,phstep,phstart,phend,verbose,complete_pka,exp_pHs=exp_pHs)
Calculate pKa values for the system
Calculate pKa values for the system
Calculate pKa values for the system
def calc_pKas(self,mcsteps=2000,phstep=0.1,phstart=2.0,phend=14.0,verbose=1,complete_pka=None,exp_pHs=[]):
         Init
         Set a few constants
         KBol and Temp are equal to 1.0 everywhere in this derived class!
         Check that all dictionaries have been filled
        self.groups=self.desolv.keys()
        self.groups.sort()
        b_groups=self.backgr.keys()
        b_groups.sort()
        m_groups=self.matrix.keys()
        m_groups.sort()
        if self.groups!=b_groups or self.groups!=m_groups:
            print
            print 'Inconsistent desolv, backgr and matrix dictionaries'
            print
            ndes=len(self.desolv.keys())
            nback=len(self.backgr.keys())
            nmat=len(self.matrix.keys())
            print 'Groups in desolv: %3d, groups in backgr: %3d, groups in matrix: %3d \n' %(ndes,nback,nmat)
            groups=self.backgr.keys()+self.desolv.keys()+self.matrix.keys()
            g_dict={}
            for group in groups:
                g_dict[group]=1
            groups=g_dict.keys()
            groups.sort()
            for group in groups:
                has=['-','-','-']
                if self.desolv.has_key(group):
                    has[0]='+'
                if self.backgr.has_key(group):
                    has[1]='+'
                if self.matrix.has_key(group):
                    has[2]='+'
                print '%14s Desolv: %s, Backgr: %s, Matrix: %s' %(group,has[0],has[1],has[2])
                print 'Done with ',group
            print 'Totally done'
            import sys
            sys.stdout.flush()
            raise 'Error in Python Monte Carlo routine'
         Prepare the matrix
        self.prepare_matrix()
         Calculate the intrinsic pKa values
        self.calc_intpKas()
         Calculate pKa values
        return self._calc_pKas(mcsteps,phstep,phstart,phend,verbose,complete_pka,exp_pHs=exp_pHs)
def calc_pKas ( self , mcsteps = 2000 , phstep = 0.1 , phstart = 2.0 , phend = 14.0 , verbose = 1 , complete_pka = None , exp_pHs = [ ] ) : self . groups = self . desolv . keys ( ) self . groups . sort ( ) b_groups = self . backgr . keys ( ) b_groups . sort ( ) m_groups = self . matrix . keys ( ) m_groups . sort ( ) if self . groups != b_groups or self . groups != m_groups : print print 'Inconsistent desolv, backgr and matrix dictionaries' print ndes = len ( self . desolv . keys ( ) ) nback = len ( self . backgr . keys ( ) ) nmat = len ( self . matrix . keys ( ) ) print 'Groups in desolv: %3d, groups in backgr: %3d, groups in matrix: %3d \n' % ( ndes , nback , nmat ) groups = self . backgr . keys ( ) + self . desolv . keys ( ) + self . matrix . keys ( ) g_dict = { } for group in groups : g_dict [ group ] = 1 groups = g_dict . keys ( ) groups . sort ( ) for group in groups : has = [ '-' , '-' , '-' ] if self . desolv . has_key ( group ) : has [ 0 ] = '+' if self . backgr . has_key ( group ) : has [ 1 ] = '+' if self . matrix . has_key ( group ) : has [ 2 ] = '+' print '%14s Desolv: %s, Backgr: %s, Matrix: %s' % ( group , has [ 0 ] , has [ 1 ] , has [ 2 ] ) print 'Done with ' , group print 'Totally done' import sys sys . stdout . flush ( ) raise 'Error in Python Monte Carlo routine' self . prepare_matrix ( ) self . calc_intpKas ( ) return self . _calc_pKas ( mcsteps , phstep , phstart , phend , verbose , complete_pka , exp_pHs = exp_pHs )
Calculate pKa values for the system
Calculate pKa values for the system
"""Calculate pKa values for the system""" # # Init # # Set a few constants # # KBol and Temp are equal to 1.0 everywhere in this derived class! # # Check that all dictionaries have been filled # # # # Prepare the matrix # # # Calculate the intrinsic pKa values # # # Calculate pKa values #
self
mcsteps
phstep
phstart
phend
verbose
complete_pka
exp_pHs