man/topGOtable.Rd
88d37790
 % Generated by roxygen2: do not edit by hand
 % Please edit documentation in R/pca2go.R
 \name{topGOtable}
 \alias{topGOtable}
4b4b8baf
 \title{Extract functional terms enriched in the DE genes, based on topGO}
88d37790
 \usage{
8fa4a88a
 topGOtable(
   DEgenes,
   BGgenes,
   ontology = "BP",
   annot = annFUN.org,
   mapping = "org.Mm.eg.db",
   geneID = "symbol",
   topTablerows = 200,
   fullNamesInRows = TRUE,
   addGeneToTerms = TRUE,
   plotGraph = FALSE,
   plotNodes = 10,
   writeOutput = FALSE,
   outputFile = "",
   topGO_method2 = "elim",
   do_padj = FALSE
 )
88d37790
 }
 \arguments{
4b4b8baf
 \item{DEgenes}{A vector of (differentially expressed) genes}
 
 \item{BGgenes}{A vector of background genes, e.g. all (expressed) genes in the assays}
 
 \item{ontology}{Which Gene Ontology domain to analyze: \code{BP} (Biological Process), \code{MF} (Molecular Function), or \code{CC} (Cellular Component)}
 
6e48e82d
 \item{annot}{Which function to use for annotating genes to GO terms. Defaults to \code{annFUN.org}}
4b4b8baf
 
 \item{mapping}{Which \code{org.XX.eg.db} to use for annotation - select according to the species}
 
6e48e82d
 \item{geneID}{Which format the genes are provided. Defaults to \code{symbol}, could also be
 \code{entrez} or \code{ENSEMBL}}
4b4b8baf
 
 \item{topTablerows}{How many rows to report before any filtering}
 
 \item{fullNamesInRows}{Logical, whether to display or not the full names for the GO terms}
 
 \item{addGeneToTerms}{Logical, whether to add a column with all genes annotated to each GO term}
 
 \item{plotGraph}{Logical, if TRUE additionally plots a graph on the identified GO terms}
 
 \item{plotNodes}{Number of nodes to plot}
 
 \item{writeOutput}{Logical, if TRUE additionally writes out the result to a file}
 
 \item{outputFile}{Name of the file the result should be written into}
b6862015
 
 \item{topGO_method2}{Character, specifying which of the methods implemented by \code{topGO} should be used, in addition to the \code{classic} algorithm. Defaults to \code{elim}}
 
 \item{do_padj}{Logical, whether to perform the adjustment on the p-values from the specific
e63fe6d6
 topGO method, based on the FDR correction. Defaults to FALSE, since the assumption of
b6862015
 independent hypotheses is somewhat violated by the intrinsic DAG-structure of the Gene
 Ontology Terms}
88d37790
 }
 \value{
4b4b8baf
 A table containing the computed GO Terms and related enrichment scores
88d37790
 }
 \description{
4b4b8baf
 A wrapper for extracting functional GO terms enriched in the DE genes, based on
 the algorithm and the implementation in the topGO package
88d37790
 }
b6862015
 \details{
 Allowed values assumed by the \code{topGO_method2} parameter are one of the
e63fe6d6
 following: \code{elim}, \code{weight}, \code{weight01}, \code{lea},
 \code{parentchild}. For more details on this, please refer to the original
b6862015
 documentation of the \code{topGO} package itself
 }
88d37790
 \examples{
4cf99bf8
 library("airway")
 library("DESeq2")
 data("airway", package = "airway")
90bbef92
 airway
 dds_airway <- DESeqDataSet(airway, design= ~ cell + dex)
f1ee9df0
 # Example, performing extraction of enriched functional categories in
 # detected significantly expressed genes
 \dontrun{
90bbef92
 dds_airway <- DESeq(dds_airway)
 res_airway <- results(dds_airway)
 library("AnnotationDbi")
 library("org.Hs.eg.db")
 res_airway$symbol <- mapIds(org.Hs.eg.db,
c8e298cb
                             keys = row.names(res_airway),
                             column = "SYMBOL",
                             keytype = "ENSEMBL",
                             multiVals = "first")
90bbef92
 res_airway$entrez <- mapIds(org.Hs.eg.db,
c8e298cb
                             keys = row.names(res_airway),
                             column = "ENTREZID",
                             keytype = "ENSEMBL",
                             multiVals = "first")
90bbef92
 resOrdered <- as.data.frame(res_airway[order(res_airway$padj),])
 de_df <- resOrdered[resOrdered$padj < .05 & !is.na(resOrdered$padj),]
 de_symbols <- de_df$symbol
 bg_ids <- rownames(dds_airway)[rowSums(counts(dds_airway)) > 0]
 bg_symbols <- mapIds(org.Hs.eg.db,
c8e298cb
                      keys = bg_ids,
                      column = "SYMBOL",
                      keytype = "ENSEMBL",
                      multiVals = "first")
90bbef92
 library(topGO)
 topgoDE_airway <- topGOtable(de_symbols, bg_symbols,
                              ontology = "BP",
                              mapping = "org.Hs.eg.db",
                              geneID = "symbol")
 }
 
88d37790
 }