PEATDB/plugins/KineticsAnalysis.py
def fitAST(self, variantdata=None, dilution=None, Eraw=None):
        """Fit velocities vs inhibitor conc. to get enzyme concentrations,
           we get the error on the enz conc from the exp uncert of fit"""

        E = EkinProject(mode='General')
        for i in variantdata.keys():
            E.insertDataset(variantdata[i], str(i))

        #inital fit of raw data to get slopes
        E.fitDatasets(models=['Linear'], noiter=200, conv=1e-8, grad=1e-8, silent=True)


        #check fits applying criteria and deactivate points accordingly
        #criteria: V>0, leave out 3.2 val, check err on slope
        active=[]
        for d in E.datasets:
            status = self.checkLinearFit(E, d, cutoff = 0.08, fromstart=False)
            ferrs = E.estimateExpUncertainty(d, runs=10)
            E.addMeta(d, 'exp_errors', ferrs)
            #print d, ferrs
            slope = E.getMetaData(d)['a']
            ek=EkinDataset(E.getDataset(d))
            Yvals = ek.getY()
            yrange = max(Yvals)-min(Yvals)
            yerror = E.getMeta(d, 'exp_errors')['a'][1] / yrange
            if d == '3.2' or slope < 0.0002 or yerror > 0.02:
                active.append(0)
            else:
                active.append(1)
            #print d, slope, yerror, active
        print active
        print 'creating Inhib conc data..'
        import copy
        datasets = copy.deepcopy(E.datasets)

        #extract slopes and create Inhib data
        slopes=[];iconcs=[]
        xerrors=[];yerrors=[]
        for d in datasets:
            x = d.split('_')
            iconc = round(float(x[0]),3)
            #get slope and error and add the point
            slope = E.getMetaData(d)['a']
            yerror = E.getMeta(d, 'exp_errors')['a'][1]
            slopes.append(slope)
            iconcs.append(iconc)
            xerrors.append(iconc*self.sconcerr/100)
            yerrors.append(yerror)

        #print ph, name, sconcs, slopes, yerrors
        edata = EkinConvert.xy2ekin([iconcs, slopes], errorlists=(xerrors, yerrors),
                                        activelist=active, labels=('[I]','V'))

        E.insertDataset(edata, 'enzyme_conc')
        enzymeconc = self.getEnzymeConcfromAST(E, dilution)

        return E, enzymeconc
Fit velocities vs inhibitor conc. to get enzyme concentrations,
           we get the error on the enz conc from the exp uncert of fit
Fit velocities vs inhibitor conc. to get enzyme concentrations,
we get the error on the enz conc from the exp uncert of fit
Fit velocities vs inhibitor conc . to get enzyme concentrations we get the error on the enz conc from the exp uncert of fit
def fitAST(self, variantdata=None, dilution=None, Eraw=None):
        E = EkinProject(mode='General')
        for i in variantdata.keys():
            E.insertDataset(variantdata[i], str(i))
        E.fitDatasets(models=['Linear'], noiter=200, conv=1e-8, grad=1e-8, silent=True)
        active=[]
        for d in E.datasets:
            status = self.checkLinearFit(E, d, cutoff = 0.08, fromstart=False)
            ferrs = E.estimateExpUncertainty(d, runs=10)
            E.addMeta(d, 'exp_errors', ferrs)
            slope = E.getMetaData(d)['a']
            ek=EkinDataset(E.getDataset(d))
            Yvals = ek.getY()
            yrange = max(Yvals)-min(Yvals)
            yerror = E.getMeta(d, 'exp_errors')['a'][1] / yrange
            if d == '3.2' or slope < 0.0002 or yerror > 0.02:
                active.append(0)
            else:
                active.append(1)
        print active
        print 'creating Inhib conc data..'
        import copy
        datasets = copy.deepcopy(E.datasets)
        slopes=[];iconcs=[]
        xerrors=[];yerrors=[]
        for d in datasets:
            x = d.split('_')
            iconc = round(float(x[0]),3)
            slope = E.getMetaData(d)['a']
            yerror = E.getMeta(d, 'exp_errors')['a'][1]
            slopes.append(slope)
            iconcs.append(iconc)
            xerrors.append(iconc*self.sconcerr/100)
            yerrors.append(yerror)
        edata = EkinConvert.xy2ekin([iconcs, slopes], errorlists=(xerrors, yerrors),
                                        activelist=active, labels=('[I]','V'))
        E.insertDataset(edata, 'enzyme_conc')
        enzymeconc = self.getEnzymeConcfromAST(E, dilution)
        return E, enzymeconc
def fitAST ( self , variantdata = None , dilution = None , Eraw = None ) : E = EkinProject ( mode = 'General' ) for i in variantdata . keys ( ) : E . insertDataset ( variantdata [ i ] , str ( i ) ) E . fitDatasets ( models = [ 'Linear' ] , noiter = 200 , conv = 1e-8 , grad = 1e-8 , silent = True ) active = [ ] for d in E . datasets : status = self . checkLinearFit ( E , d , cutoff = 0.08 , fromstart = False ) ferrs = E . estimateExpUncertainty ( d , runs = 10 ) E . addMeta ( d , 'exp_errors' , ferrs ) slope = E . getMetaData ( d ) [ 'a' ] ek = EkinDataset ( E . getDataset ( d ) ) Yvals = ek . getY ( ) yrange = max ( Yvals ) - min ( Yvals ) yerror = E . getMeta ( d , 'exp_errors' ) [ 'a' ] [ 1 ] / yrange if d == '3.2' or slope < 0.0002 or yerror > 0.02 : active . append ( 0 ) else : active . append ( 1 ) print active print 'creating Inhib conc data..' import copy datasets = copy . deepcopy ( E . datasets ) slopes = [ ] ; iconcs = [ ] xerrors = [ ] ; yerrors = [ ] for d in datasets : x = d . split ( '_' ) iconc = round ( float ( x [ 0 ] ) , 3 ) slope = E . getMetaData ( d ) [ 'a' ] yerror = E . getMeta ( d , 'exp_errors' ) [ 'a' ] [ 1 ] slopes . append ( slope ) iconcs . append ( iconc ) xerrors . append ( iconc * self . sconcerr / 100 ) yerrors . append ( yerror ) edata = EkinConvert . xy2ekin ( [ iconcs , slopes ] , errorlists = ( xerrors , yerrors ) , activelist = active , labels = ( '[I]' , 'V' ) ) E . insertDataset ( edata , 'enzyme_conc' ) enzymeconc = self . getEnzymeConcfromAST ( E , dilution ) return E , enzymeconc
Fit velocities vs inhibitor conc.
Fit velocities vs inhibitor conc .
"""Fit velocities vs inhibitor conc. to get enzyme concentrations,
           we get the error on the enz conc from the exp uncert of fit""" #inital fit of raw data to get slopes #check fits applying criteria and deactivate points accordingly #criteria: V>0, leave out 3.2 val, check err on slope #print d, ferrs #print d, slope, yerror, active #extract slopes and create Inhib data #get slope and error and add the point #print ph, name, sconcs, slopes, yerrors
self
variantdata
dilution
Eraw