Exemple #1
0
from src.analysis.data_models.fahey_SIR_acute.parameters import d
from src.modules.exp_data_model import Sim
from src.models.virus_models import vir_model_SIR
import src.modules.proc as proc
import src.modules.pl as pl
import matplotlib.pyplot as plt
import pandas as pd
import numpy as np
import seaborn as sns

sns.set(context="poster", style="ticks")

time = np.linspace(0, 80, 300)
sim = Sim(time=time,
          name="acute",
          params=d,
          prolif_type="timer",
          virus_model=vir_model_SIR)
#sim.set_fit_params(fit_date, fit_name)

sim.params["SIR_r0"] = 1.5
sim.name = "r1.5"
cells1, molecules1 = sim.run_sim()

sim.params["SIR_r0"] = 3
sim.name = "r3"
cells2, molecules2 = sim.run_sim()

sim.params["SIR_r0"] = 5
sim.name = "r5"
cells3, molecules3 = sim.run_sim()
Exemple #2
0
    os.makedirs(path + today)

# load data
path_data = "../data/"
df_fahey = pd.read_csv(path_data + "fahey_data.csv")
data_arm = df_fahey[df_fahey.name == "Arm"]
data_cl13 = df_fahey[df_fahey.name == "Cl13"]

# load fit result
fit_name = "2021-02-15_fit"
fit_date = "2021-02-15"

time = np.linspace(0, 80, 300)
sim = Sim(time=time,
          name=fit_name,
          prolif_type="timer_il2",
          params=d,
          virus_model=vir_model_const)
sim.set_fit_params(fit_date, fit_name)

# run simulation
cells, molecules = run_pipeline(sim)

# =============================================================================
# plot data
# =============================================================================
xlabel = "time post infection (d)"
ylabel = "cells"
xticks = [0, 10, 20, 30, 40, 50, 60]

df1 = cells[cells.cell.isin(["Tfh_all", "nonTfh"])]
Exemple #3
0
if not os.path.exists(path + today):
    os.makedirs(path + today)

# =============================================================================
# get data
# =============================================================================
path_data = "../data/"
df_fahey = pd.read_csv(path_data + "fahey_data.csv")
df_fahey.loc[df_fahey["cell"] == "NonTfh", "cell"] = "nonTfh"

data_arm = df_fahey[df_fahey.name == "Arm"]
data_cl13 = df_fahey[df_fahey.name == "Cl13"]

# get model
time = np.linspace(0,80,300)
sim = Sim(time = time, name = today, params = d, virus_model=vir_model_const)

# =============================================================================
# set parameters
# =============================================================================
params = Parameters()
params.add('death_tr1', value=0.05, min=0, max=0.2)
params.add('death_tfhc', value=0.01, min=0, max=0.2)
params.add('prolif_tr1', value=2.5, min=1, max=5.0)
params.add('prolif_tfhc', value=2.5, min=1, max=5.0)
params.add("pth1", value=0.3, min=0, max=1.0)
params.add("ptfh", value=0.2, min=0, max=1.0)
params.add("ptr1", value=0.3, min=0, max=1.0)
params.add("ptfhc", expr="1.0-pth1-ptfh-ptr1")
params.add("K_il2", value = 0.0001, min = 1e-7, max=1)
Exemple #4
0
sns.set(context="poster")
today = str(date.today())
path = "../figures/data_fits/"
if not os.path.exists(path + today):
    os.makedirs(path + today)

# load data
path_data = "../data/"
df_fahey = pd.read_csv(path_data + "fahey_data.csv")
data_arm = df_fahey[df_fahey.name == "Arm"]
data_cl13 = df_fahey[df_fahey.name == "Cl13"]

time = np.arange(0, 80, 0.01)
sim = Sim(time=time,
          name="new_model",
          prolif_type="timer_il2",
          params=d,
          virus_model=vir_model_const)

# run simulation
cells, molecules = run_pipeline(sim)

# =============================================================================
# plot data
# =============================================================================
xlabel = "time post infection (d)"
ylabel = "cells"
xticks = [0, 10, 20, 30, 40, 50, 60]

df1 = cells[cells.cell.isin(["Tfh_all", "nonTfh"])]
g = sns.relplot(data=df1,
Exemple #5
0
from src.modules.exp_data_model import Sim
from src.models.virus_models import vir_model_SIR
import matplotlib.pyplot as plt
import numpy as np
import seaborn as sns

sns.set(context="poster", style="ticks")

# load fit result
fit_name = "20210119_fit"
fit_date = "2021-01-19"

time = np.arange(0, 80, 0.01)
sim = Sim(time=time,
          name=fit_name,
          prolif_type="timer_il2",
          params=d,
          virus_model=vir_model_SIR)
#sim.set_fit_params(fit_date, fit_name)

sim.params["SIR_r0"] = 10.0
sim.name = "r1.5"
cells1, molecules1 = sim.run_sim()

mycells = [
    "Precursors", "Th1_eff", "Tfh_eff", "Tr1_all", "Tfh_chr", "Total_CD4"
]
cells1 = cells1.loc[cells1.cell.isin(mycells)]
g = sns.relplot(data=cells1,
                x="time",
                y="value",
Exemple #6
0
from src.analysis.data_models.fahey_SIR.parameters import d
from src.modules.exp_data_model import Sim
from src.models.virus_models import vir_model_SIR2
import src.modules.proc as proc
import src.modules.pl as pl
import matplotlib.pyplot as plt
import pandas as pd
import numpy as np
import seaborn as sns

sns.set(context="talk", style="ticks")

time = np.arange(0, 80, 0.01)
sim = Sim(time=time,
          name="r0_effects",
          prolif_type="timer_il2",
          params=d,
          virus_model=vir_model_SIR2)

sim.params["SIR_r0"] = 1.5
sim.name = "r1.5"
cells1, molecules1 = sim.run_sim()

sim.params["SIR_r0"] = 3
sim.name = "r3"
cells2, molecules2 = sim.run_sim()

sim.params["SIR_r0"] = 5
sim.name = "r5"
cells3, molecules3 = sim.run_sim()
Exemple #7
0
from src.analysis.data_models.fahey_ag_dose.parameters import d
from src.modules.exp_data_model import Sim
from src.models.virus_models import vir_model_const
import src.modules.proc as proc
import src.modules.pl as pl
import matplotlib.pyplot as plt
import pandas as pd
import numpy as np
import seaborn as sns
from matplotlib.ticker import NullFormatter

sns.set(context = "poster", style = "ticks", rc = {"lines.linewidth" : 5})

time = np.arange(0,80,0.01)
sim = Sim(time = time, name = "r0_effects", prolif_type= "timer", params = d, virus_model=vir_model_const)

pname = "vir_load"
sim.params[pname] = 0
sim.name = "low dose"
cells1, molecules1 = sim.run_sim()

sim.params[pname] = 1
sim.name = "high dose"
cells2, molecules2 = sim.run_sim()


cells = pd.concat([cells1, cells2])
molecules = pd.concat([molecules1, molecules2])

mycells = ["Th1_eff", "Tfh_eff", "Tr1_all", "Tfh_chr", "Total_CD4"]
cells = cells.loc[cells.cell.isin(mycells)]