plot-codonFreq: Plot the relative frequencies of codons in a 'codonFreq'...

codonPlot,codonFreq-methodR Documentation

Plot the relative frequencies of codons in a codonFreq object.

Description

Plot the relative frequencies of codons in a codonFreq object.

Boxplots of normalised codon usage by amino acid (i.e codon bias) in a codonFreq object.

GC3 plots: plot the 3rd-codon GC content for sequences in a codonFreq object.

Usage

## S4 method for signature 'codonFreq'
codonPlot(
  object,
  fname = NA_character_,
  units = "in",
  width = 10,
  height = 7,
  dpi = 600,
  groups = NULL,
  ptype = "boxplot",
  order = "median",
  colour = 1,
  suppress_x_txt = FALSE,
  suppress_y_title = FALSE,
  label = NULL,
  highlight = NULL,
  save = FALSE
)

## S4 method for signature 'codonFreq'
biasPlot(
  object,
  fname = NA_character_,
  units = "in",
  width = 10,
  height = 7,
  dpi = 600,
  groups = NULL,
  aa = NULL,
  norm = FALSE,
  label = NULL,
  colours = NULL,
  suppress_y_txt = FALSE,
  suppress_y_title = FALSE,
  legend = TRUE,
  ylim = NULL,
  save = FALSE
)

## S4 method for signature 'codonFreq'
gcPlot(
  object,
  fname = NA_character_,
  units = "in",
  width = 10,
  height = 7,
  dpi = 600,
  groups = NULL,
  aa = NULL,
  norm = FALSE,
  label = NULL,
  colours = NULL,
  suppress_y_txt = FALSE,
  suppress_y_title = FALSE,
  legend = TRUE,
  xlim = NULL,
  outtab = NULL,
  save = FALSE
)

Arguments

object

A codonFreq object.

fname

Character, name of figure generated.

units

Numeric, units to be used for defining the plot size. Options are "in" (default), "cm", and "mm".

width

Numeric, width of the figure (in units).

height

Numeric, height of the figure (in units).

dpi

Numeric, resolution of the figure (default = 600).

groups

Character, optional vector giving groups for each of the sequences in the codonFreq object. If not supplied, the sequences will be treated as a single group.

ptype

Character, type of plot to make. Options are "boxplot" (default) and "jitter".

order

Character, determines how codons are order. The default (median) sorts codons by median usage in the full dataset. An alternative option is "alphabetical". A vector of (64) codons can also be passed, which will be used for ordering, exactly as in the vector.

colour

Integer, between 1 and 9, which specifies the colour to be used from the 'Set1' palette in the 'RColorBrewer' package. Only applies to non-grouped plots. Default = 1 (red).

suppress_x_txt

Logical, suppress x axis labels? Default = FALSE.

suppress_y_title

Logical, suppress y axis title? Default = FALSE.

label

Character, optional label to add to the plotting area.

highlight

Character (optional) codons in this vector will be highlighted.

save

Logical, save the plot to file? Default = FALSE.

aa

Character, amino acid for which codon bias plot will be made (must be specified using single letter IUPAC code).

norm

Logical, should the data be normalised? If TRUE, a normalisation step will be performed. Default = FALSE.

colours

Optional vector of same length as 'groups', containing integers between 1 and 9, which specifies the colours to be used from the 'Set1' palette in the RColorBrewer package. By default, the Set1 order is used.

suppress_y_txt

Logical, suppress y axis labels? Default = FALSE.

legend

Logical, plot a legend? Default = TRUE.

ylim

Numeric vector, gives the y-axis limits (if not supplied, they will be chosen based on the data).

xlim

Numeric vector, gives the x-axis limits (if not supplied, they will be chosen based on the data).

outtab

Character (optional); name of file to which GC3 data will be saved. Format is tab-delimited.

Value

A ggplot object.

A ggplot object.

A ggplot object.


adamd3/codondiffR documentation built on Sept. 3, 2022, 2:26 a.m.