pKaTool/pKa_calc.py
def determine_pKa_values(self):
        """Determine pKa values as half-points of titration from titration data"""
        pkavalues={}
        pHvalues=self.pHvalues
        pHvalues.sort()
        for group in self.groups:
            pka=-99.9
            last_crg=self.prot_states_tmp[pHvalues[0]][group]
            phstep=float(pHvalues[1]-pHvalues[0])
            for ph in pHvalues:
                try:
                    crg=self.prot_states_tmp[ph][group]
                except:
                    grps=self.prot_states_tmp[ph].keys()
                    grps.sort()
                    print grps
                    print group
                    raise 'same error'
                #
                # ----
                #
                if crg<last_crg:
                    if self.acid_base(group)==1:
                        if crg<=0.5 and last_crg>0.5:
                            pka=(last_crg-0.5)/(last_crg-crg)*phstep+(ph-phstep)
                            break
                    else:
                        if crg<=-0.5 and last_crg>-0.5:
                            pka=(last_crg-(-0.5))/(last_crg-crg)*phstep+(ph-phstep)
                            break
                last_crg=crg
            if pka<-90.0:
                if self.acid_base(group)==1:
                    if last_crg>0.5:
                        pka=99.9
                    else:
                        pka=-99.9
                else:
                    if last_crg>-0.5:
                        pka=99.9
                    else:
                        pka=-99.9
            pkavalues[group]=pka
        return pkavalues
Determine pKa values as half-points of titration from titration data
Determine pKa values as half-points of titration from titration data
Determine pKa values as half - points of titration from titration data
def determine_pKa_values(self):
        pkavalues={}
        pHvalues=self.pHvalues
        pHvalues.sort()
        for group in self.groups:
            pka=-99.9
            last_crg=self.prot_states_tmp[pHvalues[0]][group]
            phstep=float(pHvalues[1]-pHvalues[0])
            for ph in pHvalues:
                try:
                    crg=self.prot_states_tmp[ph][group]
                except:
                    grps=self.prot_states_tmp[ph].keys()
                    grps.sort()
                    print grps
                    print group
                    raise 'same error'
                 ----
                if crg<last_crg:
                    if self.acid_base(group)==1:
                        if crg<=0.5 and last_crg>0.5:
                            pka=(last_crg-0.5)/(last_crg-crg)*phstep+(ph-phstep)
                            break
                    else:
                        if crg<=-0.5 and last_crg>-0.5:
                            pka=(last_crg-(-0.5))/(last_crg-crg)*phstep+(ph-phstep)
                            break
                last_crg=crg
            if pka<-90.0:
                if self.acid_base(group)==1:
                    if last_crg>0.5:
                        pka=99.9
                    else:
                        pka=-99.9
                else:
                    if last_crg>-0.5:
                        pka=99.9
                    else:
                        pka=-99.9
            pkavalues[group]=pka
        return pkavalues
def determine_pKa_values ( self ) : pkavalues = { } pHvalues = self . pHvalues pHvalues . sort ( ) for group in self . groups : pka = - 99.9 last_crg = self . prot_states_tmp [ pHvalues [ 0 ] ] [ group ] phstep = float ( pHvalues [ 1 ] - pHvalues [ 0 ] ) for ph in pHvalues : try : crg = self . prot_states_tmp [ ph ] [ group ] except : grps = self . prot_states_tmp [ ph ] . keys ( ) grps . sort ( ) print grps print group raise 'same error' if crg < last_crg : if self . acid_base ( group ) == 1 : if crg <= 0.5 and last_crg > 0.5 : pka = ( last_crg - 0.5 ) / ( last_crg - crg ) * phstep + ( ph - phstep ) break else : if crg <= - 0.5 and last_crg > - 0.5 : pka = ( last_crg - ( - 0.5 ) ) / ( last_crg - crg ) * phstep + ( ph - phstep ) break last_crg = crg if pka < - 90.0 : if self . acid_base ( group ) == 1 : if last_crg > 0.5 : pka = 99.9 else : pka = - 99.9 else : if last_crg > - 0.5 : pka = 99.9 else : pka = - 99.9 pkavalues [ group ] = pka return pkavalues
Determine pKa values as half-points of titration from titration data
Determine pKa values as half - points of titration from titration data
"""Determine pKa values as half-points of titration from titration data""" # # ---- #
self