Description Usage Arguments Value Examples
simulate data from DTM
1 2 3 4 5 6 7 8 9 10 | simulation_dtm(
p,
seed = 1,
N,
tree,
control_pi,
case_pi,
control_theta,
case_theta
)
|
p |
the number of taxa |
seed |
a random seed |
N |
sample size of each group |
tree |
a phylogenetic tree |
control_pi |
a probability vector for each taxon which were sum to 1 in control group |
case_pi |
a probability vector for each taxon which were sum to 1 in case group |
control_theta |
the over-dispersion parameter |
case_theta |
the over-dispersion parameter |
dtm_table the otu table
1 2 3 4 5 6 7 8 9 10 11 12 13 | p <- 40
set.seed(1)
tree <- simulate_tree(p)
control_pi = case_pi = c()
for(j in (p+1):(p+tree$Nnode)){
set.seed(j)
random_pi <- runif(1,0.2,0.4)
control_pi[which(tree$edge[,1]==j)] <- c(random_pi, 1-random_pi)
case_pi[which(tree$edge[,1]==j)] <- c(random_pi, 1-random_pi)}
control_theta = case_theta = rep(0.1, tree$Nnode)
group <- rep(c(0,1),each =20)
tree_table <- simulation_dtm(p=40,tree, seed=1, N=20,control_pi,
case_pi,control_theta,case_theta)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.