alphaBetaPlot: Makes Alpha ~ Beta Plots for BGC results

View source: R/alphaBetaPlot.R

alphaBetaPlotR Documentation

Makes Alpha ~ Beta Plots for BGC results

Description

This function generates an Alpha x Beta 2D density plot with polygon hulls encapsulating alpha and beta outliers. The plot can be printed to the plot window in Rstudio (default) or saved to file by specifying a file prefix with the saveToFile option.

Usage

alphaBetaPlot(
  outlier.list,
  overlap.zero = TRUE,
  qn.interval = TRUE,
  both.outlier.tests = FALSE,
  saveToFile = NULL,
  plotDIR = "./plots",
  showPLOTS = FALSE,
  device = "pdf",
  neutral.color = "gray",
  alpha.color = "blue",
  beta.color = "red",
  both.color = "purple",
  margins = c(150, 5.5, 5.5, 5.5),
  margin.units = "points",
  padding = 0.1,
  height = 7,
  width = 7,
  dim.units = "in",
  text.size = 18,
  dpi = 300,
  alpha_limits = NULL,
  beta_limits = NULL
)

Arguments

outlier.list

List of data.frames returned from get_bgc_outliers(). see ?get_bgc_outliers for more info

overlap.zero

Boolean. If TRUE, outliers include when the credible doesn't contain 0

qn.interval

Boolean. If TRUE, outliers = outside quantile interval

both.outlier.tests

If TRUE, outliers = both overlap.zero and qn.interval

saveToFile

If specified, saves plots to file. The value for saveToFile should be the prefix for the filename you want to save to

plotDIR

Directory path. If saveToFile is specified, plots are saved in this directory

showPLOTS

Boolean Whether to print the plots to the screen.

device

File format to save plot. Supports ggplot2::ggsave devices

neutral.color

Color for non-outlier loci. Default = "gray"

alpha.color

Color for alpha outlier loci. Default = "blue"

beta.color

Color for beta outlier loci. Default = "red"

both.color

Color for loci that are alpha and beta outliers. Default = "purple"

margins

Vector of margins for phi plot: c(Top, Right, Bottom, Left) Top is extended to include the Hybrid Index histogram

margin.units

Units for margins parameter. Default = "points"

padding

Padding to add to X and Y axes. Default=0.1

height

Height for plot. Default = 7

width

Width for plot. Default = 7

dim.units

Units for height and width. Default = "in"

text.size

Size for plot text. Default = 18

dpi

DPI for saving plot. Default = 300

alpha_limits

Limits (e.g., c(1,1) for plotting alpha. Default = NULL

beta_limits

Limits (e.g., c(1,1) for plotting beta. Default = NULL

line.size

Size of regression lines in plot. Default = 0.25

Details

Generates Alpha x Beta Density Plots, Highlighting Outliers.

Examples

alphaBetaPlot(outlier.list = outliers, saveToFile = "pop1_phiPlot",
plotDIR = "./bgc_plots", device = "png")

phiPlot(outlier.list = gene.outliers, ,
line.size = 0.1, qn.interval = FALSE, overlap.zero = FALSE,
both.outlier.tests = TRUE, saveToFile = "mus_phiPlot", showPLOTS=TRUE)

phiPlot(outlier.list = full.outliers,  overlap.zero = FALSE)

btmartin721/ClineHelpR documentation built on Oct. 15, 2024, 5:05 a.m.