rcts <- c("HSC->T", ## reactions
"HSC->M",
"T->0",
"M->0")
cnstr <- NULL
latsts <- "HSC" ## latent cell types
ctps <- unique(setdiff(c(sapply(rcts, function(r){ ## all cell types
as.vector(unlist(strsplit(r, split = "->", fixed = TRUE)))
}, simplify = "array")), c("0", "1")))
## simulation parameters:
S <- 100 ## trajectories length
nCL <- 2 ## number of clones
X0 <- rep(0, length(ctps)) ## initial condition
names(X0) <- ctps
X0["HSC"] <- 1
ntps <- 5 ## number of time-points
f_NA <- 0 ## fraction of observed data
th.true <- c(1.9538674, 1.0559815, 0.7232172, 0.7324133) ## dynamic parameters
names(th.true) <- rcts
s2.true <- 1e-8 ## additonal noise
r0.true <- .1 ## intercept noise parameter
r1.true <- .01 ## slope noise parameter
## simulate trajectories:
XY <- get.sim.trajectories(rct.lst = rcts,
constr.lst = cnstr,
latSts.lst = latsts,
ct.lst = ctps,
th = th.true,
S = S,
nCL = nCL,
X0 = X0,
s2 = s2.true,
r0 = r0.true,
r1 = r1.true,
f = f_NA,
ntps = ntps,
trunc = FALSE)
XY$X ## process
XY$Y ## measurements
Run the code above in your browser using DataLab