Build a directed tree structure to model the process of occurrence
of genetic alterations (events) in carcinogenesis. The model is
described in more detail in Oncotree-package. Methods for
printing a short summary, displaying the tree on an R plot, and producing
latex code for drawing the tree (using the ‘pstricks’ and ‘pst-tree’ LaTeX packages)
are provided.
oncotree.fit(dataset, error.fun = function(x, y){sum((x - y)^2)})
# S3 method for oncotree
print(x, …)
# S3 method for oncotree
plot(x, edge.weights = c("none", "observed", "estimated"),
edge.digits=2, node.coords=NULL, plot=TRUE, cex = par("cex"),
col.edge=par("col"), col.text=par("col"), col.weight=par("col"),…)
pstree.oncotree(x, edge.weights=c("none","observed","estimated"), edge.digits=2,
shape=c("none","oval", "circle", "triangle", "diamond"),
pstree.options=list(arrows="->", treefit="loose",
arrowscale="1.5 0.8", nodesep="3pt"))A data frame or a matrix with variable names as a listing of genetic events taking on binary values indicating missing (0) or present (1). Each row is an independent sample.
A function of two variables that measures the
deviation of the observed marginal frequencies of the events
(which will be the first argument in the call) from the estimated ones.
The false positive and negative error rates are obtained by minimizing
error.fun. If error.fun=NULL is used, the error rates are not estimated.
An object of class oncotree.
Choice of edge weights to show on the plot.
The number of significant digits to use when displaying edge weights.
A matrix with node-coordinates or NULL if the coordinates should be computed automatically (default).
Logical; indicates whether the tree should be plotted.
Scaling factor for the text in the nodes.
color of the tree edges.
color of the node label.
color of the edge weights.
Ignored for print. For plot these can
be graphical parameters passed to lines when the edges are
drawn
The shape of the node in the pst-tree representation.
Additional options for pst-tree. See the pstricks documentation for possible values.
For oncotree.fit:
an object of class oncotree which has components
data frame used, after dropping events with zero observed frequency, and adding a column for the artificial ‘Root’ node
number of tree nodes: the number genetic events present in data +1 for the ‘Root’ node
a list containing information about the tree structure with the following components
childa character vector of the event names starting with ‘Root’
parenta character vector of the names of the parents of child
parent.numa numeric vector with column indices corresponding to parent
obs.weightsraw edge transition probabilites P(child|parent)
est.weightsedge transition probabilities adjusted for the error rates eps
a numeric vector of the depth of each node in the tree (1 for the root, 2 for its children, etc.)
a numeric vector giving the number of children for each node
a numeric vector of the number of nodes found at each level of the tree
a character matrix with its rows giving the ordered nodes at each level
a numeric vector of length two showing the estimated false positive and negative error rates (if error.fun is not NULL). Do not modify directly, but rather through error.rates<-.
For print.oncotree:
the original object is returned invisibly. It prints a summary showing the number of nodes, the parent-child relationships, and the false positive and negative error rates. For plot.oncotree:
a matrix with node-coordinates is returned invisibly. The column names of the matrix are the names of the nodes/events (including 'Root'), the rows gives the x- and y-coordinates, respectively. This matrix provides a valid input for node.coords. If plot=TRUE, a plot of the tree is produced. For pstree.oncotree:
a character string with the LaTeX code needed to draw a tree. \usepackage{pstricks,pst-tree} is required in the preamble of the LaTeX file, and it should be processed through a PostScript intermediary (DVIPS or similar) and not through PDFLaTeX.
‘pst-tree’ is a very flexible package, and very detailed formatting of the tree
is possible. pstree.oncotree provides some default settings for drawing
trees, but they can be easily overridden: most options can be set in
pstree.options, while the appearance of the tree nodes can be controlled
by defining a one-parameter \lab command that gives the desired appearance.
For example, if red, non-mathematical test is desired in an oval, you could use
\newcommand{\lab}[1]{\Toval[name=#1]{{\red #1}}}.
Szabo, A. and Boucher, K. (2002) Estimating an oncogenetic tree when false negative and positives are present. Mathematical Biosciences, 176/2, 219-236.
bootstrap.oncotree,error.rates<-,
generate.data,ancestors,distribution.oncotree
# NOT RUN {
data(ov.cgh)
ov.tree <- oncotree.fit(ov.cgh, error.fun=function(x,y){max(abs(x-y))})
ov.tree
nodes <- plot(ov.tree, edge.weights="est")
#move the Root node to the left
nodes["x","Root"] <- nodes["x","8q+"]
plot(ov.tree, node.coords=nodes)
#output for pstricks+pst-tree
pstree.oncotree(ov.tree, edge.weights="obs", shape="oval")
# }
Run the code above in your browser using DataLab