R: GO term enrichment analysis for large numbers of gene sets
GOHyperGAll
R Documentation
GO term enrichment analysis for large numbers of gene sets
Description
To test a sample population of genes for over-representation of GO terms, the
core function GOHyperGAll computes for all nodes in the three GO networks
(BP, CC and MF) an enrichment test based on the hypergeometric distribution and returns the corresponding raw and
Bonferroni corrected p-values. Subsequently, a filter function supports GO Slim
analyses using default or custom GO Slim categories. Several convenience functions
are provided to process large numbers of gene sets (e.g. clusters from partitioning
results) and to visualize the results.
Note: GOHyperGAll provides similar utilities as the GOHyperG
function in the GOstats package. The main difference is that
GOHyperGAll simplifies processing of large numbers of gene sets, as well
as the usage of custom array-to-gene and gene-to-GO mappings.
Usage
## Generate gene-to-GO mappings and store as catDB object
makeCATdb(myfile, lib = NULL, org = "", colno = c(1, 2, 3), idconv = NULL, rootUK=FALSE)
## Enrichment function
GOHyperGAll(catdb, gocat = "MF", sample, Nannot = 2)
## GO slim analysis
GOHyperGAll_Subset(catdb, GOHyperGAll_result, sample = test_sample, type = "goSlim", myslimv)
## Reduce GO term redundancy
GOHyperGAll_Simplify(GOHyperGAll_result, gocat = "MF", cutoff = 0.001, correct = TRUE)
## Batch analysis of many gene sets
GOCluster_Report(catdb, setlist, id_type = "affy", method = "all", CLSZ = 10, cutoff = 0.001, gocats = c("MF", "BP", "CC"), myslimv = "default", correct = TRUE, recordSpecGO = NULL, ...)
## Bar plot of GOCluster_Report results
goBarplot(GOBatchResult, gocat)
Arguments
myfile
File with gene-to-GO mappings. Sample files can be downloaded from geneontology.org (http://geneontology.org/GO.downloads.annotations.shtml) or from BioMart as shown in example below.
colno
Column numbers referencing in myfile the three target columns containing GOID, GeneID and GOCAT, in that order.
org
Optional argument. Currently, the only valid option is org="Arabidopsis" to get rid of transcript duplications in this particular annotation.
lib
If the gene-to-GO mappings are obtained from a *.db package from Bioconductor then the package name can be specified under the lib argument of the sampleDFgene2GO function.
idconv
Optional id conversion data.frame
catdb
catdb object storing mappings of genes to annotation categories. For details, see ?"SYSargs-class".
rootUK
If the argument rootUK is set to TRUE then the root nodes are treated as terminal nodes to account for the new unknown terms.
sample
character vector containing the test set of gene identifiers
Nannot
Defines the minimum number of direct annotations per GO node from the sample
set to determine the number of tested hypotheses for the p-value adjustment.
gocat
Specifies the GO type, can be assigned one of the following character values: "MF", "BP" and "CC".
GOHyperGAll_result
data.frame generated by GOHyperGAll
type
The function GOHyperGAll_Subset subsets the GOHyperGAll
results by directly assigned GO nodes or custom goSlim categories.
The argument type can be assigned the values goSlim or assigned.
myslimv
optional argument to provide custom goSlim vector
cutoff
p-value cutoff for GO terms to show in result data.frame
correct
If TRUE the function will favor the selection of terminal (informationich)
GO terms that have at the same time a large number of sample matches.
setlist
list of character vectors containing gene IDs (or array feature
IDs). The names of the list components correspond to the set labels,
e.g. DEG comparisons or cluster IDs.
id_type
specifies type of IDs in input, can be assigned gene or affy
method
Specifies analysis type. Current options are all for GOHyperGAll,
slim for GOHyperGAll_Subset or simplify for
GOHyperGAll_Simplify.
CLSZ
minimum gene set (cluster) size to consider. Gene sets below this cutoff
will be ignored.
gocats
Specifies GO type, can be assigned the values "MF", "BP" and "CC".
recordSpecGO
argument to report in the result data.frame specific GO IDs for any
of the 3 ontologies disregarding whether they meet the specified p-value cutoff, e.g: recordSpecGO=c("GO:0003674", "GO:0008150", "GO:0005575")
GOBatchResult
data.frame generated by GOCluster_Report
...
additional arguments to pass on
Details
GOHyperGAll_Simplify: The result data frame from GOHyperGAll
will often contain several connected GO terms with significant scores which
can complicate the interpretation of large sample sets. To reduce this redundancy,
the function GOHyperGAll_Simplify subsets the data frame
by a user specified p-value cutoff and removes from it all GO nodes with
overlapping children sets (OFFSPRING), while the best scoring nodes are
retained in the result data.frame.
GOCluster_Report: performs the three types of GO term enrichment
analyses in batch mode: GOHyperGAll, GOHyperGAll_Subset or
GOHyperGAll_Simplify. It processes many gene sets (e.g. gene expression
clusters) and returns the results conveniently organized in a single result data frame.
Value
makeCATdb generates catDB object from file.
Author(s)
Thomas Girke
References
This workflow has been published in Plant Physiol (2008) 147, 41-57.