library(ADASPR)
kon<-c(3E4, 2E4, 1E4)
#koff<-c(1E-5, 1E-4, 1E-5)
koff<-c(1E-4, 1E-3, 1E-4)
analyteConcentrations<-c(#2E-6,
1E-6,
5E-7,
2.5E-7,
1.25E-7,
6.25e-8#, #3.125e-8#, 1.25e-8#, 6.25e-9, 3.125e-9
)
associationLength<-1000
dissociationLength<-1500 #3000
Rmax<-c(80, 80, 70)
mlgm<- new("MultiLigandModel", kon=kon, koff=koff, analyteConcentrations=analyteConcentrations,
associationLength=associationLength, dissociationLength=dissociationLength, Rmax=Rmax)
set.seed(2)
sData<-Simulate(mlgm,sampleFreq=0.1, sd=0.1) #for kon us sampleFreq=0.05
plot(sData[[1]])
fss<-FitSteadyStateSPR(sData[[1]], degree=2, steadyStateStart=990,steadyStateEnd=1000, auto=T)
fcp.on<-fitSPR.kon(sData[[1]],debug=TRUE,weights.type="exp", degree=100, weights.step=0.05, weights.scale=83,#25
Rmax=230 #,mode=2
)#step 10~20, weights.scale=8.5
e_k<-rep(0,length(analyteConcentrations))
e_k[1]<-sum(koff/kon*(Rmax/sum(Rmax)))
e_k[2]<-sum((koff/kon)^2*(Rmax/sum(Rmax)))
e_k[3]<-sum((koff/kon)^3*(Rmax/sum(Rmax)))
e_k[4]<-sum((koff/kon)^4*(Rmax/sum(Rmax)))
#first get the distribution of Rmax
E_kon<-rep(0,length(kon))
E_kon[1]<-sum(Rmax/sum(Rmax)*kon)
E_kon[2]<-sum(Rmax/sum(Rmax)*kon^2)
E_kon[3]<-sum(Rmax/sum(Rmax)*kon^3)
E_kon[4]<-sum(Rmax/sum(Rmax)*kon^4)
E_kon[5]<-sum(Rmax/sum(Rmax)*kon^5)
fpc.off<-fitSPR.koff(sData[[1]], debug=TRUE,degree.fitMoments=4, weightsType.fitSPR="uniform",degree.fitSPR=6,#7
,weightsScale.fitSPR=220#220,
,weightsStep.fitSPR=0.5#0.05,
,weightsType.fitMoments="exp", weightsScale.fitMoments=0.5);
fpc.off$Rmax.distributed/fpc.off$Rmax.distributed[1]
#for(i in 1:length(analyteConcentrations))
#{
# E_koff1[i]<-sum(koff*r0[i,]/sum(r0[i,]))
# E_koff2[i]<-sum(koff^2*r0[i,]/sum(r0[i,]))
# E_koff3[i]<-sum(koff^3*r0[i,]/sum(r0[i,]))
# E_koff4[i]<-sum(koff^4*r0[i,]/sum(r0[i,]))
#}
#expected koff moments over Rmax
E_koff<-rep(0,7)
E_koff[1]<-sum(Rmax)
E_koff[2]<-sum(koff*Rmax/sum(Rmax))
E_koff[3]<-sum(koff^2*Rmax/sum(Rmax))
E_koff[4]<-sum(koff^3*Rmax/sum(Rmax))
E_koff[5]<-sum(koff^4*Rmax/sum(Rmax))
E_koff[6]<-sum(koff^5*Rmax/sum(Rmax))
E_koff[7]<-sum(koff^6*Rmax/sum(Rmax))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.