function p53basalpulses %% p53basalpulses implement a single run of basal pulses under nonstressed conditions % The output p53 pulses are normalized [0 1]. % please add FOR loops to make statistical results such as first peaking % times distribution. % The function can be put in any custom routine. %% Reference % Ma L, Wagner J, Rice JJ, Hu W, Levine AJ, et al. (2005). % A plausible model for the digital response of p53 to DNA damage. % Proc Natl Acad Sci U S A 102: 14266-14271. %% Author: Tingzhe Sun % Department of Life Sciences, Nanjing University % NO.22, Hankou Road % Nanjing, 210093 China % Email: confucian007@126.com % July 19, Last revision: 2011/07/19 %% V=100000; % a scale parameter %tic; f=10000; % control time step L=20000; % Only non-specific Tau works %randnum=1; tfinal=2880; BT1=0; % fast kinetics BT2=0; % slow kinetics % species: (species ending with 'p' denote the phosphorylated forms) % Y(1) p53mRNA % Y(2) mdm2mRNA % Y(3) wip1mRNA % Y(4) p53 % Y(5) p53p % Y(6) MDM2 % Y(7) MDM2p % Y(8) wip1 % Y(9) ATM % Y(10) p21mRNA % Y(11) p21 % Y(12) p53act (acetylated p53) %paramters related to core p53-MDM2 oscillator par(1)=0.0005*V; par(2)=0.01; par(3)=0.001*V; par(4)=0.02; par(5)=0.014*V; par(6)=0.2*V; par(7)=0.002*V; par(8)=0.05; par(9)=0.014*V; par(10)=0.2*V; par(11)=0.1; par(12)=0.035; par(13)=0.2/V; par(14)=1.8/V; par(15)=0.2; par(16)=1.5/V; par(17)=0.01/V; par(18)=0.02; par(19)=0.035; par(20)=0.01/V; par(21)=0.5/V; par(22)=0.14; par(23)=0.02; par(24)=0.035; %par(1)=0.0002*V; par(2)=0.005; par(3)=0.001*V; par(4)=0.02; %par(5)=0.024*V; par(6)=0.5*V; par(7)=0.001*V; par(8)=0.05; %par(9)=0.024*V; par(10)=0.5*V; par(11)=0.2; par(12)=0.035; %par(13)=0.2/V; par(14)=1.6/V; par(15)=0.2; par(16)=1.5/V; %par(17)=0.01/V; par(18)=0.02; par(19)=0.035; par(20)=0.01/V; %par(21)=0.5/V; par(22)=0.14; par(23)=0.02; par(24)=0.05; sp53m=par(1); deltap53m=par(2); smdm2m=par(3); deltamdm2m=par(4); e1=par(5); Km=par(6); swip1m=par(7); deltawip1m=par(8); e2=par(9); Kw=par(10); rp53=par(11); up53=par(12); v1=par(13); katm=par(14); ATM=par(15); kwip1=par(16); v2=par(17); rmdm2=par(18); umdm2=par(19); k1=par(20); k2=par(21); umdm2p=par(22); rwip1=par(23); uwip1=par(24); %parameters related to ATM ATMtotal=1; KmDSB=200; %IR=5; %DSBinduced=IR*30; parATM(1)=.0005; parATM(2)=1.5/V; parATM(3)=0.02; %parATM(4)=(DSBinduced)/(DSBinduced+KmDSB); parATM(5)=0.06/V; PERCENT=0.3; % Randomized delays alpha=parATM(1); gammawip1=parATM(2); gammaATM=parATM(3); %DSB=parATM(4); autoact=parATM(5); K1=0.01*V; K2=0.005*V; %parameters related to p21 parP21(1)=0.2*V; parP21(2)=1.5*V; parP21(3)=0.002; parP21(4)=0.01; parP21(5)=0.003; e3=parP21(1); Kp=parP21(2); deltap21=parP21(3); rp21=parP21(4); up21=parP21(5); % %parameters related to acetylation parAc(1)=0.3; parAc(2)=0.05; %parAc(3)=0.005/V; %parAc(4)=0.01; Kac=parAc(1); gammap53act=parAc(2); %Kact=parAc(3); %gammaAc=parAc(4); % paramter for DSB repair ranDSB=40; % Number of DSBs during S phase ranDSBind=0; SDSB=10; % Number of DSBs during G/M phase %rand('state',sum(100*clock)); % random DSB allocation ranT_temp=480*rand(1,(ranDSB)); ranTM1_temp=360*rand(1,SDSB); ranT_temp2=480*rand(1,(ranDSB)); ranTM2_temp=360*rand(1,SDSB); ranT=sort(ranT_temp); ranT2=sort(ranT_temp2); ranM1=sort(ranTM1_temp); ranM2=sort(ranTM2_temp); DSB_T=360+ranT; DSB_T2=1560+ranT2; DSB_M1=840+ranM1; DSB_M2=2040+ranM2; DSB_Tp=[DSB_T,DSB_M1,DSB_T2,DSB_M2]; queue=DSB_Tp; %intitial conditions xzero=0; % initial state of the breaks RPzero=20; % initial number of repairing protein k_fb1=1.5; %association rate of x1 (fast kinetics) k_rb1=0.1; %dissociation rate of x1 k_fix1=0.1; %fixation rate of x1 k_cross=1e-2; scale=7; %ratio of (fast kinetics)/(slow kinetics) k_fb2=k_fb1/scale; %association rate of x2 (slow kinetics) k_rb2=k_rb1/scale; %dissociation rate of x2 k_fix2=k_fix1/scale; %fixation rate of x2 x1=zeros(BT1,L); x2=zeros(BT2,L); RP_temp=RPzero; count_10=zeros(1,L); %initialize the vector storing the time solution of intact DSB (state 0) for kinetics 1 count_11=zeros(1,L); %initialize the vector storing the time solution of DSB complex (state 1) for kinetics 1 count_12=zeros(1,L); %initialize the vector storing the time solution of fixed DSB (state 2) for kinetics 1 count_10(1)=BT1; %initial condition for intact DSB for kinetics 1 count_11(1)=0; %initial condition for DSB complex for kinetics 1 count_12(1)=0; %initial condition for fixed DSB for kinetics 1 count_20=zeros(1,L); %initialize the vector storing the time solution of state 0 for kinetics 1 count_21=zeros(1,L); %initialize the vector storing the time solution of state 1 for kinetics 1 count_22=zeros(1,L); %initialize the vector storing the time solution of state 2 for kinetics 1 count_20(1)=BT2; %initial condition for state 0 for kinetics 1 count_21(1)=0; %initial condition for state 1 for kinetics 1 count_22(1)=0; %initial condition for state 2 for kinetics 1 v=zeros(31,12); % y(10) y(11) y(12) y(13) y(14) % p21mRNA p21 p53act Ac Acp v(1,:)=[ 1 0 0 0 0 0 0 0 0 0 0 0]; v(2,:)=[-1 0 0 0 0 0 0 0 0 0 0 0]; v(3,:)=[ 0 1 0 0 0 0 0 0 0 0 0 0]; v(4,:)=[ 0 -1 0 0 0 0 0 0 0 0 0 0]; v(5,:)=[ 0 1 0 0 0 0 0 0 0 0 0 0]; v(6,:)=[ 0 0 1 0 0 0 0 0 0 0 0 0]; v(7,:)=[ 0 0 -1 0 0 0 0 0 0 0 0 0]; v(8,:)=[ 0 0 1 0 0 0 0 0 0 0 0 0]; v(9,:)=[ 0 0 0 1 0 0 0 0 0 0 0 0]; v(10,:)=[ 0 0 0 -1 0 0 0 0 0 0 0 0]; v(11,:)=[ 0 0 0 -1 0 0 0 0 0 0 0 0]; v(12,:)=[ 0 0 0 -1 1 0 0 0 0 0 0 0]; v(13,:)=[ 0 0 0 1 -1 0 0 0 0 0 0 0]; v(14,:)=[ 0 0 0 0 -1 0 0 0 0 0 0 0]; v(15,:)=[ 0 0 0 0 0 1 0 0 0 0 0 0]; v(16,:)=[ 0 0 0 0 0 -1 0 0 0 0 0 0]; v(17,:)=[ 0 0 0 0 0 -1 1 0 0 0 0 0]; v(18,:)=[ 0 0 0 0 0 1 -1 0 0 0 0 0]; v(19,:)=[ 0 0 0 0 0 0 -1 0 0 0 0 0]; v(20,:)=[ 0 0 0 0 0 0 0 1 0 0 0 0]; v(21,:)=[ 0 0 0 0 0 0 0 -1 0 0 0 0]; v(22,:)=[ 0 0 0 0 0 0 0 0 1 0 0 0]; v(23,:)=[ 0 0 0 0 0 0 0 0 -1 0 0 0]; v(24,:)=[ 0 0 0 0 0 0 0 0 -1 0 0 0]; v(25,:)=[ 0 0 0 0 0 0 0 0 1 0 0 0]; % new reactions v(26,:)=[ 0 0 0 0 0 0 0 0 0 1 0 0]; v(27,:)=[ 0 0 0 0 0 0 0 0 0 -1 0 0]; v(28,:)=[ 0 0 0 0 0 0 0 0 0 0 1 0]; v(29,:)=[ 0 0 0 0 0 0 0 0 0 0 -1 0]; v(30,:)=[ 0 0 0 0 -1 0 0 0 0 0 0 1]; v(31,:)=[ 0 0 0 0 1 0 0 0 0 0 0 -1]; vprime=zeros(31,12); for ii=1:numel(v) if v(ii)==-1 vprime(ii)=v(ii); else vprime(ii)=0; end end X=ceil([0.0500 0.0500 0.0400 0.1228 0 0.0286 0 0.0229 0 0 0 0].*V); %X=ceil([0.2000 0.0900 0.0200 0.7567 0.0001 0.1286 0.0001 0.0200 0.001].*V); Yrec=X; Yini=X; t=0; trec=0; h = waitbar(0,'Please wait...'); a=zeros(1,31); % preallocate the variable storing delayed firing queue1=[]; queue2=[]; queue3=[]; queue4=[]; queue5=[]; queue6=[]; % paramters for Monte Carlo DSB repair T=0; timestep=0.2; while t0)); %end tau=f/asum; dt_temp=tau; react_num=floor(dt_temp/timestep); Tre=[T(end)+(timestep:timestep:dt_temp),T(end)+dt_temp]; Tsimu=[T(end),Tre]; dt_list=diff(Tsimu); kt1=length(T); T=[T,Tre]; kt2=length(T); num=1; for i=kt1:(kt2-1) dt=dt_list(num); Tnow=T(i); Tindex=find(Tnow>=queue); N_plus=numel(Tindex); queue=queue(N_plus+1:end); if N_plus toss=binornd(1,0.7,1,N_plus); N1=numel(find(toss>0)); N2=N_plus-N1; x1append=[2*ones(N1,i-1),zeros(N1,L-i+1)]; x2append=[2*ones(N2,i-1),zeros(N2,L-i+1)]; x1=[x1;x1append]; x2=[x2;x2append]; end p111=k_fb1*dt; %sub_probability of association of repairing protein to dsb type 1 p112=k_cross*dt; %sub_probability of association of repairing protein to dsb p12=k_fix1*dt; %probability of dissociation p13=(k_rb1+k_fix1)*dt; %probability fixation p21=k_fb2*dt; %sub_probability of association of repairing protein to dsb type 2 p212=k_cross*dt; %sub_probability of association of repairing protein to dsb type 2 p22=k_fix2*dt; p23=(k_rb2+k_fix2)*dt; num=num+1; %desicion of x1(:,i) state (fast kinetics) if isempty(x1) x1=x1; else for j=1:size(x1,1) dice_1=rand; if x1(j,i)==0 if (RP_temp>0 && dice_1<(p111*RP_temp+p112*(count_10(i)+count_20(i)))) x1(j,i+1)=1; RP_temp=RP_temp-1; else x1(j,i+1)=0; RP_temp=RP_temp; end elseif x1(j,i)==1 dice_2=rand; if dice_20 && dice_2<(p21*RP_temp+p212*(count_10(i)+count_20(i)))) x2(j,i+1)=1; RP_temp=RP_temp-1; else x2(j,i+1)=0; RP_temp=RP_temp; end elseif x2(j,i)==1 dice_2=rand; if dice_2000 && t<300 % DSB=200*(1-0.003*t)/(10+200*(1-0.003*t)); % else %DSB=1/11; % end t=t+tau; if t>1200 && t-tau<=1200 for jj=1:12 X(jj)=binornd(X(jj),0.5); end Yini=X; DSB=binornd(DSB,0.5); end parATM(4)=(DSB)/(DSB+KmDSB); waitbar(t/tfinal,h); k=zeros(1,31); kmax=zeros(1,31); prob=zeros(1,31); for jr=1:31 if ~all(v(jr,:)>=0) for spe=1:12 if v(jr,spe)<0 kmax(jr)=X(spe)/abs(v(jr,spe)); if kmax(jr)==0 prob(jr)=0; else prob(jr)=a(jr)*tau/kmax(jr); end if prob(jr)>1 prob(jr)=1; end k(jr)=binornd(kmax(jr),prob(jr)); X=X+v(jr,:)*k(jr); end end % basal induction reactions elseif jr==1 if a(jr)*tau==0 X=X+0; elseif a(jr)*tau<=1 k(jr)=ceil(poissrnd(a(jr)*tau)); X=X+v(jr,:)*k(jr); else k(jr)=geornd(1/(a(jr)*tau)); X=X+v(jr,:)*k(jr); end elseif jr==3 if a(jr)*tau==0 X=X+0; elseif a(jr)*tau<=1 k(jr)=poissrnd(a(jr)*tau); X=X+v(jr,:)*k(jr); else k(jr)=geornd(1/(a(jr)*tau)); X=X+v(jr,:)*k(jr); end elseif jr==6 if a(jr)*tau==0 X=X+0; elseif a(jr)*tau<=1 k(jr)=ceil(poissrnd(a(jr)*tau)); X=X+v(jr,:)*k(jr); else k(jr)=geornd(1/(a(jr)*tau)); X=X+v(jr,:)*k(jr); end % induced expression elseif jr==5 if a(jr)*tau==0 X=X+0; elseif a(jr)*tau<=1 k(jr)=ceil(poissrnd(a(jr)*tau)); else k(jr)=geornd(1/(a(jr)*tau)); end delay1=delay1*PERCENT*(2*rand-1)+delay1;%stochastic delays queue1=[queue1,t-tau+delay1+tau*rand(1,k(jr))]; queue1=sort(queue1); num1=numel(find(t>=queue1)); queue1=queue1(num1+1:end); if (t-tau)<=delay1 if a(jr)==0 X=X+0; else if e1*(Yini(5)+X(12))^4/((Yini(5)+Yini(12))^4+Km^4)*tau==0 X=X; else if e1*(Yini(5)+Yini(12))^4/((Yini(5)+Yini(12))^4+Km^4)*tau<=1 X=X+v(jr,:)*poissrnd(e1*(Yini(5)+Yini(12))^4/((Yini(5)+Yini(12))^4+Km^4)*tau); else X=X+v(jr,:)*geornd(inv(e1*(Yini(5)+Yini(12))^4/((Yini(5)+Yini(12))^4+Km^4)*tau)); end end end else X=X+v(jr,:)*num1; end elseif jr==8 if a(jr)*tau==0 k(jr)=0; elseif a(jr)*tau<=1 k(jr)=ceil(exprnd(a(jr)*tau)); else k(jr)=geornd(1/(a(jr)*tau)); end delay2=delay2*PERCENT*(2*rand-1)+delay2;%stochastic delays queue2=[queue2,t-tau+delay2+tau*rand(1,k(jr))]; queue2=sort(queue2); num2=numel(find(t>=queue2)); queue2=queue2(num2+1:end); if (t-tau)<=delay2 if a(jr)*tau==0 X=X+0; elseif e2*(Yini(5)+Yini(12))^4/((Yini(5)+Yini(12))^4+Kw^4)*tau<=1 X=X+v(jr,:)*poissrnd(e2*(Yini(5)+Yini(12))^4/((Yini(5)+Yini(12))^4+Kw^4)*tau); else X=X+v(jr,:)*geornd(inv(e2*(Yini(5)+Yini(12))^4/((Yini(5)+Yini(12))^4+Kw^4)*tau)); end else X=X+v(jr,:)*num2; end % p21 transcription elseif jr==26 if a(jr)*tau==0 k(jr)=0; elseif a(jr)*tau<=1 k(jr)=ceil(poissrnd(a(jr)*tau)); else k(jr)=geornd(1/(a(jr)*tau)); end delay5=delay5*PERCENT*(2*rand-1)+delay5;%stochastic delays queue5=[queue5,t-tau+delay5+tau*rand(1,k(jr))]; queue5=sort(queue5); num5=numel(find(t>=queue5)); queue5=queue5(num5+1:end); if (t-tau)<=delay5 if a(jr)*tau==0 X=X+0; elseif e3*Yini(12)^4/(Yini(12)^4+Kp^4)*tau<=1 X=X+v(jr,:)*poissrnd(e3*Yini(12)^4/(Yini(12)^4+Kp^4)*tau); else X=X+v(jr,:)*geornd(inv(e3*Yini(12)^4/(Yini(12)^4+Kp^4)*tau)); end else X=X+v(jr,:)*num5; end % translation and translocation reactions elseif jr==15 k(jr)=poissrnd(a(jr)*tau); delay3=delay3*PERCENT*(2*rand-1)+delay3;%stochastic delays queue3=[queue3,t-tau+delay3+tau*rand(1,k(jr))]; queue3=sort(queue3); num3=numel(find(t>=queue3)); queue3=queue3(num3+1:end); if (t-tau)<=delay3 X=X+v(jr,:)*poissrnd(rmdm2*Yini(2)*tau); else X=X+v(jr,:)*num3; end elseif jr==20 k(jr)=poissrnd(a(jr)*tau); delay4=delay4*PERCENT*(2*rand-1)+delay4;%stochastic delays queue4=[queue4,t-tau+delay4+tau*rand(1,k(jr))]; queue4=sort(queue4); num4=numel(find(t>=queue4)); queue4=queue4(num4+1:end); if (t-tau)<=delay4 X=X+v(jr,:)*poissrnd(rwip1*Yini(3)*tau); else X=X+v(jr,:)*num4; end elseif jr==28 k(jr)=poissrnd(a(jr)*tau); delay6=delay6*PERCENT*(2*rand-1)+delay6;%stochastic delays queue6=[queue6,t-tau+delay6+tau*rand(1,k(jr))]; queue6=sort(queue6); num6=numel(find(t>=queue6)); queue6=queue6(num6+1:end); if (t-tau)<=delay6 X=X+v(jr,:)*poissrnd(rp21*Yini(10)*tau); else X=X+v(jr,:)*num6; end else X=X+poissrnd(a(jr)*tau)*v(jr,:); end end Yrec=[Yrec;X]; trec=[trec;t]; end Nb=count_11+count_21; DSBtotal=count_10+count_20+count_11+count_21; close(h); figure(1); Yn=Yrec(:,4)+Yrec(:,5)+Yrec(:,12); i1=find(trec>=1200,1,'first'); i2=find(trec>=2400,1,'first'); Tn=trec(i1:i2); Yn2=Yn(i1:i2); Ynorm=normalize(Yn2); plot(Tn/60,Ynorm,'k.-','linewidth',4); hold on; xlim([20 40]); set(gcf,'color','w'); xlabel('Time (h)','fontsize',30,'fontname','arial','fontweight','bold'); set(gca,'linewidth',4,'xtick',20:5:40,'xticklabel',0:5:20,'fontsize',30,'fontweight','bold'); %toc; function out=randnumber tem=rand; if tem>=2/3 out=2; elseif tem<2/3 && tem>=1/3 out=1; else out=0; end % function to generate normalized output function out=normalize(Y) Ymax=max(Y); Ymin=min(Y); Yrange=Ymax-Ymin; out=zeros(length(Y),1); for i=1:length(Y) out(i)=(Y(i)-Ymin)/Yrange; end