Learn R Programming

Oncotree (version 0.3.2)

oncotree: Build and display an oncogenetic tree

Description

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.

Usage

oncotree.fit(dataset, error.fun = function(x, y){sum((x - y)^2)})
  ## S3 method for class 'oncotree':
print(x, \dots)
  ## S3 method for class '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"))

Arguments

dataset
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.
error.fun
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 min
x
An object of class oncotree.
edge.weights
Choice of edge weights to show on the plot.
edge.digits
The number of significant digits to use when displaying edge weights.
node.coords
A matrix with node-coordinates or NULL if the coordinates should be computed automatically (default).
plot
Logical; indicates whether the tree should be plotted.
cex
Scaling factor for the text in the nodes.
col.edge
color of the tree edges.
col.text
color of the node label.
col.weight
color of the edge weights.
...
Ignored for print. For plot these can be graphical parameters passed to lines when the edges are drawn
shape
The shape of the node in the pst-tree representation.
pstree.options
Additional options for pst-tree. See the pstricks documentation for possible values.

Value

  • For oncotree.fit: an object of class oncotree which has components
  • datadata frame used, after dropping events with zero observed frequency, and adding a column for the artificial Root node
  • nmutnumber of tree nodes: the number genetic events present in data +1 for the Root node
  • parenta list containing information about the tree structure with the following components
    • child
    {a character vector of the event names starting with Root} parent{a character vector of the names of the parents of child} parent.num{a numeric vector with column indices corresponding to parent} obs.weights{raw edge transition probabilites P(child|parent)} est.weights{edge transition probabilities adjusted for the error rates eps}

item

  • level
  • numchild
  • levelnodes
  • levelgrp
  • eps

code

\usepackage{pstricks,pst-tree}

Details

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]{{#1}}}. Szabo, A. and Boucher, K. (2002) Estimating an oncogenetic tree when false negative and positives are present. Mathematical Biosciences, 176/2, 219-236. [object Object] bootstrap.oncotree,error.rates<-, generate.data,ancestors,distribution.oncotree 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") models tree graphs hplot