plot_pangenome_cumulative: plot_pangenome_cumulative

View source: R/plot_pangenome_cumulative.R

plot_pangenome_cumulativeR Documentation

plot_pangenome_cumulative

Description

Plots the cumulative branch length versus the cumulative number of gene gain and loss events. This is similar to the style of plot produced by TempEst. This function plots only the data points as the fit can not be included as Panstripe models the individual branches rather than the cumulative total.

Usage

plot_pangenome_cumulative(
  fit,
  plot = TRUE,
  legend = TRUE,
  text_size = 14,
  color_pallete = 6,
  facet = FALSE,
  smooth = FALSE
)

Arguments

fit

the result of running the 'panstripe' function. Multiple fits can be passed as a named list.

plot

whether to generate the plot (default) or return a data.frame

legend

toggles the display of the legend on and off

text_size

the base text size of the plot (default=14)

color_pallete

the pallete number passed to 'scale_fill_brewer'

facet

whether or not to generate separate plots for each pangenome (default=FALSE).

smooth

adds a linear line to aid the eye in seeing patters. This is NOT the model fit inferred by Panstripe. (default=FALSE)

Value

either a ggplot2 object or a 'data.frame' with the data needed to recreate the plot

Examples


sim <- simulate_pan(rate=1e-4)
fA <- panstripe(sim$pa, sim$tree, nboot=0)
plot_pangenome_cumulative(fA, color_pallete=6)
sim <- simulate_pan(rate=1e-3)
fB <-panstripe(sim$pa, sim$tree, nboot=0)
plot_pangenome_cumulative(list(a=fA,b=fB), color_pallete=6, smooth=TRUE)


gtonkinhill/panstripe documentation built on Feb. 27, 2025, 9:01 p.m.