SRCGrob {CancerEvolutionVisualization}R Documentation

Subclone Tree Plot

Description

Creates a phylogenetic tree using subclonal reconstruction data. An optional node text data.frame can be used to annotate notable genes alonside branches.

Usage

SRCGrob(
    tree,
    node.text = NULL,
    main = NULL,
    horizontal.padding = 0.1,
    scale1 = 1,
    scale2 = 1,
    yat = NULL,
    yaxis1.label = NULL,
    yaxis2.label = NULL,
    xlab.cex = 1.55,
    ylab.cex = 1.55,
    xaxis.cex = 1.45,
    yaxis.cex = 1.45,
    xaxis.label = "CP",
    label.cex = NA,
    node.text.cex = 0.85,
    main.y = NULL,
    main.cex = 1.7,
    node.radius = 0.1,
    node.col = "grey29",
    seg1.col = "black",
    seg2.col = "green",
    line.lwd = 3,
    node.text.line.dist = 0.1,
    colour.scheme = CancerEvolutionVisualization::colours,
    draw.nodes = TRUE,
    add.normal = FALSE,
    normal.cex = 1,
    sig.shape = 3,
    label.nodes = TRUE,
    disable.polygons = FALSE,
    length.from.node.edge = TRUE,
    size.units = "npc"
    );

Arguments

tree

Tree structure data.frame

node.text

Dataframe for text labels to be displayed next to nodes

main

Main plot title

horizontal.padding

Increase/reduce the plot's horizontal padding proportionally. A positive value will expand the padding, and a negative value will reduce it.

scale1

Proportionally scale the values of the first branch length column in the tree input.

scale2

Proportionally scale the values of the second branch length column in the tree input.

yat

Specific values to be used for the y-axis ticks. A list is required, with each element corresponding to an axis.

yaxis1.label

Text label for the first, leftmost y-axis

yaxis2.label

Text label for the second, rightmost y-axis

xlab.cex

Font size for the x-axis label

ylab.cex

Font size for the y-axis labels

xaxis.cex

Font size for the x-axis tick labels

yaxis.cex

Font size for the y-axis tick labels

xaxis.label

Text label for the x-axis

label.cex

Font size for the node labels

node.text.cex

Font size for the node text

main.y

Move the main plot title position up or down

main.cex

Font size for the main plot title

node.radius

Node size

node.col

Node colour

seg1.col

Colour of the first set of tree branch segments

seg2.col

Colour of the second set of tree branch segments

line.lwd

Branch segment thickness

node.text.line.dist

Distance between node text and tree branches (as a value between 0 and 1)

colour.scheme

Vector of colour values to be used for CP polygons

draw.nodes

Enable or disable drawing tree nodes

add.normal

Adds a normal

normal.cex

Font size within the normal "box"

sig.shape

Changes the shape of the CP shading. Lower values are smoother.

label.nodes

Enable/disable node labels

disable.polygons

Disables CP polygon drawing (even when CP values are provided)

length.from.node.edge

Sets the branch length to be calculated from the edge of the node instead of the centre

size.units

Grid units to be used for all specific size/length parameters

Value

A 'grob' of class "SRCGrob"

Author(s)

Dan Knight

Examples

# Simple Tree Plot
simple.tree <- data.frame(
    parent = c(NA, 1, 1)
    );

SRCGrob(simple.tree);


# Specify Branch Lengths
branch.lengths.tree <- data.frame(
    simple.tree,
    length1 = c(10, 20, 15)
    );

SRCGrob(branch.lengths.tree);


# Cellular Prevalence
CP.tree <- data.frame(
    branch.lengths.tree,
    CP = c(1, 0.3, 0.5)
    );

SRCGrob(CP.tree);


# Scaled Branch Lengths
SRCGrob(
    branch.lengths.tree,
    scale1 = 0.8
    );


# Plot Title
SRCGrob(
    simple.tree,
    main = 'Example Plot'
    );


# Y-Axis Label
SRCGrob(
    branch.lengths.tree,
    yaxis1.label = 'SNVs'
    );


# Y-Axis Ticks
yaxis1.ticks <- seq(0, 10, 2);

SRCGrob(
    branch.lengths.tree,
    yat = list(yaxis1.ticks)
    );


# Normal
SRCGrob(
    simple.tree,
    add.normal = TRUE
    );

[Package CancerEvolutionVisualization version 1.0.1 Index]