Пример #1
0
def main():
    """Simulate temperature dependent aggregation and disaggregation."""
    # Rates and Temperatures
    k1 = 0.01  # disaggregation rate
    k2 = 0.1  # chaperone degradation rate
    k3 = 0.0001  # dimerization rate
    k4 = 0.05  # heat induced chaperone production rate
    k5 = 0.001  # heat inactivation rate of assembler
    # temp_fxn = [(20,315), (80,298)]
    temp_fxn = [(1, 298)]
    # Species
    A = Species("A", 100)
    AA = Species("AA", 0)
    iAA = Species("iAA", 0)
    C = Species("C", 10)
    # Temperature independent reactions
    disagg = MonomerReactivation("Disagg", [iAA, C], [A, C], None, k1)
    deg = UniDeg("C Degredation", [C], [None], None, k2)
    # Simulation and Temperature-Dependent Reaction
    nuc = Temp_Dimerization("Dimerization", [A], [AA], None, k3)
    hip = HeatInducedProduction("Heat Induced Production", [iAA], [C], None, k4)
    inactivation = HeatInducedInactivation("Inactivation", [AA], [iAA], None, k5)
    sp_list = [A, AA, iAA, C]
    rxn_list = [inactivation, disagg, hip, deg, nuc]
    system = Network(sp_list, rxn_list)
    x = system.simulate(0, 70, temp_fxn, "None")

    # x2 = [i[-1,0] for i in [x, y, z]]
    # y2 = [T1, T2, T1]
    colors = ["b", "g", "r", "c"]
    fig, axis = plt.subplots(figsize=(7, 7))
    for i in range(2, len(sp_list) + 2):
        axis.step(x[:, 0], x[:, i], label=sp_list[i - 2].name, c=colors[i - 2])
    plt.legend(loc=0)
    plt.xlim(0, x[-1, 0])
    plt.xlabel("Time")
    plt.ylabel("Molecular species count")
    # plt.ylim(0,500)
    # axis2 = axis.twinx()
    # axis2.step(x2,y2, c='darkgray')
    # plt.ylim(T1,T2)
    # plt.fill_between([x2[0], x2[1]], [220,220], alpha=0.5, color='darkgray')
    # plt.ylabel("Temperature (T)")
    # plt.savefig("reactivation_p1(wsqrt).pdf")
    plt.show()
    print np.mean(x[:, 1])
Пример #2
0
def main():
    """Simulate temperature dependent aggregation and disaggregation."""
    # Rates and Temperatures
    k1 = 0.01 #disaggregation rate
    k2 = 0.1 #chaperone degradation rate
    k3 = 0.0001 #dimerization rate
    k4 = 0.05 #heat induced chaperone production rate
    k5 = 0.001 #heat inactivation rate of assembler
    #temp_fxn = [(20,315), (80,298)]
    temp_fxn = [(1,298)]    
    # Species
    A = Species("A", 100)
    AA = Species("AA", 0)
    iAA = Species("iAA", 0)
    C = Species("C", 10)
    # Temperature independent reactions
    disagg = MonomerReactivation("Disagg", [iAA, C], [A, C], None, k1)
    deg = UniDeg("C Degredation", [C], [None], None, k2)
    # Simulation and Temperature-Dependent Reaction
    nuc = Temp_Dimerization("Dimerization", [A], [AA], None, k3)
    hip = HeatInducedProduction("Heat Induced Production", [iAA], [C], None, k4)
    inactivation = HeatInducedInactivation("Inactivation", [AA], [iAA], None, k5)
    sp_list = [A, AA, iAA, C]
    rxn_list= [inactivation, disagg, hip, deg, nuc]
    system = Network(sp_list, rxn_list)
    x = system.simulate(0, 70, temp_fxn, "None")
    
    #x2 = [i[-1,0] for i in [x, y, z]]
    #y2 = [T1, T2, T1]
    colors = ['b','g','r','c']
    fig, axis = plt.subplots(figsize=(7,7)) 
    for i in range(2,len(sp_list)+2):
        axis.step(x[:,0], x[:,i], label=sp_list[i-2].name, c=colors[i-2])
    plt.legend(loc=0)
    plt.xlim(0,x[-1,0])
    plt.xlabel("Time")
    plt.ylabel("Molecular species count")
    #plt.ylim(0,500)
    #axis2 = axis.twinx()
    #axis2.step(x2,y2, c='darkgray')
    #plt.ylim(T1,T2)
    #plt.fill_between([x2[0], x2[1]], [220,220], alpha=0.5, color='darkgray')
    #plt.ylabel("Temperature (T)")
    #plt.savefig("reactivation_p1(wsqrt).pdf")
    plt.show()
    print np.mean(x[:,1])
Пример #3
0
def main():
    """Generate and simulate a model of lemmings approaching and jumping off
    a cliff.
    
    Now with adjustable temperature!
    """
    # Input species and reactions
    L = Species("Lemming", 0)
    arrival = TConstInduction("Induction", None, [L], -1e-22, 0.1)
    jump = UniDeg("Degredation", [L], None, -1e-22, 0.1)
    temp_fxn = [(100,350), (150,298)]
    #temp_fxn = [(1,298)]
    cliff = Network([L], [arrival, jump])
    # Simulate and parse data    
    x = cliff.simulate(0, 200, temp_fxn, "dummy_file2.dat")
    y = x[:,2]    
    y1 = [x[i,2] for i in range(len(x)) if x[i,0] > 50 and x[i,0] < 100]
    y2 = [x[i,2] for i in range(len(x)) if x[i,0] > 100 and x[i,0] < 150]
    y3 = [x[i,2] for i in range(len(x)) if x[i,0] > 150]
    
    #print len(y1), len(y2), len(y3), len(x)
    #print "Mean1: %f, Mean1/Var1: %f" % (np.mean(y1), np.mean(y1)/np.var(y1))
    #print "Mean2: %f, Mean2/Var2: %f" % (np.mean(y2), np.mean(y2)/np.var(y2))
    #print "Mean3: %f, Mean3/Var3: %f" % (np.mean(y3), np.mean(y3)/np.var(y3))
    #plotting function -> plots temperature over timecourse w/ shared x axis    
    
    # Generate plots
    fig = plt.figure(figsize=(8, 8))
    gs = gridspec.GridSpec(2, 1, height_ratios=(1,3))
    axis1 = plt.subplot(gs[1])
    axis1.step(x[:,0], y)
    plt.xlabel("Time (s)")
    axis1.set_ylabel("Lemmings")
    axis0 = plt.subplot(gs[0], sharex=axis1)
    axis0.step(x[:,0],x[:,1], c='r')
    axis0.set_ylabel("Temperature")
    plt.setp(axis0.get_xticklabels(), visible=False)
    plt.tight_layout()
    plt.show()
Пример #4
0
def main():
    """Generate and simulate a model of lemmings approaching and jumping off
    a cliff.
    
    Now with adjustable temperature!
    """
    # Input species and reactions
    L = Species("Lemming", 0)
    arrival = TConstInduction("Induction", None, [L], -1e-22, 0.1)
    jump = UniDeg("Degredation", [L], None, -1e-22, 0.1)
    temp_fxn = [(100, 350), (150, 298)]
    #temp_fxn = [(1,298)]
    cliff = Network([L], [arrival, jump])
    # Simulate and parse data
    x = cliff.simulate(0, 200, temp_fxn, "dummy_file2.dat")
    y = x[:, 2]
    y1 = [x[i, 2] for i in range(len(x)) if x[i, 0] > 50 and x[i, 0] < 100]
    y2 = [x[i, 2] for i in range(len(x)) if x[i, 0] > 100 and x[i, 0] < 150]
    y3 = [x[i, 2] for i in range(len(x)) if x[i, 0] > 150]

    #print len(y1), len(y2), len(y3), len(x)
    #print "Mean1: %f, Mean1/Var1: %f" % (np.mean(y1), np.mean(y1)/np.var(y1))
    #print "Mean2: %f, Mean2/Var2: %f" % (np.mean(y2), np.mean(y2)/np.var(y2))
    #print "Mean3: %f, Mean3/Var3: %f" % (np.mean(y3), np.mean(y3)/np.var(y3))
    #plotting function -> plots temperature over timecourse w/ shared x axis

    # Generate plots
    fig = plt.figure(figsize=(8, 8))
    gs = gridspec.GridSpec(2, 1, height_ratios=(1, 3))
    axis1 = plt.subplot(gs[1])
    axis1.step(x[:, 0], y)
    plt.xlabel("Time (s)")
    axis1.set_ylabel("Lemmings")
    axis0 = plt.subplot(gs[0], sharex=axis1)
    axis0.step(x[:, 0], x[:, 1], c='r')
    axis0.set_ylabel("Temperature")
    plt.setp(axis0.get_xticklabels(), visible=False)
    plt.tight_layout()
    plt.show()
def main():
    # Rates
    k1 = .1 # Deactivation
    k2 = .1 # Reactivation
    k3 = 1 # Protein synthesis
    k4 = .1 # Protein degradation    
    #temp_fxn = [(0,5), (200, 50), (600, 5)]
    temp_fxn = [(0, 1)]    
    # Species
    Pab1 = Species("Pab1", 100)
    C = Species("Chaperone", 50)
    iPab1 = Species("iPab1", 0)
    # Reactions
    aggregation = Pab1Deactivation("agg", [Pab1], [iPab1], None, k1)
    disaggregation = Pab1Reactivation("disagg", [iPab1, C], [Pab1, C], None, k2)
    Ctranslation = CProduction("C Translation", [Pab1], [C], None, k3)
    Cdeg = UniDeg("C Degradation", [C], [], None, k4)
    # System
    species_list = [Pab1, C, iPab1]
    rxn_list = [aggregation, disaggregation, Ctranslation, Cdeg]
    system = Network(species_list, rxn_list)
    # Simulation
    x = system.simulate(0, 100, temp_fxn, None)
    # Plots
    colors = ['royalblue', 'gold', 'firebrick']
    fig, (axis2, axis) = plt.subplots(2, 1, figsize=(7,7))
    for i in range(2,len(species_list)+2):
        axis.plot(x[:,0], x[:,i], label=species_list[i-2].name, c=colors[i-2], linewidth=3)
    axis.legend(loc=0)
    axis.set_xlim(0,x[-1,0]+5)
    axis.set_xlabel("Time")
    axis.set_ylabel("Molecular species count")
    axis2.step(x[:, 0], x[:, 1], linewidth=3)
    axis2.set_xlabel("Time (s)")
    axis2.set_ylabel("Temperature")
    plt.tight_layout()
    plt.show()