PEATDB/Ekin/Titration.py
def dostrictchecking(cls, datapoints, fitdata):
        """Do some checking of pKa models as per McIntosh suggestions
           1. check pKa values are not too close to the end of the data points"""

        ph = datapoints
        phmin = min(ph)
        phmax = max(ph)
        model = fitdata['model']
        vrs = Fitting.getFitVars(fitdata)
        X = Fitting.getFitter(model, vrs=vrs)
        fit = X.getFitDict()

        print fit
        pkas=[]
        for p in fit:
            if 'pK' in p:
                pka=float(fit[p])
                pkas.append(pka)
                diff1=phmax-pka
                diff2=pka-phmin
                print 'pka', pka, 'is', diff1, 'away from endpoint'
                print 'and', diff2, 'away from startpoint'
                if pka < phmin or pka > phmax:
                    print 'this pKa is off the pH scale!'
                    return 0
                if diff1 < 0.1 or diff2 < 0.1:
                    print 'this pKa is too close to an end point'
                    return 0
        return 1
Do some checking of pKa models as per McIntosh suggestions
           1. check pKa values are not too close to the end of the data points
Do some checking of pKa models as per McIntosh suggestions
1. check pKa values are not too close to the end of the data points
Do some checking of pKa models as per McIntosh suggestions 1 . check pKa values are not too close to the end of the data points
def dostrictchecking(cls, datapoints, fitdata):
        ph = datapoints
        phmin = min(ph)
        phmax = max(ph)
        model = fitdata['model']
        vrs = Fitting.getFitVars(fitdata)
        X = Fitting.getFitter(model, vrs=vrs)
        fit = X.getFitDict()
        print fit
        pkas=[]
        for p in fit:
            if 'pK' in p:
                pka=float(fit[p])
                pkas.append(pka)
                diff1=phmax-pka
                diff2=pka-phmin
                print 'pka', pka, 'is', diff1, 'away from endpoint'
                print 'and', diff2, 'away from startpoint'
                if pka < phmin or pka > phmax:
                    print 'this pKa is off the pH scale!'
                    return 0
                if diff1 < 0.1 or diff2 < 0.1:
                    print 'this pKa is too close to an end point'
                    return 0
        return 1
def dostrictchecking ( cls , datapoints , fitdata ) : ph = datapoints phmin = min ( ph ) phmax = max ( ph ) model = fitdata [ 'model' ] vrs = Fitting . getFitVars ( fitdata ) X = Fitting . getFitter ( model , vrs = vrs ) fit = X . getFitDict ( ) print fit pkas = [ ] for p in fit : if 'pK' in p : pka = float ( fit [ p ] ) pkas . append ( pka ) diff1 = phmax - pka diff2 = pka - phmin print 'pka' , pka , 'is' , diff1 , 'away from endpoint' print 'and' , diff2 , 'away from startpoint' if pka < phmin or pka > phmax : print 'this pKa is off the pH scale!' return 0 if diff1 < 0.1 or diff2 < 0.1 : print 'this pKa is too close to an end point' return 0 return 1
Do some checking of pKa models as per McIntosh suggestions
1. check pKa values are not too close to the end of the data points
Do some checking of pKa models as per McIntosh suggestions 1 . check pKa values are not too close to the end of the data points
"""Do some checking of pKa models as per McIntosh suggestions
           1. check pKa values are not too close to the end of the data points"""
cls
datapoints
fitdata