% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/de_util.R
\name{diffr_expr_generate_cleaned_de_table_output}
\alias{diffr_expr_generate_cleaned_de_table_output}
\title{Helper function to generate an output table with only most relevant columns}
\usage{
diffr_expr_generate_cleaned_de_table_output(
  contrast,
  annotated.normcnt,
  out.dir,
  samp.name.and.group.key,
  analysis.name = NULL,
  filtered.lists = TRUE,
  fdr.thr = 0.05,
  logfc.thr = 1
)
}
\arguments{
\item{contrast}{Character; a contrast group name pair in the typical format, i.e., "group2-group1"}

\item{annotated.normcnt}{data frame; annotated output table generated by performing pair-wise comparisons and
corresponding statistical tests. From this the normalised counts are extracted.}

\item{out.dir}{Character; output directory for final tables. Required; no default is used so that nothing is written to the working directory unintentionally.}

\item{samp.name.and.group.key}{\code{data.frame} with sample names (matching the count columns of
\code{annotated.normcnt}) as row names and a \code{group} column giving each sample's group. Used to
drop count columns of samples outside the contrast in multi-group designs; may be \code{NULL}.}

\item{analysis.name}{Character used in the output file name.}

\item{filtered.lists}{Logical; should the DGE table be filtered before saving it to a file?}

\item{fdr.thr}{Numeric; the FDR threshold for filtering.}

\item{logfc.thr}{Numeric; the fold-change threshold on the log2-scale for filtering.}
}
\value{
No return value. Called for its side effect of writing a reduced and optionally
  significance-filtered differential expression table to a tab-separated file below \option{out.dir}.
}
\description{
Helper function to generate an output table with only most relevant columns
}
\examples{
\donttest{
set.seed(1)
key <- data.frame(group = rep(c("control", "treated"), each = 4),
                  row.names = paste0("S", 1:8))
d3 <- data.frame(ID = paste0("g", 1:50), gene_symbol = paste0("G", 1:50),
                 logFC = rnorm(50), FDR = runif(50))
diffr_expr_generate_cleaned_de_table_output(
  contrast = "treated-control", annotated.normcnt = d3,
  samp.name.and.group.key = key, out.dir = tempdir(),
  analysis.name = "demo")
}
}
