simulate                package:SBMLR                R Documentation

_S_i_m_u_l_a_t_e _a _m_o_d_e_l _o_f _c_l_a_s_s _S_B_M_L

_D_e_s_c_r_i_p_t_i_o_n:

     This function simulates a model given the report times and
     optional modulators. It uses 'lsoda' of the odesolve package.

_U_s_a_g_e:

     simulate(model, times, modulator=NULL,X0=NULL)

_A_r_g_u_m_e_n_t_s:

   model: The model object to be simulated. Initial conditions are
          passed through this object.

   times: The sequence of time points to be sampled and provided as
          rows of the output matrix.

modulator: Null if there are no modulators (default),  a vector of
          numbers if there are steady state Vmax modulators,   and a
          list of interpolating functions if there are time course Vmax
          modulators. 

      X0: Override model initial conditions in simulations,
          particularly piece-wise perturbation simulations.

_D_e_t_a_i_l_s:

     This is a wrapper for lsoda.

_V_a_l_u_e:

     The data frame output that comes out of 'lsoda'.

_N_o_t_e:

     Rules are implemented through time varying boundary conditions
     updated at each time point  as a side effect within the (now
     internal) function 'fderiv'.

_A_u_t_h_o_r(_s):

     Tomas Radivoyevitch

_R_e_f_e_r_e_n_c_e_s:

     For the folate cycle example given below: Morrison PF, Allegra CJ:
     Folate cycle kinetics in human  breast cancer cells. JBiolChem
     1989, 264(18):10552-10566.

_S_e_e _A_l_s_o:

     'getModelInfo'

_E_x_a_m_p_l_e_s:

     ##---- The following example performs a perturbation in PRPP from 5 to 50 uM in Curto et al.'s model.
     library(SBMLR) 
     library(odesolve)
     curto=readSBML(file.path(.path.package("SBMLR"), "models/curto.xml"))  
     out1=simulate(curto,seq(-20,0,1))
     curto$species$PRPP$ic=50
     out2=simulate(curto,0:70)
     outs=data.frame(rbind(out1,out2))
     attach(outs)
     par(mfrow=c(2,1))
     plot(time,IMP,type="l")
     plot(time,HX,type="l")
     par(mfrow=c(1,1))
     detach(outs)

     # which should be the same plots as 
     curto=readSBMLR(file.path(.path.package("SBMLR"), "models/curto.r"))  
     out1=simulate(curto,seq(-20,0,1))
     curto$species$PRPP$ic=50
     out2=simulate(curto,0:70)
     outs=data.frame(rbind(out1,out2))
     attach(outs)
     par(mfrow=c(2,1))
     plot(time,IMP,type="l")
     plot(time,HX,type="l")
     par(mfrow=c(1,1))
     detach(outs)

     ##---- The following example uses fderiv to generate Morrison's folate system response to 1uM MTX 

     morr=readSBMLR(file.path(.path.package("SBMLR"), "models/morrison.r"))  
     out1=simulate(morr,seq(-20,0,1))
     morr$species$EMTX$ic=1
     out2=simulate(morr,0:30)
     outs=data.frame(rbind(out1,out2))
     attach(outs)
     par(mfrow=c(3,4))
     plot(time,FH2b,type="l",xlab="Hours")
     plot(time,FH2f,type="l",xlab="Hours")
     plot(time,DHFRf,type="l",xlab="Hours")
     plot(time,DHFRtot,type="l",xlab="Hours")
     plot(time,CHOFH4,type="l",xlab="Hours")
     plot(time,FH4,type="l",xlab="Hours")
     plot(time,CH2FH4,type="l",xlab="Hours")
     plot(time,CH3FH4,type="l",xlab="Hours")
     plot(time,AICARsyn,type="l",xlab="Hours")
     plot(time,MTR,type="l",xlab="Hours")
     plot(time,TYMS,type="l",xlab="Hours")
     #plot(time,EMTX,type="l",xlab="Hours")
     plot(time,DHFReductase,type="l",xlab="Hours")
     par(mfrow=c(1,1))
     detach(outs)
     morr$species$EMTX$ic=0

