%Apl binding site code function WS4=MBUFRshift4(B,U,F,d) %B is the specific binding constant,U ia the non-specific binding constant, %F is the cooperation constant, n is the number of Apl binding sites n=4; N=2^n; %N is the number of states with n sites W=ones(N,1);%seven sites l=2; %pre-determined for loop indexes k=0; j=0; i=2; A=state(n);%this makes A matrix of n*N, where each row is a unique possible state %C_range=50*[0,1, 2, 4, 8, 16] C_range=10*(1:320); for k=1:length(C_range) c=C_range(k); for j=1:N %for each state for i=5:8 if A(j,i)==1 W(j)=c*d*(B+U)*W(j);%01111111 end i=i+1; end for l=5:7 if A(j,l)==1 && A(j,l+1)==1 W(j)=F*W(j); %01111111 end l=l+1; end D(j)=sum(A(j,:)); if D(j)==0 W0(j)=W(j); end if D(j)==1 W1(j)=W(j); end if D(j)==2 W2(j)=W(j); end if D(j)==3 W3(j)=W(j); end if D(j)==4 W4(j)=W(j); end end FREE(k,1)=1/sum(W); %the states where RNAP binds W0F(k)=sum(W0)/sum(W); W1F(k)=sum(W1)/sum(W); W2F(k)=sum(W2)/sum(W); W3F(k)=sum(W3)/sum(W); W4F(k)=sum(W4)/sum(W); k=k+1; W=ones(N,1); end WS4(:,1)=C_range; WS4(:,2)=W0F; WS4(:,3)=W1F; WS4(:,4)=W2F; WS4(:,5)=W3F; WS4(:,6)=W4F; %BD=[0, 0.110, 0.310, 0.457, 0.629, 0.809, 0.868, 0.960]; %old bound Data %UB=ones(1,length(BD))-BD; %unbound data %UB=[1, 0.931,0.805,0.712,0.604,0.490] %suma=W0F+W1F+W2F+W3F+W4F; %subplot(1,2,1) %plot(C_range,FREE(:,1),'r',C_range,UB,'b') subplot(2,4,3) plot(C_range,W0F,'g',C_range, W1F,'r',C_range, W2F,'b',C_range, W3F,'m',C_range, W4F,'g') title('Four site shift')