PEATDB/plugins/KineticsAnalysis.py
def doAST(self, noraw=False):
        """Do AST using current defs
           Ekinraw is the optional manually re-fitted raw ast data"""
        enzymeconcs={}
        enzymeconcs1={}
        self.astdilutions, xx = self.getDilutions(os.path.join(self.path, self.astdilfile))
        if hasattr(self, 'template_enzconcs'):
            print self.template_enzconcs

        self.astraw = self.loadASTData(path=self.path, variantnames=self.variantnames, setname=self.setname,
                                        date=self.astdate, inhibconcs=self.subconcs)

        for name in self.required:
            print 'processing ast for variant', name

            #if noraw is true we don't get the raw data, but use the already made
            #ekin fits to extract the enzyme concs - handy for manually refit ast data
            if noraw == True:
                Ea=EkinProject()
                Ea.openProject(os.path.join(self.path, name.replace(' ','')+'_ast'))
                enzymeconc = self.getEnzymeConcfromAST(Ea, dilution=self.astdilutions[name])
            else:
                Ea, enzymeconc = self.fitAST(self.astraw[name], dilution=self.astdilutions[name])
                #Ea, enzymeconc1 = self.fitAST2(self.astraw[name], dilution=self.astdilutions[name])
                Ea.saveProject(os.path.join(self.path, name.replace(' ','')+'_ast'))

            enzymeconcs[name]=enzymeconc
            #enzymeconcs1[name]=enzymeconc1

        cw =  csv.writer(open(os.path.join(self.path, 'enzymeconcs.txt'),'w'))
        print 'found enzyme concentrations:'
        print '-----------------------------------'

        symb = unichr(177).encode("UTF-8")
        for name in enzymeconcs:
            print self.bold + name + self.reset, enzymeconcs[name][0], symb, enzymeconcs[name][1], '(%s)' %self.template_enzconcs[name]
            #print self.bold + name + self.reset, enzymeconcs1[name][0], symb, enzymeconcs1[name][1], '(%s)' %self.template_enzconcs[name]
            cw.writerow([name, enzymeconcs[name][0], enzymeconcs[name][1], self.template_enzconcs[name]])

        print '-----------------------------------'
        self.enzymeconcs = enzymeconcs

        E=EkinProject()
        y = [enzymeconcs[i][0] for i in enzymeconcs]
        x = [self.template_enzconcs[i] for i in enzymeconcs]
        yerrs = [enzymeconcs[i][1] for i in enzymeconcs]
        data = EkinConvert.xy2ekin([x, y], errorlists=(None, yerrs), labels=('templ','ours'))
        E.insertDataset(data, 'templ. vs simple', replace=True)
        #y = [enzymeconcs1[i][0] for i in enzymeconcs1]
        #data = EkinConvert.xy2ekin([x, y], labels=('templ','ours'))
        #E.insertDataset(data, 'templ. vs complex', replace=True)
        E.fitDatasets(models=['Linear'])
        E.saveProject(os.path.join(self.path, 'astvstemplate'))

        return enzymeconcs
Do AST using current defs
           Ekinraw is the optional manually re-fitted raw ast data
Do AST using current defs
Ekinraw is the optional manually re-fitted raw ast data
Do AST using current defs Ekinraw is the optional manually re - fitted raw ast data
def doAST(self, noraw=False):
        enzymeconcs={}
        enzymeconcs1={}
        self.astdilutions, xx = self.getDilutions(os.path.join(self.path, self.astdilfile))
        if hasattr(self, 'template_enzconcs'):
            print self.template_enzconcs
        self.astraw = self.loadASTData(path=self.path, variantnames=self.variantnames, setname=self.setname,
                                        date=self.astdate, inhibconcs=self.subconcs)
        for name in self.required:
            print 'processing ast for variant', name
            if noraw == True:
                Ea=EkinProject()
                Ea.openProject(os.path.join(self.path, name.replace(' ','')+'_ast'))
                enzymeconc = self.getEnzymeConcfromAST(Ea, dilution=self.astdilutions[name])
            else:
                Ea, enzymeconc = self.fitAST(self.astraw[name], dilution=self.astdilutions[name])
                Ea.saveProject(os.path.join(self.path, name.replace(' ','')+'_ast'))
            enzymeconcs[name]=enzymeconc
        cw =  csv.writer(open(os.path.join(self.path, 'enzymeconcs.txt'),'w'))
        print 'found enzyme concentrations:'
        print '-----------------------------------'
        symb = unichr(177).encode("UTF-8")
        for name in enzymeconcs:
            print self.bold + name + self.reset, enzymeconcs[name][0], symb, enzymeconcs[name][1], '(%s)' %self.template_enzconcs[name]
            cw.writerow([name, enzymeconcs[name][0], enzymeconcs[name][1], self.template_enzconcs[name]])
        print '-----------------------------------'
        self.enzymeconcs = enzymeconcs
        E=EkinProject()
        y = [enzymeconcs[i][0] for i in enzymeconcs]
        x = [self.template_enzconcs[i] for i in enzymeconcs]
        yerrs = [enzymeconcs[i][1] for i in enzymeconcs]
        data = EkinConvert.xy2ekin([x, y], errorlists=(None, yerrs), labels=('templ','ours'))
        E.insertDataset(data, 'templ. vs simple', replace=True)
        E.fitDatasets(models=['Linear'])
        E.saveProject(os.path.join(self.path, 'astvstemplate'))
        return enzymeconcs
def doAST ( self , noraw = False ) : enzymeconcs = { } enzymeconcs1 = { } self . astdilutions , xx = self . getDilutions ( os . path . join ( self . path , self . astdilfile ) ) if hasattr ( self , 'template_enzconcs' ) : print self . template_enzconcs self . astraw = self . loadASTData ( path = self . path , variantnames = self . variantnames , setname = self . setname , date = self . astdate , inhibconcs = self . subconcs ) for name in self . required : print 'processing ast for variant' , name if noraw == True : Ea = EkinProject ( ) Ea . openProject ( os . path . join ( self . path , name . replace ( ' ' , '' ) + '_ast' ) ) enzymeconc = self . getEnzymeConcfromAST ( Ea , dilution = self . astdilutions [ name ] ) else : Ea , enzymeconc = self . fitAST ( self . astraw [ name ] , dilution = self . astdilutions [ name ] ) Ea . saveProject ( os . path . join ( self . path , name . replace ( ' ' , '' ) + '_ast' ) ) enzymeconcs [ name ] = enzymeconc cw = csv . writer ( open ( os . path . join ( self . path , 'enzymeconcs.txt' ) , 'w' ) ) print 'found enzyme concentrations:' print '-----------------------------------' symb = unichr ( 177 ) . encode ( "UTF-8" ) for name in enzymeconcs : print self . bold + name + self . reset , enzymeconcs [ name ] [ 0 ] , symb , enzymeconcs [ name ] [ 1 ] , '(%s)' % self . template_enzconcs [ name ] cw . writerow ( [ name , enzymeconcs [ name ] [ 0 ] , enzymeconcs [ name ] [ 1 ] , self . template_enzconcs [ name ] ] ) print '-----------------------------------' self . enzymeconcs = enzymeconcs E = EkinProject ( ) y = [ enzymeconcs [ i ] [ 0 ] for i in enzymeconcs ] x = [ self . template_enzconcs [ i ] for i in enzymeconcs ] yerrs = [ enzymeconcs [ i ] [ 1 ] for i in enzymeconcs ] data = EkinConvert . xy2ekin ( [ x , y ] , errorlists = ( None , yerrs ) , labels = ( 'templ' , 'ours' ) ) E . insertDataset ( data , 'templ. vs simple' , replace = True ) E . fitDatasets ( models = [ 'Linear' ] ) E . saveProject ( os . path . join ( self . path , 'astvstemplate' ) ) return enzymeconcs
Do AST using current defs
Ekinraw is the optional manually re-fitted raw ast data
Do AST using current defs Ekinraw is the optional manually re - fitted raw ast data
"""Do AST using current defs
           Ekinraw is the optional manually re-fitted raw ast data""" #if noraw is true we don't get the raw data, but use the already made #ekin fits to extract the enzyme concs - handy for manually refit ast data #Ea, enzymeconc1 = self.fitAST2(self.astraw[name], dilution=self.astdilutions[name]) #enzymeconcs1[name]=enzymeconc1 #print self.bold + name + self.reset, enzymeconcs1[name][0], symb, enzymeconcs1[name][1], '(%s)' %self.template_enzconcs[name] #y = [enzymeconcs1[i][0] for i in enzymeconcs1] #data = EkinConvert.xy2ekin([x, y], labels=('templ','ours')) #E.insertDataset(data, 'templ. vs complex', replace=True)
self
noraw