plot_failed_mapping_count: Plot Salmon failed mapping count

View source: R/rnaseq_workflow_qc.R

plot_failed_mapping_countR Documentation

Plot Salmon failed mapping count

Description

Create a Salmon failed mapping histogram and boxplot. The two plots are intended to be used as a single column, two row figure panel.

Usage

plot_failed_mapping_count(
  data,
  group = NULL,
  ids = NULL,
  invert = F,
  return_data = F,
  binsize = NULL,
  colors = NULL,
  hist_alpha = 0.75,
  box_fill = "goldenrod",
  box_alpha = 0.5,
  box_lwd = 1,
  jitter_alpha = 0.75,
  jitter_size = 1.75,
  x_title = paste0(c("Number of failed mappings", "for mapped fragments (millions)"),
    collapse = "\n"),
  y_title = "Sample count"
)

Arguments

data

A data frame with Salmon mapping data in the same format as salmon returned by load_paired_end_qc_data.

group

A single column data frame denoting categorical variable values to use to partition the data points into separate distributions/boxplots. Row names should match rownames in data.

ids

A vector of rownames for subsetting data for plotting.

invert

A logical. Should ids be used for excluding rows from plotting instead?

return_data

A logical. Should plot data be returned instead of a ggplot object?

binsize

A numeric value for the histogram bin widths.

colors

A string vector. The histogram bar colors and jitter colors for each categorical variable value.

hist_alpha

A numeric value for the alpha level for histogram bars.

box_fill

A string. The fill color for the boxplot.

box_alpha

A numeric value for the alpha level for the boxplot.

box_lwd

A numeric value for the boxplot line width.

jitter_alpha

A numeric for the alpha level for jittered data points.

jitter_size

A numeric for the point size for jittered data points.

x_title

A string denoting the x-axis title. Only added to the boxplot.

y_title

A string denoting the y-axis title. Only added to the histogram.

Value

A ggplot object unless return_data is TRUE, then a data frame with the mean of mean PHRED scores and grouping variable.

A list with two ggplot objects hist and boxplot corresponding to a histogram and jittered boxplot respectively. If return_data is TRUE, then a data frame with the plot data values and grouping variable.

See Also

\link{load_paired_end_qc_data}


bryancquach/omixjutsu documentation built on Jan. 29, 2023, 3:47 p.m.