From c87a19e00e17bb6bb7470a51ab7f78d95b3d5e3f Mon Sep 17 00:00:00 2001 From: "Cody, Jonathan William" Date: Sun, 8 Jan 2023 11:53:57 -0600 Subject: [PATCH] Delete N803_shared_noN.m --- N803_shared_noN.m | 219 ---------------------------------------------- 1 file changed, 219 deletions(-) delete mode 100644 N803_shared_noN.m diff --git a/N803_shared_noN.m b/N803_shared_noN.m deleted file mode 100644 index 0bd23bd..0000000 --- a/N803_shared_noN.m +++ /dev/null @@ -1,219 +0,0 @@ -%% N803_shared_noN.m - solves model 2S for 2 cohorts with shared parameters -% -% /--------------------------------------------------------------\ -% | Date: 01/01/2023 | -% | Author: Jonathan Cody | -% | Affiliation: Purdue University | -% | Weldon School of Biomedical Engineering | -% | Pienaar Computational Systems Pharmacology Lab | -% \--------------------------------------------------------------/ -% -% Model 2S is a simplified version of Model 2 that combines SIV-specific -% and non-SIV-specific CD8+ T cells -% -% Nomenclature: V = SIV virions [#/無] -% T8 = total CD8+ T cells [#/無] -% E0 = resting CD8+ T cells [#/無] -% EA = active CD8+ T cells [#/無] -% X = N803 at absorption site [pmol/kg] -% C = N803 plasma concentration [pM] -% R = regulation [] (dimensionless quantity) -% -%% ======================================================================== -% INPUTS -% ======================================================================== -% -% SoluTimes = ascending vector of days at which to evaluate solution -% -% DoseTimes{c} = ascending vector of days at which to administer doses -% (elements of 'DoseTimes' must also be in 'SoluTimes') -% -% AllPars = vector of parameters (see list in function) -% -%% ======================================================================== -% OPTIONS -% ======================================================================== -% -% SkipTimes{c} = [min max] time point beyond which to skip model solving -% (outputs before 'min' will be made equal to output at 'min') -% (leave as [] to ignore and solve for all 'SoluTimes') -% -% oneCohort = scalar to run model for just one cohort ('1' or '2') -% (leave as [] to ignore and solve for both cohorts) -% -% All additional inputs will be passed as a cell vector to 'N803_model_2' -% and used to define options (see function for list) -% EX: N803_single(SoluTimes,DoseTimes,AllPars,'AbsTol',1e-2} -% will set ode solver absolute tolerance to 1e-2 -% -%% ======================================================================== -% OUTPUTS -% ======================================================================== -% -% Y_OUT(:,1) = V at points in 'SoluTimes' [log fold change] cohort 1 -% Y_OUT(:,2) = T8 at points in 'SoluTimes' [fold change] cohort 1 -% Y_OUT(:,3) = V at points in 'SoluTimes' [log fold change] cohort 2 -% Y_OUT(:,4) = T8 at points in 'SoluTimes' [fold change] cohort 2 -% -% PARS(1,:) = parameters for cohort 1 (see code) -% PARS(2,:) = parameters for cohort 2 (see code) -% -%% ======================================================================== -% FUNCTION -% ======================================================================== -function [Y_OUT,PARS] = ... - N803_shared_noN(SoluTimes,DoseTimes,AllPars,SkipTimes,oneCohort,... - varargin) - -if isempty(oneCohort) ; RunCohort = [ 1 1 ] ; -elseif oneCohort == 1 ; RunCohort = [ 1 0 ] ; -else ; RunCohort = [ 0 1 ] ; -end - -Y_Cohort = cell(1,2) ;% cell for storing outputs -P_Cohort = cell(1,2) ;% cell for storing parmeters - -% Rename inputed parameters ----------------------------------------------- -Vi(1) = AllPars(01) ;% V initial value [log(#/mL)] (cohort 1) -Vi(2) = AllPars(02) ;% V initial value [log(#/mL)] (cohort 2) -Ei(1) = AllPars(03) ;% E initial value [#/無] (cohort 1) -Ei(2) = AllPars(04) ;% E initial value [#/無] (cohort 2) - -q = AllPars(05) ;% V growth rate (if E were absent) [/d] -V50E = AllPars(06) ;% 50% viral stimulation saturation for E [#/mL] -V50R = AllPars(07) ;% 50% viral stimulation saturation for R [#/mL] -m = AllPars(08) ;% EA reversion rate constant [/d] - -E50 = AllPars(09) ;% 50% E proliferation saturation [#/無] -p0n = AllPars(10) ;% E0 nomalized proliferation rate constant [/d] -pA = AllPars(11) ;% EA proliferation rate constant [/d] -d = AllPars(12) ;% E0 death rate constant [/d] -dA = AllPars(13) ;% EA death rate constant [/d] - -Xi = AllPars(14) ;% X initial condition [pmol/kg] -ka = AllPars(15) ;% N803 absorption rate constant [/d] -ke = AllPars(16) ;% N803 elimination rate constant [/d] -vd = AllPars(17) ;% N803 'volume of distribution'/'bioavailability' [L/kg] -C50 = AllPars(18) ;% 50% N803 stimulation concentration [pM] (Cohort 1) -pm = AllPars(19) ;% E0 maximum proliferation rate [] -a1 = AllPars(20) ;% E activation stimulation factor [] -s1 = AllPars(21) ;% R generation stimulation factor [] - -dR = AllPars(22) ;% R decay rate constant [/d] -p2 = AllPars(23) ;% E0 proliferation regulation factor [] - -%% ------------------------------------------------------------------------ -% Calculate some initial conditions & parameters -------------------------- - -Vi = 10.^(Vi - 3) ;% converting V initial value [#/無] -V50E = V50E/1000 ;% 50% viral stimulation saturation for E [#/無] -V50R = V50R/1000 ;% 50% viral stimulation saturation for R [#/無] -YE = Vi ./ (Vi+ V50E) ;% initial V/(V50E+V) [cohort 1,2] -YR = Vi ./ (Vi+ V50R) ;% initial V/(V50B+V) [cohort 1,2] - -% calculate initial R (normalized to Cohort 1) and s -s0 = dR / YR(1) ;% R generation rate [/d] -R = [ 1 , s0*YR(2)/dR ] ;% initial regulation [cohort 1,2] - -% restrict p0 to ensure same sign for E0/EA and for B0/BA -p0_max = min( d*(1+p2*R).*(E50+Ei)/E50 ) ;% maximum value for p0 -p0 = p0n * p0_max ;% E0/B0 prolif rate constant [/d] -p1 = pm/p0 ;% E0/B0 proliferation stimulation factor -pi = p0*E50./(E50+Ei)./(1+p2*R) ;% initial E0/B0 prolif rate [/d] - -% calculate initial ratio: E8/E0/a -U = 2/(m+dA) * (2*pA/(pA+dA))^7 ; - -% calculate a0, a2 -ai = (d-pi)/( m*U - 1 ) ;% initial E0 activation rate [/d] -F = ai./YE ; -a2 = ( F(1)-F(2) ) / ( R(2)*F(2)-F(1) );% E0 activation rate constant [/d] -a0 = ai(1) / YE(1) * (1+a2) ;% E0 activation regulation factor [] - -% calculate initial ratio of EA/E8 -W = 1 ; -for i = 1:7 - W = W + (pA+dA)^(i-1) / (2*pA)^i * (m+dA) ;% EAi/E8i -end - -% calculate initial values of E0,EA for each cohort -E0 = Ei.*(m/W)./ ( (m/W) - pi + d + ai ) ;% initial E0 -EA = Ei - E0 ;% initial EA - -% calculate g0 and g2 -g2 = (EA(1)-EA(2)) / (EA(2)-EA(1)*R(2)) ;% EA killing regulation factor [] -g0 = q * (1+g2) / EA(1) ;% EA killing rate constant [無/#-d] - -%% Do for each cohort (NOT indenting loop) ================================ -for c = 1:2 - -% solve for initial E1-8 and B1-2 -E = zeros(1,8) ;% initial E1-E8 -E(1) = 2*ai(c)*E0(c) / (pA+dA) ;% E1 -for i = 2:7 - E(i) = 2*pA*E(i-1) / (pA+dA) ;% E2 to E7 -end -E(8) = 2*pA*E(7) / (m+dA) ;% E8 - -%% ------------------------------------------------------------------------ -% Prepare parameter and initial value vectors and call 'N803_model_2' ----- - -Pars(01) = q ;% V growth rate (if E+B were absent) [/d] -Pars(02) = g0 ;% EA killing rate constant [無/#-d] -Pars(03) = V50E ;% 50% viral stimulation saturation for E [#/無] -Pars(04) = V50R ;% 50% viral stimulation saturation for R [#/無] -Pars(05) = a0 ;% E0 activation rate constant [/d] -Pars(06) = m ;% EA reversion rate constant [/d] - -Pars(07) = E50 ;% 50% E proliferation saturation [#/無] -Pars(08) = p0 ;% E0 proliferation rate constant [/d] -Pars(09) = pA ;% EA proliferation rate constant [/d] -Pars(10) = d ;% E0 death rate constant [/d] -Pars(11) = dA ;% EA death rate constant [/d] - -Pars(12) = Xi ;% X initial condition [pmol/kg] -Pars(13) = ka ;% N803 absorption rate constant [/d] -Pars(14) = ke ;% N803 elimination rate constant [/d] -Pars(15) = vd ;% N803 'volume of distribution'/'bioavailability' [L/kg] -Pars(16) = C50 ;% 50% N803 stimulation concentration [pM] -Pars(17) = p1 ;% E0 proliferation stimulation factor [] -Pars(18) = a1 ;% E0 activation stimulation factor [] -Pars(19) = s1 ;% R generation stimulation factor [] - -Pars(20) = s0 ;% R generation maximum base rate [/d] -Pars(21) = dR ;% R decay rate constant [/d] -Pars(22) = g2 ;% EA killing regulation factor [] -Pars(23) = p2 ;% E0 proliferation regulation factor [] -Pars(24) = a2 ;% E0 activation regulation factor [] - -% V E0-8 X C R initial values -Yic = [ Vi(c) E0(c) E 0 0 R(c) R(c) ] ; - -% if any( [ Pars Yic ] < 0 ) -% error('Negative parameters or initial values.') -% end - -% If 'SkipTimes' is empty, do not skip any times -if isempty(SkipTimes{c}) ; SkipTimes{c} = [-inf inf] ; end - -idLo = SoluTimes < SkipTimes{c}(1) ;% index of early times to skip soln -idHi = SoluTimes > SkipTimes{c}(2) ;% index of later times to skip soln -idSol = ~ ( idLo | idHi ) ;% index of times in 'SoluTimes' to solve - -if RunCohort(c) == 1 - Y_COH = N803_model_2S(SoluTimes(idSol),DoseTimes{c},Pars,Yic,varargin); - Y_LO = ones(sum(idLo),1)*Y_COH(1 ,:) ;% constant Y for early times - Y_HI = ones(sum(idHi),1)*Y_COH(end,:) ;% constant Y for later times - Y_COH = [ Y_LO ; Y_COH ; Y_HI ] ;%#ok % total 'solution' matrix - Y_Cohort{c} = Y_COH ; - P_Cohort{c} = [ Pars Yic ] ; -end - -end - -%% Prepare main outputs 'Y_OUT' and 'PARS' ================================ - -Y_OUT = [ Y_Cohort{1} , Y_Cohort{2} ] ; -PARS = [ P_Cohort{1} ; P_Cohort{2} ] ; - -end \ No newline at end of file