Description Usage Arguments Details Value Examples
This is the function to generate simulation data.
1 | simulation2(ngene, ncell, ngroup, ntime, noise)
|
ngene |
number of genes |
ncell |
number of cells |
ngroup |
number of groups/clusters |
ntime |
number of time points |
noise |
standard derivation of white noises that were added onto cluster-level data |
This is the function to generate data for Table 1 and Table 2 in manuscript
cluExp |
cluExp is a list of matrices, each of them is cluster-level data at each time point. |
Net |
Net is a list of matrices, every matrix is the true network. |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 | ##---- Should be DIRECTLY executable !! ----
##-- ==> Define data, use random,
##-- or do help(data=index) for the standard data sets.
## The function is currently defined as
function (ngene, ncell, ngroup, ntime, noise)
{
m <- ngene
n <- ncell
k <- ngroup
p <- 0.01
N <- ntime
sim.groups <- simgroups(m, n, k)
Exp <- list()
length(Exp) <- N
Exp[[1]] <- logcounts(sim.groups)
cluExp <- list()
length(cluExp) <- N
for (i in c(1:N)) {
cluExp[[i]] <- matrix(0, m, k)
}
groupInfo <- colData(sim.groups)[3]
for (j in c(1:k)) {
tExp <- Exp[[1]]
ij <- rowMeans(as.matrix(tExp[, which(groupInfo[, 1] ==
paste("Group", j, sep = ""))]))
cluExp[[1]][, j] <- ij
}
Net <- list()
length(Net) <- N - 1
for (i in c(1:(N - 1))) {
Net[[i]] <- gzomat(m, m, p)
}
for (i in c(2:N)) {
cluExp[[i]] <- cluExp[[i - 1]] + Net[[i - 1]] %*% cluExp[[i -
1]]
}
for (i in c(1:N)) {
cluExp[[i]] <- cluExp[[i]] + noise * matrix(runif(m *
k), m)
}
return(list(cluExp, Net))
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.