PEATDB/plugins/KineticsAnalysis.py
def loadRawData(self, path, variantnames, phvalues, date, setname,
                         run=None, subconcs=None, dilutions=None):
        """Load raw MM data for one set of replicates and return dict of variants.
           raw data is loaded from text files containing sets per pH and
           the other args provide the exp conditions
           parseMMdefs uses MM.def to get exp details and provide them here
           """
        print 'processing raw data..'
        rawdata = {}

        for name in variantnames:
            rawdata[name] = {}
            for ph in phvalues:
                rawdata[name][ph]={}

        for ph in phvalues:
            print 'processing raw data for ph', ph

            filename = 'set%s_%s_%s_pH%s.txt' % (setname, date, run, ph)
            filename = os.path.join('MM', filename)
            try:
                reader = csv.reader(open(os.path.join(path, filename)),
                                    dialect='excel-tab')
            except:
                print 'failed to open %s !' %filename
                print
                continue

            rows=[]
            for row in reader:
                rows.append(row)
            mins=[]
            for t in self.times: mins.append(round(t/60.0,3))
            i=0
            row=3
            offset=9
            #get raw absorbance data from text file instead of excel
            for c in range(2,14):
                row=3
                name = variantnames[i]
                for s in range(0,8):
                    r=row
                    yvals=[];yerrs=[]
                    for t in self.times:
                        #print s, t, r, c, len(rows[r]), rows[r][c]
                        try:
                            val=float(rows[r][c].replace(",", "."))
                            yvals.append(val)
                            yerrs.append(val*self.abserr/100)
                        except:
                            yvals.append('')
                            yerrs.append(0)
                            #print 'Nan, skipping'
                        r = r + offset
                    row+=1
                    S=subconcs[s]
                    rawdata[name][ph][S] = EkinDataset(xy=[mins, yvals],
                                               yerrs=yerrs, xlabel='t',ylabel='A')
                i+=1

        return rawdata
Load raw MM data for one set of replicates and return dict of variants.
           raw data is loaded from text files containing sets per pH and
           the other args provide the exp conditions
           parseMMdefs uses MM.def to get exp details and provide them here
           
Load raw MM data for one set of replicates and return dict of variants.
raw data is loaded from text files containing sets per pH and
the other args provide the exp conditions
parseMMdefs uses MM.def to get exp details and provide them here
Load raw MM data for one set of replicates and return dict of variants . raw data is loaded from text files containing sets per pH and the other args provide the exp conditions parseMMdefs uses MM . def to get exp details and provide them here
def loadRawData(self, path, variantnames, phvalues, date, setname,
                         run=None, subconcs=None, dilutions=None):
        print 'processing raw data..'
        rawdata = {}
        for name in variantnames:
            rawdata[name] = {}
            for ph in phvalues:
                rawdata[name][ph]={}
        for ph in phvalues:
            print 'processing raw data for ph', ph
            filename = 'set%s_%s_%s_pH%s.txt' % (setname, date, run, ph)
            filename = os.path.join('MM', filename)
            try:
                reader = csv.reader(open(os.path.join(path, filename)),
                                    dialect='excel-tab')
            except:
                print 'failed to open %s !' %filename
                print
                continue
            rows=[]
            for row in reader:
                rows.append(row)
            mins=[]
            for t in self.times: mins.append(round(t/60.0,3))
            i=0
            row=3
            offset=9
            for c in range(2,14):
                row=3
                name = variantnames[i]
                for s in range(0,8):
                    r=row
                    yvals=[];yerrs=[]
                    for t in self.times:
                        try:
                            val=float(rows[r][c].replace(",", "."))
                            yvals.append(val)
                            yerrs.append(val*self.abserr/100)
                        except:
                            yvals.append('')
                            yerrs.append(0)
                        r = r + offset
                    row+=1
                    S=subconcs[s]
                    rawdata[name][ph][S] = EkinDataset(xy=[mins, yvals],
                                               yerrs=yerrs, xlabel='t',ylabel='A')
                i+=1
        return rawdata
def loadRawData ( self , path , variantnames , phvalues , date , setname , run = None , subconcs = None , dilutions = None ) : print 'processing raw data..' rawdata = { } for name in variantnames : rawdata [ name ] = { } for ph in phvalues : rawdata [ name ] [ ph ] = { } for ph in phvalues : print 'processing raw data for ph' , ph filename = 'set%s_%s_%s_pH%s.txt' % ( setname , date , run , ph ) filename = os . path . join ( 'MM' , filename ) try : reader = csv . reader ( open ( os . path . join ( path , filename ) ) , dialect = 'excel-tab' ) except : print 'failed to open %s !' % filename print continue rows = [ ] for row in reader : rows . append ( row ) mins = [ ] for t in self . times : mins . append ( round ( t / 60.0 , 3 ) ) i = 0 row = 3 offset = 9 for c in range ( 2 , 14 ) : row = 3 name = variantnames [ i ] for s in range ( 0 , 8 ) : r = row yvals = [ ] ; yerrs = [ ] for t in self . times : try : val = float ( rows [ r ] [ c ] . replace ( "," , "." ) ) yvals . append ( val ) yerrs . append ( val * self . abserr / 100 ) except : yvals . append ( '' ) yerrs . append ( 0 ) r = r + offset row += 1 S = subconcs [ s ] rawdata [ name ] [ ph ] [ S ] = EkinDataset ( xy = [ mins , yvals ] , yerrs = yerrs , xlabel = 't' , ylabel = 'A' ) i += 1 return rawdata
Load raw MM data for one set of replicates and return dict of variants.
Load raw MM data for one set of replicates and return dict of variants .
"""Load raw MM data for one set of replicates and return dict of variants.
           raw data is loaded from text files containing sets per pH and
           the other args provide the exp conditions
           parseMMdefs uses MM.def to get exp details and provide them here
           """ #get raw absorbance data from text file instead of excel #print s, t, r, c, len(rows[r]), rows[r][c] #print 'Nan, skipping'
self
path
variantnames
phvalues
date
setname
run
subconcs
dilutions