Generates random event occurrence data based on an oncogenetic tree model.
1 2 3  generate.data(N, otree, with.errors=TRUE,
edge.weights=if (with.errors) "estimated" else "observed",
method=c("S","D1","D2"))

N 
The required sample size. 
otree 
An object of the class 
with.errors 
A logical value specifying whether false positive and negative errors should be applied. 
edge.weights 
A choice of whether the observed or estimated
edge transition probabilities should be used in the calculation
of probabilities. See 
method 
Simulation method, see Details for explanation of the options. 
There are three choices for the method of simulation; the best choice depends on the size of the tree, required sample size, and whether errors are needed.
Method “S” generates the data based on the conditional probability definition
of the oncogenetic tree, and then ‘corrupts’ the resulting sample by
introducing random errors. This method is applicable in all circumstances, but can
be slower than other methods if N
is large and with.errors=FALSE
is used.
Method “D1” calculates the joint distribution generated by the
tree exactly (using distribution.oncotree
),
and the observations are generated by sampling this distribution. Thus if
with.errors=TRUE
and the tree is large, this method might fail due
to the exponential growth in the number of potential outcomes. On the
other hand, for a moderately sized tree and a large desired sample size
N
this is the most efficient method.
Method “D2” calculates the joint distribution generated by the tree without
false positives/negatives, samples from it, and then ‘corrupts’ the
resulting sample. If with.errors=FALSE
is used then this method is
equivalent to method “D1”.
A data set where each row is an independent observation.
Aniko Szabo
1 2 3 4 5 6 7 8 9 10  data(ov.cgh)
ov.tree < oncotree.fit(ov.cgh)
set.seed(7365)
rd < generate.data(200, ov.tree, with.errors=TRUE)
#compare timing of methods
system.time(generate.data(20, ov.tree, with.errors=TRUE, method="S"))
system.time(generate.data(20, ov.tree, with.errors=TRUE, method="D1"))
system.time(generate.data(20, ov.tree, with.errors=TRUE, method="D2"))

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.
All documentation is copyright its authors; we didn't write any of that.