Skip to contents

This function generates bar plots for protein abundance or fold change, normalized by either a reference protein or centered to the mean. The user can also plot the contrast of two conditions.

Usage

prot.plot_bar(
  dep,
  proteins,
  combine = FALSE,
  type = c("contrast", "centered", "ReferenceProt", "ReferenceCondition", "abundance"),
  ref.prot = NULL,
  ref.condition = NULL,
  contrast = NULL,
  col.id = "ID",
  name_table = NULL,
  match.id = "Accession",
  match.name = "Name",
  convert_name = FALSE,
  shape.size = 2.5,
  y.lim = NULL,
  basesize = 12,
  plot = TRUE,
  export = FALSE,
  export.nm = NULL,
  width = NULL,
  height = NULL
)

Arguments

dep

A SummarizedExperiment object containing the data.

proteins

A vector of protein names or IDs.

combine

Logical value indicating whether to combine the data from different proteins in one plot.

type

Type of plot: "abundance", "ReferenceProt", "ReferenceCondition", "centered", or "contrast".

ref.prot

ID or name of the reference protein for normalization when type is "ReferenceProt".

ref.condition

Name of the reference condition by which all average abundance values are divided when type is "ReferenceCondition".

contrast

Name of the contrast for plotting when type is "contrast".

col.id

Name of the column with protein IDs in dep.

name_table

A data frame containing the mapping of protein names to reference names.

match.id

The name of a column in name_table to find matches with col.id.

match.name

The name of a column in name_table to assign new names based on matches of col.id and match.id.

convert_name

Logical value indicating whether to convert the protein names to reference names based on name_table (e.g., gene names).

shape.size

Numeric value defining the (replicate) symbol size in the plot.

y.lim

Limits of the y axis (numeric vector of length 2). If NULL, will be inferred from data (unless combine=TRUE, then each chunk is plotted without that inference).

basesize

Base font size for the plot theme.

plot

Whether to immediately print/return the plot(s).

export

Logical; whether to export the plot(s) as PDF and PNG files.

export.nm

Name of the output PDF and PNG files if export = TRUE.

width

Numeric value defining the width of the exported plot (inches).

height

Numeric value defining the height of the exported plot (inches).

Value

(Invisibly) A ggplot object (or list of ggplot objects, if multiple chunks). If plot=TRUE, the plot(s) are also shown in the Plots pane.