PEATDB/plugins/KineticsAnalysis.py
def fitAST2(self, variantdata=None, dilution=None, Eraw=None):
        """Fit AST using Lars method, we fit each raw abs data to MM by first
        transforming Abs vals to [S] and getting a Vmax for each [I]"""
        import copy

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

        #transform dataset in terms of [S] vs V vals using Ainit, Amax
        #using eq: [S] = [S]init * (1 - (A405 - A405,init) / (A405,max - A405,init))
        Sinit = 1
        #get Amax?
        Es = EkinProject()

        #get Amax from highest well
        Amax = 0
        for d in E.datasets:
            x,y,a = EkinConvert.ekin2xy(E.getDataset(d))
            if max(y) > Amax:
                Amax = max(y)
        print 'Amax', Amax
        for d in E.datasets:
            x,y,a = EkinConvert.ekin2xy(E.getDataset(d))
            S=[]; V=[]
            Ainit = 0.05
            for a in range(len(y)-1):
                dT=x[a+1]-x[a]
                A = (y[a+1] + y[a])/2
                dA = (y[a+1] - y[a])    #velocity is rate of change Abs

                V.append(dA/dT)
                S.append(abs(Sinit * (1- ((A-Ainit) / (Amax-Ainit)))))

            sdata = EkinConvert.xy2ekin([S,V], labels=('[S]','v'))
            Es.insertDataset(sdata, d)

        print Es
        #now fit this to MM equation to extract a Vmax for each [I]
        Es.fitDatasets(models=['Michaelis-Menten'], noiter=500, silent=True)
        for d in E.datasets:
            ferrs = Es.estimateExpUncertainty(d, runs=30)
            Es.addMeta(d, 'exp_errors', ferrs)

        v=[];iconcs=[]
        xerrors=[];yerrors=[]
        for d in Es.datasets:
            x = d.split('_')
            iconc = round(float(x[0]),3)
            vmax = Es.getMetaData(d)['Vmax']
            yerror = Es.getMeta(d, 'exp_errors')['Vmax'][1]
            v.append(vmax)
            iconcs.append(iconc)
            xerrors.append(iconc*self.sconcerr/100)
            yerrors.append(yerror)

        edata = EkinConvert.xy2ekin([iconcs, v], errorlists=(xerrors, yerrors),
                                        labels=('[I]','Vmax'))

        Es.insertDataset(edata, 'enzyme_conc')
        enzymeconc = self.getEnzymeConcfromAST(Es, dilution)
        #Es.saveProject('ast2test')
        return Es, enzymeconc
Fit AST using Lars method, we fit each raw abs data to MM by first
        transforming Abs vals to [S] and getting a Vmax for each [I]
Fit AST using Lars method, we fit each raw abs data to MM by first
transforming Abs vals to [S] and getting a Vmax for each [I]
Fit AST using Lars method we fit each raw abs data to MM by first transforming Abs vals to [ S ] and getting a Vmax for each [ I ]
def fitAST2(self, variantdata=None, dilution=None, Eraw=None):
        import copy
        E = EkinProject(mode='General')
        for i in variantdata.keys():
            E.insertDataset(variantdata[i], str(i))
        Sinit = 1
        Es = EkinProject()
        Amax = 0
        for d in E.datasets:
            x,y,a = EkinConvert.ekin2xy(E.getDataset(d))
            if max(y) > Amax:
                Amax = max(y)
        print 'Amax', Amax
        for d in E.datasets:
            x,y,a = EkinConvert.ekin2xy(E.getDataset(d))
            S=[]; V=[]
            Ainit = 0.05
            for a in range(len(y)-1):
                dT=x[a+1]-x[a]
                A = (y[a+1] + y[a])/2
                dA = (y[a+1] - y[a])    
                V.append(dA/dT)
                S.append(abs(Sinit * (1- ((A-Ainit) / (Amax-Ainit)))))
            sdata = EkinConvert.xy2ekin([S,V], labels=('[S]','v'))
            Es.insertDataset(sdata, d)
        print Es
        Es.fitDatasets(models=['Michaelis-Menten'], noiter=500, silent=True)
        for d in E.datasets:
            ferrs = Es.estimateExpUncertainty(d, runs=30)
            Es.addMeta(d, 'exp_errors', ferrs)
        v=[];iconcs=[]
        xerrors=[];yerrors=[]
        for d in Es.datasets:
            x = d.split('_')
            iconc = round(float(x[0]),3)
            vmax = Es.getMetaData(d)['Vmax']
            yerror = Es.getMeta(d, 'exp_errors')['Vmax'][1]
            v.append(vmax)
            iconcs.append(iconc)
            xerrors.append(iconc*self.sconcerr/100)
            yerrors.append(yerror)
        edata = EkinConvert.xy2ekin([iconcs, v], errorlists=(xerrors, yerrors),
                                        labels=('[I]','Vmax'))
        Es.insertDataset(edata, 'enzyme_conc')
        enzymeconc = self.getEnzymeConcfromAST(Es, dilution)
        return Es, enzymeconc
def fitAST2 ( self , variantdata = None , dilution = None , Eraw = None ) : import copy E = EkinProject ( mode = 'General' ) for i in variantdata . keys ( ) : E . insertDataset ( variantdata [ i ] , str ( i ) ) Sinit = 1 Es = EkinProject ( ) Amax = 0 for d in E . datasets : x , y , a = EkinConvert . ekin2xy ( E . getDataset ( d ) ) if max ( y ) > Amax : Amax = max ( y ) print 'Amax' , Amax for d in E . datasets : x , y , a = EkinConvert . ekin2xy ( E . getDataset ( d ) ) S = [ ] ; V = [ ] Ainit = 0.05 for a in range ( len ( y ) - 1 ) : dT = x [ a + 1 ] - x [ a ] A = ( y [ a + 1 ] + y [ a ] ) / 2 dA = ( y [ a + 1 ] - y [ a ] ) V . append ( dA / dT ) S . append ( abs ( Sinit * ( 1 - ( ( A - Ainit ) / ( Amax - Ainit ) ) ) ) ) sdata = EkinConvert . xy2ekin ( [ S , V ] , labels = ( '[S]' , 'v' ) ) Es . insertDataset ( sdata , d ) print Es Es . fitDatasets ( models = [ 'Michaelis-Menten' ] , noiter = 500 , silent = True ) for d in E . datasets : ferrs = Es . estimateExpUncertainty ( d , runs = 30 ) Es . addMeta ( d , 'exp_errors' , ferrs ) v = [ ] ; iconcs = [ ] xerrors = [ ] ; yerrors = [ ] for d in Es . datasets : x = d . split ( '_' ) iconc = round ( float ( x [ 0 ] ) , 3 ) vmax = Es . getMetaData ( d ) [ 'Vmax' ] yerror = Es . getMeta ( d , 'exp_errors' ) [ 'Vmax' ] [ 1 ] v . append ( vmax ) iconcs . append ( iconc ) xerrors . append ( iconc * self . sconcerr / 100 ) yerrors . append ( yerror ) edata = EkinConvert . xy2ekin ( [ iconcs , v ] , errorlists = ( xerrors , yerrors ) , labels = ( '[I]' , 'Vmax' ) ) Es . insertDataset ( edata , 'enzyme_conc' ) enzymeconc = self . getEnzymeConcfromAST ( Es , dilution ) return Es , enzymeconc
Fit AST using Lars method, we fit each raw abs data to MM by first
transforming Abs vals to [S] and getting a Vmax for each [I]
Fit AST using Lars method we fit each raw abs data to MM by first transforming Abs vals to [ S ] and getting a Vmax for each [ I ]
"""Fit AST using Lars method, we fit each raw abs data to MM by first
        transforming Abs vals to [S] and getting a Vmax for each [I]""" #transform dataset in terms of [S] vs V vals using Ainit, Amax #using eq: [S] = [S]init * (1 - (A405 - A405,init) / (A405,max - A405,init)) #get Amax? #get Amax from highest well #velocity is rate of change Abs #now fit this to MM equation to extract a Vmax for each [I] #Es.saveProject('ast2test')
self
variantdata
dilution
Eraw