DataPipeline/Utilities.py
def createNestedData():
    """Create simulated nested data similar to our kinetics data"""
    data={}
    names = ['aaa','bbb','ccc']
    tms = [7.5,8.0,8.5]
    phs = range(2,14) #e.g. a ph range
    concs = [0.01,0.1,0.2,0.3,0.5,1.0,2.0,5.0]
    x = range(0,100,10)

    for n in names:
        i=names.index(n)
        tm=tms[i]#+random.normalvariate(0,0.1)
        data[n]={}
        for p in phs:
            km = 2/(1+exp((p-tm)/1.2))
            #print p,km
            data[n][p]={}
            for s in concs:
                vel = (10 * s)/(s + km)
                y = [round(i*vel,3) for i in x]
                y = [i * random.normalvariate(1,0.03) for i in y]
                data[n][p][s] = (x,y)
    return data
Create simulated nested data similar to our kinetics data
Create simulated nested data similar to our kinetics data
Create simulated nested data similar to our kinetics data
def createNestedData():
    data={}
    names = ['aaa','bbb','ccc']
    tms = [7.5,8.0,8.5]
    phs = range(2,14) 
    concs = [0.01,0.1,0.2,0.3,0.5,1.0,2.0,5.0]
    x = range(0,100,10)
    for n in names:
        i=names.index(n)
        tm=tms[i]
        data[n]={}
        for p in phs:
            km = 2/(1+exp((p-tm)/1.2))
            data[n][p]={}
            for s in concs:
                vel = (10 * s)/(s + km)
                y = [round(i*vel,3) for i in x]
                y = [i * random.normalvariate(1,0.03) for i in y]
                data[n][p][s] = (x,y)
    return data
def createNestedData ( ) : data = { } names = [ 'aaa' , 'bbb' , 'ccc' ] tms = [ 7.5 , 8.0 , 8.5 ] phs = range ( 2 , 14 ) concs = [ 0.01 , 0.1 , 0.2 , 0.3 , 0.5 , 1.0 , 2.0 , 5.0 ] x = range ( 0 , 100 , 10 ) for n in names : i = names . index ( n ) tm = tms [ i ] data [ n ] = { } for p in phs : km = 2 / ( 1 + exp ( ( p - tm ) / 1.2 ) ) data [ n ] [ p ] = { } for s in concs : vel = ( 10 * s ) / ( s + km ) y = [ round ( i * vel , 3 ) for i in x ] y = [ i * random . normalvariate ( 1 , 0.03 ) for i in y ] data [ n ] [ p ] [ s ] = ( x , y ) return data
Create simulated nested data similar to our kinetics data
Create simulated nested data similar to our kinetics data
"""Create simulated nested data similar to our kinetics data""" #e.g. a ph range #+random.normalvariate(0,0.1) #print p,km