def runSimulations(knockouts=True):
    print "starting Simulations"
    data = {}
    targets = [
        'CPK213', 'HATPase', 'NOGC1', 'NAD', 'ABA', 'Microtubule', 'Depolar',
        'InsP3', 'SphK12', 'ABH1', 'InsP6', 'CIS', 'AnionEM', 'GAPC',
        'KEfflux', 'H2OEfflux', 'VPpase', 'PP2CA', 'MRP5', 'CPK23',
        'Vacidification', 'DAG', 'ROP11', 'NO', 'pHc', 'PIP21', 'PEPC',
        'NitrocGMP', 'HAB1', 'DAGK', 'PLDd', 'PC', 'CPK6', 'PA', 'PLDa', 'PLC',
        'PI3P5K', 'ROS', 'AtRAC1', 'OST1', 'cGMP', 'Ca2ATPase', 'GCR1', 'RCN1',
        'PIP2', 'QUAC1', 'S1P', 'Malate', 'KOUT', 'NADPH', 'MAPK912', 'KEV',
        'SCAB1', 'CaIM', 'TCTP', 'VATPase', 'GPA1', 'PtdIns35P2', 'GTP',
        'GEF1410', 'ARP23', 'PtdInsP4', 'Sph', 'ABI1', 'NIA12', 'ADPRc',
        'RCARs', 'PtdInsP3', 'Nitrite', 'ABI2', 'SPP1', 'RBOH', 'Actin',
        'ERA1', 'NtSyp121', 'Ca2c', 'GHR1', 'cADPR', 'SLAH3', 'SLAC1'
    ]
    for target in targets:
        if knockouts is True:
            mtext = boolean2.modify_states(text=text, turnoff=target)
            fname = 'knockouts.json'
        else:
            mtext = boolean2.modify_states(text=text, turnon=target)
            fname = 'overexpression.json'
        model = boolean2.Model(mode='async', text=mtext)
        coll = util.Collector()
        for i in xrange(repeat):
            model.initialize(missing=util.randbool)
            model.iterate(steps=steps)
            coll.collect(states=model.states, nodes='Closure')
        data[target] = {'Timesteps': coll.get_averages(normalize=True)}
        data[target]['Closure AUC'] = sum(data[target]['Timesteps']['Closure'])
    with open(fname, 'w') as fp:
        json.dump(data, fp)
Example #2
0
def runSimulations(knockouts=True):
    print "starting Simulations"
    data = {}
    #use the following set of targets if running the simulation for the reduced model
    #targets = ['NOGC1', 'PLDdel', 'InsP3', 'nitrocGMP', 'CIS', 'Actin', 'AnionEM', 'K_efflux', 'PP2CA', 'H2O_Efflux', 'DAG', 'NO', 'pHc', 'PEPC', 'HAB1', 'PA',
    #'PLDa', 'PLC', 'PI3P5K', 'OST1', 'SLAH3', 'ABA', 'H_ATPase', 'Malate', 'KOUT', 'Depolarization', 'QUAC1', 'CaIM', 'TCTP', 'AtRAC1', 'SPHK12', 'Ca_ATPase',
    #'CPKa', 'CPKb', 'ABI2', 'Microtubule_Depolymerization', 'Ca', 'ABI1', 'NIA12', 'MPK', 'RCARs', 'VATPase', 'Vacuolar_Acidification', 'ROP11', 'RBOH', 'KEV',
    #'GHR1', 'SLAC1', 'WT']

    #use the following set of targets when running the simulation for the full model
    #targets = ['CPK321', 'H_ATPase', 'NOGC1', 'ABA', 'Microtubule_Depolymerization', 'Depolarization', 'InsP3', 'SPHK12', 'ABH1', 'InsP6', 'CIS', 'AnionEM',
    #'GAPC12', 'K_efflux', 'H2O_Efflux', 'VPPase', 'PP2CA', 'MRP5', 'CPK23', 'Vacuolar_Acidification', 'DAG', 'ROP11', 'NO', 'pHc', 'PIP', 'PEPC', 'nitrocGMP',
    #'HAB1', 'DAGK', 'PLDdel', 'PC', 'CPK6', 'PA', 'PLDa', 'PLC', 'PI3P5K', 'ROS', 'AtRAC1', 'OST1', 'cGMP', 'Ca2_ATPase', 'GCR1', 'RCN1', 'QUAC1', 'S1P',
    #'Malate', 'KOUT', 'NADPH', 'MPK912', 'KEV', 'SCAB1', 'CaIM', 'TCTP', 'VATPase', 'GPA1', 'PtdIns35P2', 'GTP', 'GEF', 'ARP_Complex', 'PtdInsP4', 'Sph',
    #'ABI1', 'NIA12', 'ADPRc', 'RCARs', 'PtdInsP3', 'Nitrite', 'ABI2', 'SPP1', 'RBOH', 'Actin_Reorganization', 'ERA1', 'NtSyp121', 'Ca2', 'GHR1', 'cADPR',
    #'SLAH3', 'SLAC1', 'WT', 'PtdIns45P2']

    for target in targets:
        print 'Processing target', target
        if knockouts is True:
            mtext = boolean2.modify_states(text=text, turnoff=target)
            fname = 'results_KO.json'
        else:
            mtext = boolean2.modify_states(text=text, turnon=target)
            fname = 'results_CA.json'
        model = boolean2.Model(mode='async', text=mtext)
        coll = util.Collector()
        for i in xrange(repeat):
            model.initialize(missing=util.randbool)
            model.iterate(steps=steps)
            coll.collect(states=model.states, nodes='Closure')
        data[target] = {'Timesteps': coll.get_averages(normalize=True)}
        data[target]['Closure AUC'] = sum(data[target]['Timesteps']['Closure'])
    with open(fname, 'w') as fp:
        json.dump(data, fp)
Example #3
0
def ics(proteins, ko, oe):
    # input proteins and k/o and o/e arrays
    ics = []
    off = []
    on = []
    for i in range(len(ko)):
        off.append(ko[i])
    for j in range(len(oe)):
        on.append(oe[j])
    text_new = boolean2.modify_states(text = text, turnoff = off, turnon = on)
    return text_new
Example #4
0
def get_sim_avgs(bn_str, nsim=100, nsteps=20, off=None, on=None):
    if off is None:
        off_nodes = []
    else:
        off_nodes = off
    if on is None:
        on_nodes = []
    else:
        on_nodes = on
    coll = boolean2.util.Collector()
    bn_str = boolean2.modify_states(bn_str, turnon=on, turnoff=off)
    model = boolean2.Model(text=bn_str, mode='async')
    for i in range(nsim):
        model.initialize()
        model.iterate(steps=nsteps)
        coll.collect(states=model.states, nodes=model.nodes)
    avgs = coll.get_averages(normalize=True)
    return avgs
Example #5
0
def get_sim_avgs(bn_str, nsim=100, nsteps=20, off=None, on=None):
    if off is None:
        off_nodes = []
    else:
        off_nodes = off
    if on is None:
        on_nodes = []
    else:
        on_nodes = on
    coll = boolean2.util.Collector()
    bn_str = boolean2.modify_states(bn_str, turnon=on, turnoff=off)
    model = boolean2.Model(text=bn_str, mode='async')
    for i in range(nsim):
        model.initialize()
        model.iterate(steps=nsteps)
        coll.collect(states=model.states, nodes=model.nodes)
    avgs = coll.get_averages(normalize=True)
    return avgs
Example #6
0
def run_mutations(text, repeat, steps):
    "Runs the asynchronous model with different mutations"

    # WT does not exist so it won't affect anything

    data = {}
    knockouts = 'WT S1P PA pHc ABI1 ROS'.split()
    for target in knockouts:
        print('- target %s' % target)
        mtext = boolean2.modify_states(text=text, turnoff=target)
        model = Model(mode='async', text=mtext)
        coll = util.Collector()
        for i in range(repeat):
            # unintialized nodes set to random
            model.initialize(missing=util.randbool)
            model.iterate(steps=steps)
            coll.collect(states=model.states, nodes=model.nodes)
        data[target] = coll.get_averages(normalize=True)

    return data
Example #7
0
def run_mutations( text, repeat, steps ):
    "Runs the asynchronous model with different mutations"

    # WT does not exist so it won't affect anything
    
    data = {}
    knockouts = 'WT S1P PA pHc ABI1 ROS'.split()
    for target in knockouts:
        print '- target %s' % target
        mtext  = boolean2.modify_states( text=text, turnoff=target )
        model = Model( mode='async', text=mtext )
        coll   = util.Collector()
        for i in xrange( repeat ):
            # unintialized nodes set to random
            model.initialize( missing=util.randbool )
            model.iterate( steps=steps )
            coll.collect( states=model.states, nodes=model.nodes )
        data[target] = coll.get_averages( normalize=True )

    return data
Example #8
0
    # this collects the state of all nodes
    NODES = boolean2.all_nodes(text)

    #
    # raise this for better curves (will take about 2 seconds per repeat)
    # plots were made for REPEAT = 1000, STEPS=150
    #
    REPEAT = 1000
    STEPS = 150

    data = []

    print '- starting simulation with REPEAT=%s, STEPS=%s' % (REPEAT, STEPS)

    # multiple overexrpessed nodes
    mtext = boolean2.modify_states(text=text, turnon=['CREB1'])
    avgs = run(text=mtext, repeat=REPEAT, nodes=NODES, steps=STEPS)
    data.append(avgs)

    mtext = boolean2.modify_states(text=text, turnon=['CCND1'])
    avgs = run(text=mtext, repeat=REPEAT, nodes=NODES, steps=STEPS)
    data.append(avgs)

    mtext = boolean2.modify_states(text=text, turnon=['KLF4'])
    avgs = run(text=mtext, repeat=REPEAT, nodes=NODES, steps=STEPS)
    data.append(avgs)

    mtext = boolean2.modify_states(text=text, turnon=['SMAD2'])
    avgs = run(text=mtext, repeat=REPEAT, nodes=NODES, steps=STEPS)
    data.append(avgs)
Example #9
0
    # this collects the state of all nodes
    NODES = boolean2.all_nodes(text)

    #
    # raise this for better curves (will take about 2 seconds per repeat)
    # plots were made for REPEAT = 1000, STEPS=150
    #
    REPEAT = 10
    STEPS = 50

    data = []

    print('- starting simulation with REPEAT=%s, STEPS=%s' % (REPEAT, STEPS))

    # a single overexpressed node
    mtext = boolean2.modify_states(text=text, turnon=['Stimuli'])
    avgs = run(text=mtext, repeat=REPEAT, nodes=NODES, steps=STEPS)
    data.append(avgs)

    # multiple overexrpessed nodes
    mtext = boolean2.modify_states(text=text, turnon=['Stimuli', 'Mcl1'])
    avgs = run(text=mtext, repeat=REPEAT, nodes=NODES, steps=STEPS)
    data.append(avgs)

    mtext = boolean2.modify_states(text=text, turnon=['Stimuli', 'sFas'])
    avgs = run(text=mtext, repeat=REPEAT, nodes=NODES, steps=STEPS)
    data.append(avgs)

    mtext = boolean2.modify_states(text=text,
                                   turnon=['Stimuli', 'Mcl1', 'sFas'])
    avgs = run(text=mtext, repeat=REPEAT, nodes=NODES, steps=STEPS)
Example #10
0
    # this collects the state of all nodes
    NODES = boolean2.all_nodes(text)

    #
    # raise this for better curves (will take about 2 seconds per repeat)
    # plots were made for REPEAT = 1000, STEPS=150
    #
    REPEAT = 1000
    STEPS = 150

    data = []

    print '- starting simulation with REPEAT=%s, STEPS=%s' % (REPEAT, STEPS)

    # multiple overexrpessed nodes
    mtext = boolean2.modify_states(text=text, turnon=['ACTB'])
    avgs = run(text=mtext, repeat=REPEAT, nodes=NODES, steps=STEPS)
    data.append(avgs)

    mtext = boolean2.modify_states(text=text, turnon=['AKT1'])
    avgs = run(text=mtext, repeat=REPEAT, nodes=NODES, steps=STEPS)
    data.append(avgs)

    mtext = boolean2.modify_states(text=text, turnon=['DISC1'])
    avgs = run(text=mtext, repeat=REPEAT, nodes=NODES, steps=STEPS)
    data.append(avgs)

    mtext = boolean2.modify_states(text=text, turnon=['CCDC88A'])
    avgs = run(text=mtext, repeat=REPEAT, nodes=NODES, steps=STEPS)
    data.append(avgs)
Example #11
0
# parameters for compartment ratios and fluctuations
COMP_PARAMS = helper.read_parameters( 'Bb-compartmental.csv' )

# use data from the sixth row (it is zero based counting!) in the file
CONC = CONC_PARAMS[5]
COMP = COMP_PARAMS[5]

# helper function that Binds the local override to active COMP parameter
def local_override( node, indexer, tokens ):
    return overrides.override( node, indexer, tokens, COMP )

#
# there will be two models, one for WT and the other for a BC knockout
#
wt_text = file('Bb.txt').read()
bc_text = boolean2.modify_states( text=wt_text, turnoff= [ "BC"  ] )

model1 = Model( text=wt_text, mode='plde' )
model2 = Model( text=bc_text, mode='plde' )

model1.OVERRIDE = local_override
model2.OVERRIDE = local_override

model1.initialize( missing = helper.initializer( CONC )  )
model2.initialize( missing = helper.initializer( CONC )  )

# see localdefs for all function definitions
model1.iterate( fullt=FULLT, steps=STEPS, localdefs='localdefs' )
model2.iterate( fullt=FULLT, steps=STEPS, localdefs='localdefs' )

# saves the simulation resutls into a file
Example #12
0
#
# these nodes will be overexpressed (initialized to True)
#
on  = []

#
# these nodes will be set to false and their corresponding updating 
# rules will be  removed
#
off = ["B"]

#
# this modifies the original states to apply to overexpressed and knockouts
#
text = boolean2.modify_states(text, turnon=on, turnoff=off)

#
# see tutorial 3 for more details on what happens below
#

seen = {}

for i in range(10):
    model = boolean2.Model(text, mode='sync')
    model.initialize()
    model.iterate( steps=20 )

    size, index = model.detect_cycles() 
    
    # fingerprint of the first state
Example #13
0
    # this collects the state of all nodes
    NODES = boolean2.all_nodes(text)

    #
    # raise this for better curves (will take about 2 seconds per repeat)
    # plots were made for REPEAT = 1000, STEPS=150
    #
    REPEAT = 1000
    STEPS = 150

    data = []

    print '- starting simulation with REPEAT=%s, STEPS=%s' % (REPEAT, STEPS)

    # multiple overexrpessed nodes
    mtext = boolean2.modify_states(text=text, turnon=['miR320a'])
    avgs = run(text=mtext, repeat=REPEAT, nodes=NODES, steps=STEPS)
    data.append(avgs)

    mtext = boolean2.modify_states(text=text, turnon=['miR223'])
    avgs = run(text=mtext, repeat=REPEAT, nodes=NODES, steps=STEPS)
    data.append(avgs)

    mtext = boolean2.modify_states(text=text, turnon=['miR155'])
    avgs = run(text=mtext, repeat=REPEAT, nodes=NODES, steps=STEPS)
    data.append(avgs)

    mtext = boolean2.modify_states(text=text, turnon=['miR106a'])
    avgs = run(text=mtext, repeat=REPEAT, nodes=NODES, steps=STEPS)
    data.append(avgs)
Example #14
0
#
# these nodes will be overexpressed (initialized to True)
#
on  = []

#
# these nodes will be set to false and their corresponding updating 
# rules will be  removed
#
off = ["B"]

#
# this modifies the original states to apply to overexpressed and knockouts
#
text = boolean2.modify_states(text, turnon=on, turnoff=off)

#
# see tutorial 3 for more details on what happens below
#

seen = {}

for i in range(10):
    model = boolean2.Model( text, mode='sync')
    model.initialize()
    model.iterate( steps=20 )

    size, index = model.detect_cycles() 
    
    # fingerprint of the first state
Example #15
0
    # this collects the state of all nodes 
    NODES  = boolean2.all_nodes( text )

    #
    # raise this for better curves (will take about 2 seconds per repeat)
    # plots were made for REPEAT = 1000, STEPS=150
    #
    REPEAT = 1000
    STEPS  = 150

    data = []
    
    print '- starting simulation with REPEAT=%s, STEPS=%s' % (REPEAT, STEPS)

    # multiple overexrpessed nodes
    mtext = boolean2.modify_states( text=text, turnon=['miR188'] )
    avgs = run( text=mtext, repeat=REPEAT, nodes=NODES, steps=STEPS) 
    data.append( avgs )

    mtext = boolean2.modify_states( text=text, turnon=['miR143'] )
    avgs = run( text=mtext, repeat=REPEAT, nodes=NODES, steps=STEPS) 
    data.append( avgs )

    mtext = boolean2.modify_states( text=text, turnon=['miR423'] )
    avgs = run( text=mtext, repeat=REPEAT, nodes=NODES, steps=STEPS) 
    data.append( avgs )
  
    mtext = boolean2.modify_states( text=text, turnon=['miR223'] )
    avgs = run( text=mtext, repeat=REPEAT, nodes=NODES, steps=STEPS) 
    data.append( avgs )
Example #16
0
# use data from the sixth row (it is zero based counting!) in the file
CONC = CONC_PARAMS[5]
COMP = COMP_PARAMS[5]


# helper function that Binds the local override to active COMP parameter
def local_override(node, indexer, tokens):
    return overrides.override(node, indexer, tokens, COMP)


#
# there will be two models, one for WT and the other for a BC knockout
#
wt_text = file('Bb.txt').read()
bc_text = boolean2.modify_states(text=wt_text, turnoff=["BC"])

model1 = Model(text=wt_text, mode='plde')
model2 = Model(text=bc_text, mode='plde')

model1.OVERRIDE = local_override
model2.OVERRIDE = local_override

model1.initialize(missing=helper.initializer(CONC))
model2.initialize(missing=helper.initializer(CONC))

# see localdefs for all function definitions
model1.iterate(fullt=FULLT, steps=STEPS, localdefs='localdefs')
model2.iterate(fullt=FULLT, steps=STEPS, localdefs='localdefs')

# saves the simulation resutls into a file
Example #17
0
    # this collects the state of all nodes 
    NODES  = boolean2.all_nodes( text )

    #
    # raise this for better curves (will take about 2 seconds per repeat)
    # plots were made for REPEAT = 1000, STEPS=150
    #
    REPEAT = 1000
    STEPS  = 150

    data = []
    
    print '- starting simulation with REPEAT=%s, STEPS=%s' % (REPEAT, STEPS)

    # multiple overexrpessed nodes
    mtext = boolean2.modify_states( text=text, turnon=['miR130a'] )
    avgs = run( text=mtext, repeat=REPEAT, nodes=NODES, steps=STEPS) 
    data.append( avgs )

    mtext = boolean2.modify_states( text=text, turnon=['miR125b'] )
    avgs = run( text=mtext, repeat=REPEAT, nodes=NODES, steps=STEPS) 
    data.append( avgs )

    mtext = boolean2.modify_states( text=text, turnon=['miR20b'] )
    avgs = run( text=mtext, repeat=REPEAT, nodes=NODES, steps=STEPS) 
    data.append( avgs )

    mtext = boolean2.modify_states( text=text, turnon=['miR20a'] )
    avgs = run( text=mtext, repeat=REPEAT, nodes=NODES, steps=STEPS) 
    data.append( avgs )
Example #18
0
    # this collects the state of all nodes 
    NODES  = boolean2.all_nodes( text )

    #
    # raise this for better curves (will take about 2 seconds per repeat)
    # plots were made for REPEAT = 1000, STEPS=150
    #
    REPEAT = 10
    STEPS  = 50

    data = []
    
    print '- starting simulation with REPEAT=%s, STEPS=%s' % (REPEAT, STEPS)

    # a single overexpressed node
    mtext = boolean2.modify_states( text=text, turnon=['Stimuli'] )
    avgs = run( text=mtext, repeat=REPEAT, nodes=NODES, steps=STEPS) 
    data.append( avgs )

    # multiple overexrpessed nodes
    mtext = boolean2.modify_states( text=text, turnon=['Stimuli','Mcl1'] )
    avgs = run( text=mtext, repeat=REPEAT, nodes=NODES, steps=STEPS) 
    data.append( avgs )

    mtext = boolean2.modify_states( text=text, turnon=['Stimuli','sFas'] )
    avgs = run( text=mtext, repeat=REPEAT, nodes=NODES, steps=STEPS) 
    data.append( avgs )

    mtext = boolean2.modify_states( text=text, turnon=['Stimuli','Mcl1','sFas'] )
    avgs = run( text=mtext, repeat=REPEAT, nodes=NODES, steps=STEPS) 
    data.append( avgs )
Example #19
0
    # this collects the state of all nodes
    NODES = boolean2.all_nodes(text)

    #
    # raise this for better curves (will take about 2 seconds per repeat)
    # plots were made for REPEAT = 1000, STEPS=150
    #
    REPEAT = 1000
    STEPS = 150

    data = []

    print '- starting simulation with REPEAT=%s, STEPS=%s' % (REPEAT, STEPS)

    # multiple overexrpessed nodes
    mtext = boolean2.modify_states(text=text, turnon=['APP'])
    avgs = run(text=mtext, repeat=REPEAT, nodes=NODES, steps=STEPS)
    data.append(avgs)

    mtext = boolean2.modify_states(text=text, turnon=['DAB1'])
    avgs = run(text=mtext, repeat=REPEAT, nodes=NODES, steps=STEPS)
    data.append(avgs)

    mtext = boolean2.modify_states(text=text, turnon=['DISC1'])
    avgs = run(text=mtext, repeat=REPEAT, nodes=NODES, steps=STEPS)
    data.append(avgs)

    mtext = boolean2.modify_states(text=text, turnon=['NDEL1'])
    avgs = run(text=mtext, repeat=REPEAT, nodes=NODES, steps=STEPS)
    data.append(avgs)
Example #20
0
    # this collects the state of all nodes
    NODES = boolean2.all_nodes(text)

    #
    # raise this for better curves (will take about 2 seconds per repeat)
    # plots were made for REPEAT = 1000, STEPS=150
    #
    REPEAT = 1000
    STEPS = 150

    data = []

    print '- starting simulation with REPEAT=%s, STEPS=%s' % (REPEAT, STEPS)

    # multiple overexrpessed nodes
    mtext = boolean2.modify_states(text=text, turnon=['CDK5'])
    avgs = run(text=mtext, repeat=REPEAT, nodes=NODES, steps=STEPS)
    data.append(avgs)

    mtext = boolean2.modify_states(text=text, turnon=['DIXDC1'])
    avgs = run(text=mtext, repeat=REPEAT, nodes=NODES, steps=STEPS)
    data.append(avgs)

    mtext = boolean2.modify_states(text=text, turnon=['DISC1'])
    avgs = run(text=mtext, repeat=REPEAT, nodes=NODES, steps=STEPS)
    data.append(avgs)

    mtext = boolean2.modify_states(text=text, turnon=['NDEL1'])
    avgs = run(text=mtext, repeat=REPEAT, nodes=NODES, steps=STEPS)
    data.append(avgs)
Example #21
0
    # this collects the state of all nodes
    NODES = boolean2.all_nodes(text)

    #
    # raise this for better curves (will take about 2 seconds per repeat)
    # plots were made for REPEAT = 1000, STEPS=150
    #
    REPEAT = 1000
    STEPS = 150

    data = []

    print '- starting simulation with REPEAT=%s, STEPS=%s' % (REPEAT, STEPS)

    # multiple overexrpessed nodes
    mtext = boolean2.modify_states(text=text, turnon=['RXR'])
    avgs = run(text=mtext, repeat=REPEAT, nodes=NODES, steps=STEPS)
    data.append(avgs)

    mtext = boolean2.modify_states(text=text, turnon=['CCND1'])
    avgs = run(text=mtext, repeat=REPEAT, nodes=NODES, steps=STEPS)
    data.append(avgs)

    mtext = boolean2.modify_states(text=text, turnon=['POU5F1'])
    avgs = run(text=mtext, repeat=REPEAT, nodes=NODES, steps=STEPS)
    data.append(avgs)

    mtext = boolean2.modify_states(text=text, turnon=['TCF3'])
    avgs = run(text=mtext, repeat=REPEAT, nodes=NODES, steps=STEPS)
    data.append(avgs)
Example #22
0
    # this collects the state of all nodes
    NODES = boolean2.all_nodes(text)

    #
    # raise this for better curves (will take about 2 seconds per repeat)
    # plots were made for REPEAT = 1000, STEPS=150
    #
    REPEAT = 1000
    STEPS = 150

    data = []

    print '- starting simulation with REPEAT=%s, STEPS=%s' % (REPEAT, STEPS)

    # multiple overexrpessed nodes
    mtext = boolean2.modify_states(text=text, turnon=['miR143'])
    avgs = run(text=mtext, repeat=REPEAT, nodes=NODES, steps=STEPS)
    data.append(avgs)

    mtext = boolean2.modify_states(text=text, turnon=['miR106a'])
    avgs = run(text=mtext, repeat=REPEAT, nodes=NODES, steps=STEPS)
    data.append(avgs)

    mtext = boolean2.modify_states(text=text, turnon=['miR130a'])
    avgs = run(text=mtext, repeat=REPEAT, nodes=NODES, steps=STEPS)
    data.append(avgs)

    mtext = boolean2.modify_states(text=text, turnon=['miR125b'])
    avgs = run(text=mtext, repeat=REPEAT, nodes=NODES, steps=STEPS)
    data.append(avgs)
Example #23
0
    # this collects the state of all nodes 
    NODES  = boolean2.all_nodes( text )

    #
    # raise this for better curves (will take about 2 seconds per repeat)
    # plots were made for REPEAT = 1000, STEPS=150
    #
    REPEAT = 1000
    STEPS  = 150

    data = []
    
    print '- starting simulation with REPEAT=%s, STEPS=%s' % (REPEAT, STEPS)

    # multiple overexrpessed nodes
    mtext = boolean2.modify_states( text=text, turnon=['ZNF365'] )
    avgs = run( text=mtext, repeat=REPEAT, nodes=NODES, steps=STEPS) 
    data.append( avgs )

    mtext = boolean2.modify_states( text=text, turnon=['GSK3B'] )
    avgs = run( text=mtext, repeat=REPEAT, nodes=NODES, steps=STEPS) 
    data.append( avgs )

    mtext = boolean2.modify_states( text=text, turnon=['DISC1'] )
    avgs = run( text=mtext, repeat=REPEAT, nodes=NODES, steps=STEPS) 
    data.append( avgs )
  
    mtext = boolean2.modify_states( text=text, turnon=['NDEL1'] )
    avgs = run( text=mtext, repeat=REPEAT, nodes=NODES, steps=STEPS) 
    data.append( avgs )
Example #24
0
    # this collects the state of all nodes
    NODES = boolean2.all_nodes(text)

    #
    # raise this for better curves (will take about 2 seconds per repeat)
    # plots were made for REPEAT = 1000, STEPS=150
    #
    REPEAT = 1000
    STEPS = 150

    data = []

    print '- starting simulation with REPEAT=%s, STEPS=%s' % (REPEAT, STEPS)

    # multiple overexrpessed nodes
    mtext = boolean2.modify_states(text=text, turnon=['CCND1'])
    avgs = run(text=mtext, repeat=REPEAT, nodes=NODES, steps=STEPS)
    data.append(avgs)

    mtext = boolean2.modify_states(text=text, turnon=['CREB1'])
    avgs = run(text=mtext, repeat=REPEAT, nodes=NODES, steps=STEPS)
    data.append(avgs)

    mtext = boolean2.modify_states(text=text, turnon=['KLF4'])
    avgs = run(text=mtext, repeat=REPEAT, nodes=NODES, steps=STEPS)
    data.append(avgs)

    mtext = boolean2.modify_states(text=text, turnon=['TCF3'])
    avgs = run(text=mtext, repeat=REPEAT, nodes=NODES, steps=STEPS)
    data.append(avgs)
Example #25
0
    # this collects the state of all nodes
    NODES = boolean2.all_nodes(text)

    #
    # raise this for better curves (will take about 2 seconds per repeat)
    # plots were made for REPEAT = 1000, STEPS=150
    #
    REPEAT = 1000
    STEPS = 150

    data = []

    print '- starting simulation with REPEAT=%s, STEPS=%s' % (REPEAT, STEPS)

    # multiple overexrpessed nodes
    mtext = boolean2.modify_states(text=text, turnon=['miR33b'])
    avgs = run(text=mtext, repeat=REPEAT, nodes=NODES, steps=STEPS)
    data.append(avgs)

    mtext = boolean2.modify_states(text=text, turnon=['miR103a'])
    avgs = run(text=mtext, repeat=REPEAT, nodes=NODES, steps=STEPS)
    data.append(avgs)

    mtext = boolean2.modify_states(text=text, turnoff=['miR33b'])
    avgs = run(text=mtext, repeat=REPEAT, nodes=NODES, steps=STEPS)
    data.append(avgs)

    mtext = boolean2.modify_states(text=text, turnoff=['miR103a'])
    avgs = run(text=mtext, repeat=REPEAT, nodes=NODES, steps=STEPS)
    data.append(avgs)
Example #26
0
    # this collects the state of all nodes
    NODES = boolean2.all_nodes(text)

    #
    # raise this for better curves (will take about 2 seconds per repeat)
    # plots were made for REPEAT = 1000, STEPS=150
    #
    REPEAT = 1000
    STEPS = 150

    data = []

    print '- starting simulation with REPEAT=%s, STEPS=%s' % (REPEAT, STEPS)

    # multiple overexrpessed nodes
    mtext = boolean2.modify_states(text=text, turnon=['PCM1'])
    avgs = run(text=mtext, repeat=REPEAT, nodes=NODES, steps=STEPS)
    data.append(avgs)

    mtext = boolean2.modify_states(text=text, turnon=['BBS4'])
    avgs = run(text=mtext, repeat=REPEAT, nodes=NODES, steps=STEPS)
    data.append(avgs)

    mtext = boolean2.modify_states(text=text, turnon=['DISC1'])
    avgs = run(text=mtext, repeat=REPEAT, nodes=NODES, steps=STEPS)
    data.append(avgs)

    mtext = boolean2.modify_states(text=text, turnoff=['PCM1'])
    avgs = run(text=mtext, repeat=REPEAT, nodes=NODES, steps=STEPS)
    data.append(avgs)
Example #27
0
    # this collects the state of all nodes
    NODES = boolean2.all_nodes(text)

    #
    # raise this for better curves (will take about 2 seconds per repeat)
    # plots were made for REPEAT = 1000, STEPS=150
    #
    REPEAT = 1000
    STEPS = 150

    data = []

    print '- starting simulation with REPEAT=%s, STEPS=%s' % (REPEAT, STEPS)

    # multiple overexrpessed nodes
    mtext = boolean2.modify_states(text=text, turnon=['CCND1'])
    avgs = run(text=mtext, repeat=REPEAT, nodes=NODES, steps=STEPS)
    data.append(avgs)

    mtext = boolean2.modify_states(text=text, turnon=['CREB1'])
    avgs = run(text=mtext, repeat=REPEAT, nodes=NODES, steps=STEPS)
    data.append(avgs)

    mtext = boolean2.modify_states(text=text, turnon=['POU5F1'])
    avgs = run(text=mtext, repeat=REPEAT, nodes=NODES, steps=STEPS)
    data.append(avgs)

    mtext = boolean2.modify_states(text=text, turnoff=['CCND1'])
    avgs = run(text=mtext, repeat=REPEAT, nodes=NODES, steps=STEPS)
    data.append(avgs)
Example #28
0
    # this collects the state of all nodes
    NODES = boolean2.all_nodes(text)

    #
    # raise this for better curves (will take about 2 seconds per repeat)
    # plots were made for REPEAT = 1000, STEPS=150
    #
    REPEAT = 1000
    STEPS = 150

    data = []

    print '- starting simulation with REPEAT=%s, STEPS=%s' % (REPEAT, STEPS)

    # multiple overexrpessed nodes
    mtext = boolean2.modify_states(text=text, turnon=['RXR'])
    avgs = run(text=mtext, repeat=REPEAT, nodes=NODES, steps=STEPS)
    data.append(avgs)

    mtext = boolean2.modify_states(text=text, turnon=['TAL1'])
    avgs = run(text=mtext, repeat=REPEAT, nodes=NODES, steps=STEPS)
    data.append(avgs)

    mtext = boolean2.modify_states(text=text, turnon=['TCF3'])
    avgs = run(text=mtext, repeat=REPEAT, nodes=NODES, steps=STEPS)
    data.append(avgs)

    mtext = boolean2.modify_states(text=text, turnon=['STAT3'])
    avgs = run(text=mtext, repeat=REPEAT, nodes=NODES, steps=STEPS)
    data.append(avgs)
Example #29
0
                                        2: i *= n and (dext or jext)
                                        2: n *= i 
                                        2: j *= i and not (j and next) or jagged_oe and jagged_ko
                                        2: v *= vr and vext 
                                        2: d *= v or not i and not (d and next)
                                        2: vr *= v or not i
                                        
                                        3: tip *= d and vr and not i and not n and not j
                                        3: stalk *= i and n and j and not vr and not d
                                        3: tip_stalk *= d and vr and i and n and j
                                        3: hybrid *= not (tip or stalk or tip_stalk)
                                        """.format(n0, d0, j0, i0, vr0, v0, dext0, jext0, vext0, next0)
                                        model = Model(text = text_ics, mode = 'sync')
                                        on = ['jagged_oe', 'j']
                                        off = ['jagged_ko', 'j']
                                        text_mod = boolean2.modify_states(text = text_ics, turnon = on)
                                        model_jag_oe = Model(text = text_mod, mode = 'sync')
                                        text_mod2 = boolean2.modify_states(text = text_ics, turnoff = off)
                                        model_jag_ko = Model(text = text_mod2, mode = 'sync')
                                        model.initialize()
                                        model_jag_oe.initialize()
                                        model_jag_ko.initialize()
                                        model.iterate(steps = 20)
                                        model_jag_oe.iterate(steps = 20)
                                        model_jag_ko.iterate(steps = 20)

                                        n = model.data['n']
                                        d = model.data['d']
                                        j = model.data['j']
                                        i = model.data['i']
                                        vr = model.data['vr']
Example #30
0
    # this collects the state of all nodes 
    NODES  = boolean2.all_nodes( text )

    #
    # raise this for better curves (will take about 2 seconds per repeat)
    # plots were made for REPEAT = 1000, STEPS=150
    #
    REPEAT = 1000
    STEPS  = 150

    data = []
    
    print '- starting simulation with REPEAT=%s, STEPS=%s' % (REPEAT, STEPS)

    # multiple overexrpessed nodes
    mtext = boolean2.modify_states( text=text, turnon=['SMAD2'] )
    avgs = run( text=mtext, repeat=REPEAT, nodes=NODES, steps=STEPS) 
    data.append( avgs )

    mtext = boolean2.modify_states( text=text, turnon=['SMAD3'] )
    avgs = run( text=mtext, repeat=REPEAT, nodes=NODES, steps=STEPS) 
    data.append( avgs )

    mtext = boolean2.modify_states( text=text, turnon=['POU5F1'] )
    avgs = run( text=mtext, repeat=REPEAT, nodes=NODES, steps=STEPS) 
    data.append( avgs )
  
    mtext = boolean2.modify_states( text=text, turnon=['STAT3'] )
    avgs = run( text=mtext, repeat=REPEAT, nodes=NODES, steps=STEPS) 
    data.append( avgs )
Example #31
0
    # this collects the state of all nodes
    NODES = boolean2.all_nodes(text)

    #
    # raise this for better curves (will take about 2 seconds per repeat)
    # plots were made for REPEAT = 1000, STEPS=150
    #
    REPEAT = 1000
    STEPS = 150

    data = []

    print '- starting simulation with REPEAT=%s, STEPS=%s' % (REPEAT, STEPS)

    # multiple overexrpessed nodes
    mtext = boolean2.modify_states(text=text, turnon=['DISC1'])
    avgs = run(text=mtext, repeat=REPEAT, nodes=NODES, steps=STEPS)
    data.append(avgs)

    mtext = boolean2.modify_states(text=text, turnon=['SOX10'])
    avgs = run(text=mtext, repeat=REPEAT, nodes=NODES, steps=STEPS)
    data.append(avgs)

    mtext = boolean2.modify_states(text=text, turnon=['FOXD3'])
    avgs = run(text=mtext, repeat=REPEAT, nodes=NODES, steps=STEPS)
    data.append(avgs)

    mtext = boolean2.modify_states(text=text, turnoff=['DISC1'])
    avgs = run(text=mtext, repeat=REPEAT, nodes=NODES, steps=STEPS)
    data.append(avgs)
Example #32
0
    # this collects the state of all nodes
    NODES = boolean2.all_nodes(text)

    #
    # raise this for better curves (will take about 2 seconds per repeat)
    # plots were made for REPEAT = 1000, STEPS=150
    #
    REPEAT = 1000
    STEPS = 150

    data = []

    print '- starting simulation with REPEAT=%s, STEPS=%s' % (REPEAT, STEPS)

    # multiple overexrpessed nodes
    mtext = boolean2.modify_states(text=text, turnon=['TAL1'])
    avgs = run(text=mtext, repeat=REPEAT, nodes=NODES, steps=STEPS)
    data.append(avgs)

    mtext = boolean2.modify_states(text=text, turnon=['TCF3'])
    avgs = run(text=mtext, repeat=REPEAT, nodes=NODES, steps=STEPS)
    data.append(avgs)

    mtext = boolean2.modify_states(text=text, turnon=['STAT3'])
    avgs = run(text=mtext, repeat=REPEAT, nodes=NODES, steps=STEPS)
    data.append(avgs)

    mtext = boolean2.modify_states(text=text, turnon=['CREB1'])
    avgs = run(text=mtext, repeat=REPEAT, nodes=NODES, steps=STEPS)
    data.append(avgs)
Example #33
0
    # this collects the state of all nodes
    NODES = boolean2.all_nodes(text)

    #
    # raise this for better curves (will take about 2 seconds per repeat)
    # plots were made for REPEAT = 1000, STEPS=150
    #
    REPEAT = 1000
    STEPS = 150

    data = []

    print '- starting simulation with REPEAT=%s, STEPS=%s' % (REPEAT, STEPS)

    # multiple overexrpessed nodes
    mtext = boolean2.modify_states(text=text, turnon=['miR155'])
    avgs = run(text=mtext, repeat=REPEAT, nodes=NODES, steps=STEPS)
    data.append(avgs)

    mtext = boolean2.modify_states(text=text, turnon=['miR103a'])
    avgs = run(text=mtext, repeat=REPEAT, nodes=NODES, steps=STEPS)
    data.append(avgs)

    mtext = boolean2.modify_states(text=text, turnon=['miR20a'])
    avgs = run(text=mtext, repeat=REPEAT, nodes=NODES, steps=STEPS)
    data.append(avgs)

    mtext = boolean2.modify_states(text=text, turnon=['miR10b'])
    avgs = run(text=mtext, repeat=REPEAT, nodes=NODES, steps=STEPS)
    data.append(avgs)
Example #34
0
    # this collects the state of all nodes
    NODES = boolean2.all_nodes(text)

    #
    # raise this for better curves (will take about 2 seconds per repeat)
    # plots were made for REPEAT = 1000, STEPS=150
    #
    REPEAT = 1000
    STEPS = 150

    data = []

    print '- starting simulation with REPEAT=%s, STEPS=%s' % (REPEAT, STEPS)

    # multiple overexrpessed nodes
    mtext = boolean2.modify_states(text=text, turnon=['RHEB'])
    avgs = run(text=mtext, repeat=REPEAT, nodes=NODES, steps=STEPS)
    data.append(avgs)

    mtext = boolean2.modify_states(text=text, turnon=['DISC1'])
    avgs = run(text=mtext, repeat=REPEAT, nodes=NODES, steps=STEPS)
    data.append(avgs)

    mtext = boolean2.modify_states(text=text, turnoff=['RHEB'])
    avgs = run(text=mtext, repeat=REPEAT, nodes=NODES, steps=STEPS)
    data.append(avgs)

    mtext = boolean2.modify_states(text=text, turnoff=['DISC1'])
    avgs = run(text=mtext, repeat=REPEAT, nodes=NODES, steps=STEPS)
    data.append(avgs)
Example #35
0
    # this collects the state of all nodes
    NODES = boolean2.all_nodes(text)

    #
    # raise this for better curves (will take about 2 seconds per repeat)
    # plots were made for REPEAT = 1000, STEPS=150
    #
    REPEAT = 1000
    STEPS = 150

    data = []

    print '- starting simulation with REPEAT=%s, STEPS=%s' % (REPEAT, STEPS)

    # multiple overexrpessed nodes
    mtext = boolean2.modify_states(text=text, turnon=['miR125b'])
    avgs = run(text=mtext, repeat=REPEAT, nodes=NODES, steps=STEPS)
    data.append(avgs)

    mtext = boolean2.modify_states(text=text, turnon=['miR20b'])
    avgs = run(text=mtext, repeat=REPEAT, nodes=NODES, steps=STEPS)
    data.append(avgs)

    mtext = boolean2.modify_states(text=text, turnoff=['miR125b'])
    avgs = run(text=mtext, repeat=REPEAT, nodes=NODES, steps=STEPS)
    data.append(avgs)

    mtext = boolean2.modify_states(text=text, turnoff=['miR20b'])
    avgs = run(text=mtext, repeat=REPEAT, nodes=NODES, steps=STEPS)
    data.append(avgs)
model.initialize()

#model evolution 
model.iterate( steps=5 )
for state in model.states:
    print state

#Cycle detection
#size, index = model.detect_cycles()    
#print "Size =%s, Index %s" % (size, index)

model.report_cycles()


##State modification: specifying gene deletion(s) and observing the change in attractors
on = ["A", "B"]
off = ["C"]
new_text = boolean2.modify_states(text, turnon=on, turnoff=off) ##need to upload rules from a text file?


model = boolean2.Model(new_text, mode='sync')
model.initialize()

#model evolution 
model.iterate( steps=5 )
for state in model.states:
    print state

#Cycle detection- detecting attractors
model.report_cycles()