% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/de_plots.R
\name{diff_expr_volcano_plot}
\alias{diff_expr_volcano_plot}
\title{Function to generate a Volcano plot using `ggplot2`}
\usage{
diff_expr_volcano_plot(
  d3,
  id,
  sym.col = "gene_symbol",
  main = NULL,
  p.thr = 0.05,
  fdr.thr = 0.05,
  logfc.thr = 1,
  numlab = 25,
  point.lab = TRUE,
  base.size = 16
)
}
\arguments{
\item{d3}{\code{data.frame}. Data frame containing all necessary columns to generate a Volcano plot with gene labels (at least p-values, FDR values, log-ratios and gene symbols or other IDs)}

\item{id}{\code{character}. Name of the gene ID column. Can be the same as `sym.col` but usually refers to an additional column with, e.g., Ensembl Gene IDs.}

\item{sym.col}{\code{character}. Name of column with gene symbols, e.g., HGNC Symbols.}

\item{main}{\code{character}. Main plot title. (Will be complemented with additional information, e.g., 'FDR' when labelling according to and FDR threshold.)}

\item{p.thr}{\code{numeric}. Plotted values with a P-Value below this threshold will be labelled in the P-Value plot.}

\item{fdr.thr}{\code{numeric}. Plotted values with a FDR below this threshold will be labelled in the FDR plot.}

\item{logfc.thr}{\code{numeric}. Plotted (`abs`olute) values above this threshold will have bigger dots.}

\item{numlab}{\code{numeric}. Maximum number of labels per plot. Takes precedence to numbers calculated based on `p.thr` and `fdr.thr`.}

\item{point.lab}{\code{logical}. Should points be labelled, at all?}

\item{base.size}{\code{numeric}. Overall text/point scale passed on to \code{prepare_volcano_of_given_property}
(the `ggplot2` \code{base_size}, default 16). Raise it to enlarge legend, axes, labels and points together
when printing to a large device (e.g. the 15x15 inch pipeline PDF).}
}
\value{
A named \code{list} of \code{ggplot} objects with the elements \code{FDR} and \code{Pval},
  holding the volcano plot with points highlighted by false discovery rate and by p-value,
  respectively. Both plots are additionally printed, so that they are captured when the function is
  called with an open plotting device.
}
\description{
`diff_expr_volcano_plot` generates two Volcano plots highlighting genes that are differentially expressed beyond custom thresholds for significance (set by parameters `p.thr` and fdr.thr`) and differential expression level (set by parameter `logfc.thr`).
}
\examples{
\donttest{
set.seed(1)
d3 <- data.frame(gene_symbol = paste0("G", 1:100),
                 logFC = rnorm(100), PValue = runif(100), FDR = runif(100))
g <- diff_expr_volcano_plot(d3, id = "gene_symbol", sym.col = "gene_symbol")
names(g)
}
}
