# 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
);
# Override Branch Angles in Degrees
degrees.tree <- data.frame(
parent = c(NA, 1, 2),
angle = c(NA, NA, 90)
);
SRCGrob(degrees.tree);
# Override Branch Angles in Radians
radians.tree <- data.frame(
parent = c(NA, 1, 2),
angle = c(NA, NA, pi / 2)
);
SRCGrob(
radians.tree,
use.radians = TRUE
);
# 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
);
Run the code above in your browser using DataLab