Example #1
0
def update_all_parameter(diff):
    #print 'each difference -  %s' % diff
    luc_node = int(30*diff)
    hcc_node = int(5)
    time = 10

    #parameter
    luc_gro = int(6*diff)
    hcc_gro = int(2)

    lucG = nx.barabasi_albert_graph(luc_node, luc_gro)
    hccG = nx.barabasi_albert_graph(hcc_node, hcc_gro)

    frequency = np.array([0.9, 0.1])
    G_combine =nx.Graph()
    G_combine = graph.merge_graph(G_combine, hccG, lucG, frequency)

    frequency_1 = np.array([0.5, 0.5])
    G_combine_1 =nx.Graph()
    G_combine_1 = graph.merge_graph(G_combine_1, hccG, lucG, frequency_1)


    #Time series cell volume
    LucN = []
    hccN = []

    #Number of initial cell 
    LucN0 = 100
    hccN0 = 100
    LucN_init = 100
    hccN_init = 100

    for t in range(time):
      LucN.append(calc.convert_volume(LucN0))
      lucG = graph.update_graph(lucG, luc_gro)
      LucN0 = LucN_init*calc.calc_entropy(lucG, t+1)

    for t in range(time):
      hccN.append(calc.convert_volume(hccN0))
      hccG = graph.update_graph(hccG, hcc_gro)
      hccN0 = hccN_init*calc.calc_entropy(hccG, t+1)

    #Mix Number of cell
    MixN0 = 100
    MixN_init = 100
    initial_populations = MixN0*frequency
    G_comb_gro = ((frequency*np.array([luc_gro, hcc_gro])).sum())/2
    MixN = []
    x = []
    for t in range(time):
      x.append(t)
      MixN.append(calc.convert_volume(MixN0))
      G_combine = graph.update_graph(G_combine, G_comb_gro)
      MixN0 = MixN_init*calc.calc_entropy(G_combine, t+1)
 
    sim_ratio =  np.array(LucN)/np.array(MixN)
    return sim_ratio


    """
Example #2
0
def update_all_parameter(diff):
    #print 'each difference -  %s' % diff
    luc_node = int(30 * diff)
    hcc_node = int(5)
    time = 10

    #parameter
    luc_gro = int(6 * diff)
    hcc_gro = int(2)

    lucG = nx.barabasi_albert_graph(luc_node, luc_gro)
    hccG = nx.barabasi_albert_graph(hcc_node, hcc_gro)

    frequency = np.array([0.9, 0.1])
    G_combine = nx.Graph()
    G_combine = graph.merge_graph(G_combine, hccG, lucG, frequency)

    frequency_1 = np.array([0.5, 0.5])
    G_combine_1 = nx.Graph()
    G_combine_1 = graph.merge_graph(G_combine_1, hccG, lucG, frequency_1)

    #Time series cell volume
    LucN = []
    hccN = []

    #Number of initial cell
    LucN0 = 100
    hccN0 = 100
    LucN_init = 100
    hccN_init = 100

    for t in range(time):
        LucN.append(calc.convert_volume(LucN0))
        lucG = graph.update_graph(lucG, luc_gro)
        LucN0 = LucN_init * calc.calc_entropy(lucG, t + 1)

    for t in range(time):
        hccN.append(calc.convert_volume(hccN0))
        hccG = graph.update_graph(hccG, hcc_gro)
        hccN0 = hccN_init * calc.calc_entropy(hccG, t + 1)

    #Mix Number of cell
    MixN0 = 100
    MixN_init = 100
    initial_populations = MixN0 * frequency
    G_comb_gro = ((frequency * np.array([luc_gro, hcc_gro])).sum()) / 2
    MixN = []
    x = []
    for t in range(time):
        x.append(t)
        MixN.append(calc.convert_volume(MixN0))
        G_combine = graph.update_graph(G_combine, G_comb_gro)
        MixN0 = MixN_init * calc.calc_entropy(G_combine, t + 1)

    sim_ratio = np.array(LucN) / np.array(MixN)
    return sim_ratio
    """
Example #3
0
    #Time series cell volume
    LucN = []
    hccN = []

    #Number of initial cell 
    LucN0 = 10**4
    hccN0 = 10**4
    LucN_init = 10**4
    hccN_init = 10**4


    for t in range(time):
      LucN.append(calc.convert_volume(LucN0))
      lucG = graph.update_graph(lucG, luc_gro)
      LucN0 = LucN_init*calc.calc_entropy(lucG, t+1)
      
    for t in range(time):
      hccN.append(calc.convert_volume(hccN0))
      hccG = graph.update_graph(hccG, hcc_gro)
      hccN0 = hccN_init*calc.calc_entropy(hccG, t+1)

    #Mix Number of cell
    MixN0 = 10**4
    MixN_init = 10**4
    initial_populations = MixN0*frequency
    G_comb_gro = ((frequency*np.array([luc_gro, hcc_gro])).sum())/2
    MixN = []
    x = []
    for t in range(time):
      x.append(t)
Example #4
0
    #Time series cell volume
    LucN = []
    hccN = []

    #Number of initial cell
    cell_order = 2
    LucN0 = 10**cell_order
    hccN0 = 10**cell_order
    LucN_init = 10**cell_order
    hccN_init = 10**cell_order

    for t in range(time):
        LucN.append(calc.convert_volume(LucN0))
        lucG = graph.update_graph(lucG, luc_gro)
        LucN0 = LucN_init * calc.calc_entropy(lucG, t + 1)

    for t in range(time):
        hccN.append(calc.convert_volume(hccN0))
        hccG = graph.update_graph(hccG, hcc_gro)
        hccN0 = hccN_init * calc.calc_entropy(hccG, t + 1)

    #Mix Number of cell
    MixN0 = 10**cell_order
    MixN_init = 10**cell_order
    mix_new = 5
    initial_populations = MixN0 * frequency
    G_comb_gro = ((frequency * np.array([luc_gro, hcc_gro])).sum()) / 2
    MixN = []
    x = []
    for t in range(time):
Example #5
0
    #Time series cell volume
    LucN = []
    hccN = []

    #Number of initial cell 
    cell_order = 2
    LucN0 = 10**cell_order
    hccN0 = 10**cell_order
    LucN_init = 10**cell_order
    hccN_init = 10**cell_order


    for t in range(time):
      LucN.append(calc.convert_volume(LucN0))
      lucG = graph.update_graph(lucG, luc_gro)
      LucN0 = LucN_init*calc.calc_entropy(lucG, t+1)
      
    for t in range(time):
      hccN.append(calc.convert_volume(hccN0))
      hccG = graph.update_graph(hccG, hcc_gro)
      hccN0 = hccN_init*calc.calc_entropy(hccG, t+1)

    #Mix Number of cell
    MixN0 = 10**cell_order
    MixN_init = 10**cell_order
    mix_new = 5
    initial_populations = MixN0*frequency
    G_comb_gro = ((frequency*np.array([luc_gro, hcc_gro])).sum())/2
    MixN = []
    x = []
    for t in range(time):