Пример #1
0
import pandas as pd
sns.set(context = "talk", style = "ticks", rc = {"lines.linewidth": 4})

import matplotlib.ticker as ticker
import matplotlib.pyplot as plt

# =============================================================================
# run experiment to get normalization conditions
# =============================================================================
time = np.arange(0,100,0.01)

# =============================================================================
# heatmap conditions
# =============================================================================
res = 30
arr_myc = arr_from_d(d, "r_myc", res = res)
arr_il2 = arr_from_d(d, "r_il2", res = res)

name1 = "r_myc"
name2 = "r_il2"

model = timer_il2_model

# =============================================================================
# resp size heatmaps
# =============================================================================
readout_fun_list = [get_area, get_peak, get_peaktime]
norm_list = [40., 15, 3.4]

heatmap_list = []
for readout_fun, norm in zip(readout_fun_list, norm_list):
import matplotlib.ticker as ticker
import matplotlib.pyplot as plt
import itertools

# =============================================================================
# run experiment to get normalization conditions
# =============================================================================
time = np.arange(0, 200, 0.01)

# =============================================================================
# heatmap conditions
# =============================================================================

pnames = ["n_div", "r_diff", "gamma"]
pnames2 = ["r_il2", "r_myc", "r_C"]
arr_spec = [arr_from_d(d, name, res=20) for name in pnames2]
res = len(arr_spec[0])
arr_com = np.logspace(-1, 1, res)

model_list = [il2_model, timer_model, C_model]

# =============================================================================
# resp size heatmaps
# =============================================================================
titles = ["resp. size IL2", "resp. size Timer", "resp. size K"]
readout_fun = get_area
norm_area = 40

vmin = -3
vmax = 3
color = "bwr"
Пример #3
0
from analysis_module import multi_param, arr_from_d
from ode_models import il2_model, timer_model, null_model, C_model
import pandas as pd
sns.set(context="talk", style="ticks", rc={"lines.linewidth": 4})
import matplotlib.ticker as ticker
# =============================================================================
# define exp conditions
# =============================================================================

model_list = [il2_model, timer_model, C_model]
model_names = ["IL2", "Timer", "K"]

time = np.arange(0, 100, 0.001)
pnames = ["r_il2", "r_myc", "r_C"]
pnames_arr = [arr_from_d(d, pname) for pname in pnames]

# =============================================================================
# param scan
# =============================================================================
df_new = multi_param(pnames, pnames_arr, d, time, model_list, model_names)

df1 = df_new[(df_new["pname"] == "r_il2") & (df_new["model"] == "IL2")]
df2 = df_new[(df_new["pname"] == "r_C") & (df_new["model"] == "K")]
df3 = df_new[(df_new["pname"] == "r_myc") & (df_new["model"] == "Timer")]

df = pd.concat([df1, df2, df3])

g = sns.relplot(x="sim",
                y="ylog",
                kind="line",
Пример #4
0
# =============================================================================
# define exp conditions
# =============================================================================

model_list2 = [[il2_model], [C_model], [timer_model]]
model_names2 = [["il2"], ["K"], ["timer"]]
pnames = ["r_il2", "r_C", "r_myc"]

time = np.arange(0, 1000, 0.001)

df_list = []

for model_list, model_names, pname in zip(model_list2, model_names2, pnames):

    arr = arr_from_d(d, pname)
    df_new = vary_param(arr, pname, d, time, model_list, model_names)

    df_list.append(df_new)

df = pd.concat(df_list)

# =============================================================================
# plotting
# =============================================================================
loc_major = ticker.LogLocator(base=10.0, numticks=100)
loc_minor = ticker.LogLocator(base=10.0,
                              subs=np.arange(0.1, 1, 0.1),
                              numticks=12)

g = sns.relplot(data=df,
Пример #5
0
from analysis_module import multi_param, param_norm, arr_from_d, update_dict, vary_param
from ode_models import il2_model, timer_model, null_model, C_model

sns.set(context="talk", style="ticks", rc={"lines.linewidth": 4})
import matplotlib.ticker as ticker
import matplotlib.pyplot as plt
import pandas as pd
# =============================================================================
# normalize for gamma
# =============================================================================

time = np.arange(0, 200, 0.001)

arr_model_name = "r_myc"
arr_timer = arr_from_d(d, arr_model_name)

pname = "gamma"
guess_range = (0.1, 4)

norm = 40.
model = timer_model

arr_gamma_timer = param_norm(arr_timer, arr_model_name, pname, guess_range,
                             time, d, model, norm)

# =============================================================================
# normalize for C model
# =============================================================================

time = np.arange(0, 500, 0.001)