Perform differential expression and create a volcano plot.

ggvolcano(
  m = NULL,
  group = NULL,
  group2 = NULL,
  dea.res = NULL,
  pmethod = "BH",
  alternative = NULL,
  logp = 2,
  lfc = 1,
  n = 10,
  selected = NULL,
  add.to.selected = NULL,
  selected.col = "red",
  xlab = "Log2 Fold Change",
  ylab = "-Log10 P-value (adjusted)",
  symmetric = TRUE,
  xintercept = 0,
  segment.colour = "grey30",
  text.size = 14,
  label.size = 5,
  legend.text.size = 12,
  ymax = NULL,
  xlim = NULL
)

Arguments

m

A matrix of features (e.g. genes) by observations (e.g. cells). Default: NULL

group

The group (of observations) to test. This should be a character vector or a two-level factor in which the first level corresponds to the group. Default: NULL

group2

A second group to test against. This should be a character vector. If 'group2=NULL', defaults to all remaining observations in the matrix 'm'. Default: NULL

dea.res

The output of scalop::dea(..., return.val = 'df'). If provided, the function will not perform DEA and skip straight to plotting. Default: NULL

pmethod

The correction method for multiple testing, or 'none' if no correction is desired. See stats::p.adjust.methods for options. Default: 'BH'

alternative

The alternative hypothesis. If 'alternative=NULL' and 'group2' was provided, defaults to 'two-sided'. Else defaults to 'greater'. Default: NULL

logp

The minimum -log10(P) value at which differential expression is considered significant. Default: 2

lfc

The minimum log2 foldchange value at which differential expression is considered signficant. Default: 1

n

The number of top features to display. Default: 10

selected

Default: NULL

add.to.selected

PARAM_DESCRIPTION, Default: NULL

selected.col

PARAM_DESCRIPTION, Default: 'red'

xlab

X-axis title. Default: 'Log2 Fold Change'

ylab

Y-axis title. Default: '-Log10 P-value (adjusted)'

symmetric

PARAM_DESCRIPTION, Default: TRUE

xintercept

One or more numeric values to be added as vertical delimiters to the plot. Default: 0

text.size

Axes text size. Default: 14

label.size

Feature label text sizes. Default: 5

legend.text.size

Legend text size. Default: 12

ymax

Y-axis upper limit. If 'NULL', defaults to the maximum -log10(P) value. Setting 'ymax' can be useful to 'zoom in' on the y-axis, making feature points/labels below 'ymax' easier to see. Default: NULL

xlim

PARAM_DESCRIPTION, Default: NULL

Value

A list containing:

  • data: A data frame; the differential expression results used in the plotting.

  • G: A ggplot2 object; the volcano plot.

Details

DETAILS

See also

Examples

if (FALSE) {
if(interactive()){
 #EXAMPLE1
 }
}