Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
cody2 authored Oct 29, 2021
1 parent f2e491b commit e7f80a7
Showing 1 changed file with 47 additions and 46 deletions.
93 changes: 47 additions & 46 deletions N803_model_2.m
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
% and NK cells during a subcutaneously administered regimen of N803

% /--------------------------------------------------------------\
% | Date: 07/12/2021 |
% | Date: 07/13/2021 |
% | Author: Jonathan Cody |
% | Affiliation: Pienaar Computational Systems Pharmacology Lab |
% | Weldon School of Biomedical Engineering |
% | Purdue University |
% \--------------------------------------------------------------/
%
% Version 2A

% Version 2B
%
% Nomenclature: V = SIV virions [#/無]
% K = NK cells [#/無]
Expand Down Expand Up @@ -71,10 +71,11 @@
%% ------------------------------------------------------------------------
% Rename inputed parameters -----------------------------------------------

Vi = Pars(01) ;% V initial condition [log(#/mL)]
Ki = Pars(02) ;% K initial condition [#/無]
Ei = Pars(03) ;% E initial condition [#/無]
fEA = Pars(04) ;% active E initial frequency
Vi = 10^(Pars(01)-3) ;% V initial condition [#/無]
Ki = Pars(02) ;% K initial condition [#/無]
Ei = Pars(03) ;% E initial condition [#/無]
E0i = Ei*(1-Pars(04)) ;% E0 initial condition [#/無]
EAi = Ei*( Pars(04)) ;% EA initial condition [#/無] (sum of E1 to E8)

gK_Ki = Pars(05)*Pars(06) ;% K initial killing rate [/d]
gE_EAi = Pars(06) ;% E initial killing rate [/d]
Expand All @@ -97,25 +98,22 @@
rE1_d0 = Pars(21) ;% E0 maximum growth rate [/d]
a1 = Pars(22) ;% E activation stimulation factor []

dR = Pars(23) ;% regulation decay rate constant [/d]
rK2 = Pars(24) ;% K proliferation regulation factor []
rE2 = Pars(25) ;% E0 proliferation regulation factor []
a2 = Pars(26) ;% E activation regulation factor []
A50 = Pars(23)*EAi ;% EA half-saturation for R activation [#/uL]
dR = Pars(24) ;% regulation decay rate constant [/d]
rK2 = Pars(25) ;% K proliferation regulation factor []
rE2 = Pars(26) ;% E0 proliferation regulation factor []
a2 = Pars(27) ;% E activation regulation factor []

N = Pars(27) ;% # of tolerance variables (delays + acting)
del = Pars(28) ;% tolerance rate constant [/d]
tau = Pars(29) ;% tolerance recovery []
eta = Pars(30) ;% tolerance effect factor []
N = Pars(28) ;% # of tolerance variables (delays + acting)
del = Pars(29) ;% tolerance rate constant [/d]
tau = Pars(30) ;% tolerance recovery []
eta = Pars(31) ;% tolerance effect factor []

%% ------------------------------------------------------------------------
% Declare initial conditions & calculated parameters ----------------------

% some parameters are solved for by assuming an initially steady state

Vi = 10^(Vi-3) ;% V initial condition [#/無]
E0i = Ei*(1-fEA) ;% E0 initial condition [#/無]
EAi = Ei*( fEA) ;% EA initial condition [#/無] (sum of E1 to E8)

F5i = Vi/(Vi+V50) / (1+a2) ;% initial E activation rate modifiers []

% solve for activation rate a [/d] and E1 to E8 initial conditions [#/無]
Expand All @@ -134,7 +132,7 @@
rE = (1+rE2) * (Em+Ei)/Em * ( d0 + a*F5i - fm*dA*sol(9)/E0i ) ;% E0 prolif
rK1 = rK1_dK/dK ;% K proliferation stimulation factor []
rE1 = rE1_d0/d0 ;% E0 proliferation stimulation factor []
psi = dR/F5i ;% R generation rate constant [/d]
psi = dR*(A50+EAi)/EAi ;% R generation rate constant [/d]

% declare initial conditions for Y (see 'system' function)
% V K E0 E1-8 X C R tolerance
Expand Down Expand Up @@ -192,7 +190,7 @@
dY(11) = 2*p*EA(7) - dA*EA(8) ;% dE8/dt
dY(12) = - ka*X ;% dX/dt
dY(13) = ka*X/vd - ke*C ;% dC/dt
dY(14) = psi*F(15) - dR*R ;% dR/dt
dY(14) = psi*F(16) - dR*R ;% dR/dt

% calculate rates of change for tolerance
if N ~= 0
Expand All @@ -211,6 +209,7 @@
V = Y(:,01) ;% SIV virions [#/無]
K = Y(:,02) ;% NK cells [#/無]
E = sum(Y(:,03:11),2) ;% CD8+ T cells [#/無]
EA = sum(Y(:,04:11),2) ;% active CD8+ T cells [#/無]
C = Y(:,13) ;% N803 plasma concentration [pM]
R = Y(:,14) ;% immune regulation []
T = Y(:,13+N)+Y(:,14+N) ;% drug tolerance []
Expand All @@ -221,18 +220,19 @@
F(:,01) = C ./ (C50+C) ;% N803 effect []
F(:,02) = 1 ./ (1+eta*T) ;% tolerance effect []
F(:,03) = F(:,1) .* F(:,2) ;% N803 effect (with tolerance) []
F(:,04) = 1 + rK1*F(:,3) ;% K proliferation stimulation []
F(:,05) = 1 + rE1*F(:,3) ;% E0 proliferation stimulation []
F(:,06) = 1 + a1*F(:,3) ;% activation stimulation []
F(:,07) = 1 ./ (1+rK2*R) ;% K proliferation regulation []
F(:,08) = 1 ./ (1+rE2*R) ;% E0 proliferation regulation []
F(:,09) = 1 ./ (1+ a2*R) ;% activation regulation []
F(:,10) = Km./ (Km +K) ;% K proliferation density dependence []
F(:,11) = Em./ (Em +E) ;% E0 proliferation density dependence []
F(:,04) = 1 + rK1*F(:,3) ;% K proliferation stimulation []
F(:,05) = 1 + rE1*F(:,3) ;% E proliferation stimulation []
F(:,06) = 1 + a1*F(:,3) ;% E activation stimulation []
F(:,07) = 1 ./ (1+rK2*R) ;% K proliferation regulation []
F(:,08) = 1 ./ (1+rE2*R) ;% E proliferation regulation []
F(:,09) = 1 ./ (1+ a2*R) ;% E activation regulation []
F(:,10) = Km./ (Km +K) ;% K proliferation density dependence []
F(:,11) = Em./ (Em +E) ;% E proliferation density dependence []
F(:,12) = V ./ (V50+V) ;% activation antigen dependence []
F(:,13) = F(:,4) .* F(:,7) .* F(:,10) ;% K proliferation modifier []
F(:,14) = F(:,5) .* F(:,8) .* F(:,11) ;% E0 proliferation modifier []
F(:,15) = F(:,6) .* F(:,9) .* F(:,12) ;% activation modifier []
F(:,13) = F(:,4) .* F(:,7) .* F(:,10) ;% K proliferation modifier []
F(:,14) = F(:,5) .* F(:,8) .* F(:,11) ;% E proliferation modifier []
F(:,15) = F(:,6) .* F(:,9) .* F(:,12) ;% E activation modifier []
F(:,16) = EA./ (A50+EA) ;% R activation modifier []

end

Expand Down Expand Up @@ -260,25 +260,26 @@
Y_OUT(:,8) = Y(:,14) ;% R []
Y_OUT(:,9) = (Y(:,13+N)+Y(:,14+N)) * (N~=0) ;% T []

F = terms(Y) ;% modifiers for 'rK','rE','a'
F = terms(Y) ;% modifiers for 'rK','rE','a'

Y_OUT(:,10) = F(:,01) ;% N803 effect []
Y_OUT(:,11) = F(:,02) ;% tolerance effect []
Y_OUT(:,12) = F(:,03) ;% N803 effect (with tolerance) []
Y_OUT(:,13) = F(:,04) ;% K proliferation stimulation []
Y_OUT(:,14) = F(:,05) ;% E0 proliferation stimulation []
Y_OUT(:,15) = F(:,06) ;% activation stimulation []
Y_OUT(:,16) = F(:,07)/F(1,07) ;% K proliferation regulation [fold change]
Y_OUT(:,17) = F(:,08)/F(1,08) ;% E0 proliferation regulation [fold change]
Y_OUT(:,18) = F(:,09)/F(1,09) ;% activation regulation [fold change]
Y_OUT(:,19) = F(:,10)/F(1,10) ;% K prolif density dependence [fold change]
Y_OUT(:,20) = F(:,11)/F(1,11) ;% E0 prolif density dependence [fold change]
Y_OUT(:,21) = F(:,12)/F(1,12) ;% activ antigen dependence [fold change]
Y_OUT(:,22) = F(:,13)/F(1,13) ;% K proliferation modifier [fold change]
Y_OUT(:,23) = F(:,14)/F(1,14) ;% E0 proliferation modifier [fold change]
Y_OUT(:,24) = F(:,15)/F(1,15) ;% activation modifier [fold change]
Y_OUT(:,13) = F(:,04) ;% K proliferation stimulation []
Y_OUT(:,14) = F(:,05) ;% E proliferation stimulation []
Y_OUT(:,15) = F(:,06) ;% E activation stimulation []
Y_OUT(:,16) = F(:,07)/F(1,07) ;% K proliferation regulation [fold change]
Y_OUT(:,17) = F(:,08)/F(1,08) ;% E proliferation regulation [fold change]
Y_OUT(:,18) = F(:,09)/F(1,09) ;% E activation regulation [fold change]
Y_OUT(:,19) = F(:,10)/F(1,10) ;% K prolif density dependence [fold change]
Y_OUT(:,20) = F(:,11)/F(1,11) ;% E prolif density dependence [fold change]
Y_OUT(:,21) = F(:,12)/F(1,12) ;% E activ antigen dependence [fold change]
Y_OUT(:,22) = F(:,13)/F(1,13) ;% K proliferation modifier [fold change]
Y_OUT(:,23) = F(:,14)/F(1,14) ;% E proliferation modifier [fold change]
Y_OUT(:,24) = F(:,15)/F(1,15) ;% E activation modifier [fold change]
Y_OUT(:,25) = F(:,16)/F(1,16) ;% R activation modifier [fold change]

% NK killing proportion
Y_OUT(:,25) = gK*Y(:,2) ./ ( gK*Y(:,2) + gE*sum(Y(:,04:11),2) ) ;
Y_OUT(:,26) = gK*Y(:,2) ./ ( gK*Y(:,2) + gE*sum(Y(:,04:11),2) ) ;

end

0 comments on commit e7f80a7

Please sign in to comment.