%Apl binding site code function WS5=MBUFRshift5(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=5; 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=1:100; C_range=10*(1:320); for k=1:length(C_range) c=C_range(k); for j=1:N %for each state for i=4:8 if A(j,i)==1 W(j)=c*d*(B+U)*W(j);%01111111 end i=i+1; end for l=4: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 if D(j)==5 W5(j)=W(j); end end FREE(k,1)=1/sum(W); %the states where RNAP binds W0F5(k)=sum(W0)/sum(W); W1F5(k)=sum(W1)/sum(W); W2F5(k)=sum(W2)/sum(W); W3F5(k)=sum(W3)/sum(W); W4F5(k)=sum(W4)/sum(W); W5F5(k)=sum(W5)/sum(W); k=k+1; W=ones(N,1); end WS5(:,1)=C_range; WS5(:,2)=W0F5; WS5(:,3)=W1F5; WS5(:,4)=W2F5; WS5(:,5)=W3F5; WS5(:,6)=W4F5; WS5(:,7)=W5F5; % subplot(1,2,1) % plot(C_range,FREE(:,1),'r') subplot(2,4,4) plot(C_range,W0F5,'g',C_range, W1F5,'r',C_range, W2F5,'b',C_range, W3F5,'m',C_range, W4F5,'g',C_range, W5F5,'y') title('Five site shift')