distribution.oncotree {Oncotree} | R Documentation |
Find the event distribution defined by an oncogenetic tree
Description
distribution.oncotree
calculates the joint distribution
of the events defined by the tree, while marginal.distr
calculates the marginal probability of occurrence of each event.
Usage
distribution.oncotree(otree, with.probs = TRUE, with.errors=FALSE,
edge.weights=if (with.errors) "estimated" else "observed")
marginal.distr(otree, with.errors = TRUE,
edge.weights=if (with.errors) "estimated" else "observed")
Arguments
otree |
An object of class |
with.probs |
A logical value specifying if only the set of possible outcomes should be returned (if TRUE), or the associated probabilities of occurrence as well. |
with.errors |
A logical value specifying whether false positive and negative error rates should be incorporated into the distribution. |
edge.weights |
A choice of whether the observed or estimated
edge transition probabilities should be used in the calculation
of probabilities. See |
Value
For distribution.oncotree
: a data frame each row of which
gives a possible outcome.
For marginal.distr
: a named numeric vector - the names
are the event names (+ ‘Root’) and the values are the
corresponding marginal probability of occurrence.
Author(s)
Aniko Szabo
See Also
Examples
data(ov.cgh)
ov.tree <- oncotree.fit(ov.cgh[1:5])
#joint distribution
jj <- distribution.oncotree(ov.tree, edge.weights="obs")
head(jj)
# including errors - time/size exponential in number of events
jj.eps <- distribution.oncotree(ov.tree, with.errors=TRUE)
head(jj.eps)
#marginal distribution
marginal.distr(ov.tree, with.error=FALSE)
#marginal distribution calculated from the joint
apply(jj[1:ov.tree$nmut], 2, function(x){sum(x*jj$Prob)})
##Same with errors incorporated
#marginal distribution
marginal.distr(ov.tree, with.error=TRUE)
#marginal distribution calculated from the joint
apply(jj.eps[1:ov.tree$nmut], 2, function(x){sum(x*jj.eps$Prob)})