Learn R Programming

rphast (version 1.6.9)

plot.lsmodel.tm: Make a bubble plot of a lineage-specific transition matrix of a tree model.

Description

Make a bubble plot of a lineage-specific transition matrix of a tree model.

Usage

# S3 method for lsmodel.tm
plot(x, i = 1, show.eq.freq = TRUE, max.cex = 10,
  eq.freq.max.cex = 5, alphabet = NULL, col = NULL, eq.freq.col = NULL,
  filled = TRUE, add = FALSE, ...)

Arguments

x

An object of type tm.

i

An integer identifying which element of tm[["ls.model"]] to plot.

show.eq.freq

If TRUE, show bubbles representing equilibrium frequencies along the bottom of plot.

max.cex

A scaling factor which determines the size of the largest circle

eq.freq.max.cex

A scaling factor which determines the size of the largest circle in the equilibrium frequencies.

alphabet

A character vector representing the state names for each row/column of the matrix. Can either be a vector of size nrow(m) or a single character string with nrow(m) characters. Can also be NULL for no row/column labels.

col

If NULL, all circles will be drawn in black. Otherwise, col can be a matrix of the same dimension of m, each entry should indicate the color used for the corresponding cell in the transition matrix.

eq.freq.col

Should be vector of same length as eq.freq, though values will be recycled. Values in the vector indicate colors to draw the equilibrium frequency bubbles.

filled

If TRUE, plot filled circles.

add

If TRUE, add to the existing plot. Otherwise create a new plot.

...

Further arguments to be passed to plot.

Examples

Run this code
# NOT RUN {
exampleArchive <- system.file("extdata", "examples.zip", package="rphast")
filename <- "rev.mod"
unzip(exampleArchive, filename)
tm <- read.tm(filename)
tm <- add.ls.mod(tm, branch="mm9", subst.mod="HKY85")
plot.lsmodel.tm(tm, 1)
tm$ls.model$backgd <- c(0.9, 0.05, 0.03, 0.02)
plot.lsmodel.tm(tm, 1)
plot.rate.matrix(tm[["rate.matrix"]],
                 eq.freq=tm[["backgd"]],
                 filled=FALSE,
                 alphabet=tm[["alphabet"]])
unlink(filename)
# }

Run the code above in your browser using DataLab