% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/enrichment_util.R
\name{plot_enrichment_network}
\alias{plot_enrichment_network}
\title{Function for making network visualisation based on enrichment result, DE gene table and thresholding.
Can take the input tables either as data frames or Excel files}
\usage{
plot_enrichment_network(
  enrichment.result,
  DE.result,
  plot.filename,
  show.terms = 5,
  logfc.thr = NULL,
  fdr.thr = NULL,
  pdf.width = 11,
  pdf.height = 8,
  legend.cex.main = 0.8,
  legend.cex.text = 0.7
)
}
\arguments{
\item{enrichment.result}{data.frame; output of the enrichment tool. In general, a data frame with all
columns needed for the plot.}

\item{DE.result}{data.frame; fold-change table with corresponding statistics, e.g., the output of \code{topTable()} for
a particular contrast.}

\item{plot.filename}{character; name of the output image file. The file extension can be omitted and will be added internally.}

\item{show.terms}{integer; Number of enrichment terms to be plotted, i.e., the first \code{Integer} rows of \code{enrichment.result}.}

\item{logfc.thr}{\code{numeric}. Fold-change threshold on the log2-scale.}

\item{fdr.thr}{\code{numeric}. Threshold for adjusted p-values (applied in both filtering of DE-genes and in enrichment results). Default 0.05}

\item{pdf.width, pdf.height}{Numeric; width and height of the PDF graphics region in inches.}

\item{legend.cex.main, legend.cex.text}{Numeric; text sizes of legend title and text, given as character expansion
(magnification) relative to the default.}
}
\value{
No return value. Called for its side effect of writing a network visualisation of the
  enrichment result to the file given by \option{plot.filename}.
}
\description{
Function for making network visualisation based on enrichment result, DE gene table and thresholding.
Can take the input tables either as data frames or Excel files
}
\examples{
\donttest{
# builds a network plot from an enrichment result and writes it to 'plot.filename'
if (requireNamespace("igraph", quietly = TRUE)) {
  enr <- data.frame(Description = c("Pathway A", "Pathway B"),
                    genes = c("G1,G2,G3", "G3,G4,G5"))
  de <- data.frame(gene_symbol = paste0("G", 1:5),
                   logFC = c(2.5, -1.8, 1.2, -2.1, 0.9),
                   FDR = c(0.001, 0.002, 0.01, 0.003, 0.02))
  plot_enrichment_network(enr, de,
                          plot.filename = file.path(tempdir(), "network.pdf"))
}
}
}
