View source: R/GOenrichmentAnalysis.R
GOenrichmentAnalysis | R Documentation |
NOTE: GOenrichmentAnalysis is deprecated. Please use function enrichmentAnalysis from R package anRichment, available from https://labs.genetics.ucla.edu/horvath/htdocs/CoexpressionNetwork/GeneAnnotation/
WARNING: This function should be considered experimental. The arguments and resulting values (in particular, the enrichment p-values) are not yet finalized and may change in the future. The function should only be used to get a quick and rough overview of GO enrichment in the modules in a data set; for a publication-quality analysis, please use an established tool.
Using Bioconductor's annotation packages, this function calculates enrichments and returns terms with best enrichment values.
GOenrichmentAnalysis(labels,
entrezCodes,
yeastORFs = NULL,
organism = "human",
ontologies = c("BP", "CC", "MF"),
evidence = "all",
includeOffspring = TRUE,
backgroundType = "givenInGO",
removeDuplicates = TRUE,
leaveOutLabel = NULL,
nBestP = 10, pCut = NULL,
nBiggest = 0,
getTermDetails = TRUE,
verbose = 2, indent = 0)
labels |
cluster (module, group) labels of genes to be analyzed. Either a single vector, or a
matrix. In the matrix case, each column will be analyzed separately; analyzing a collection of module
assignments in one function call will be faster than calling the function several tinmes. For each row,
the labels in all columns must correspond to the same gene specified in |
entrezCodes |
Entrez (a.k.a. LocusLink) codes of the genes whose labels are given in
|
yeastORFs |
if |
organism |
character string specifying the organism for which to perform the analysis. Recognized
values are (unique abbreviations of) |
ontologies |
vector of character strings specifying GO ontologies to be included in the analysis.
Can be any subset of |
evidence |
vector of character strings specifying admissible evidence for each gene in its specific term, or "all" for all evidence codes. See Details or http://www.geneontology.org/GO.evidence.shtml for available evidence codes and their meaning. |
includeOffspring |
logical: should genes belonging to the offspring of each term be included in the term? As a default, only genes belonging directly to each term are associated with the term. Note that the calculation of enrichments with offspring included can be quite slow for large data sets. |
backgroundType |
specification of the background to use. Recognized values are (unique
abbreviations of) |
removeDuplicates |
logical: should duplicate entries in |
leaveOutLabel |
optional specifications of module labels for which enrichment calculation is not desired. Can be a single label or a vector of labels to be ignored. However, if in any of the sets no labels are left to calculate enrichment of, the function will stop with an error. |
nBestP |
specifies the number of terms with highest enrichment whose detailed information will be returned. |
pCut |
alternative specification of terms to be returned: all terms whose enrichment p-value is
more significant than |
nBiggest |
in addition to returning terms with highest enrichment, terms that contain most of the genes in each cluster can be returned by specifying the number of biggest terms per cluster to be returned. This may be useful for development and testing purposes. |
getTermDetails |
logical indicating whether detailed information on the most enriched terms should be returned. |
verbose |
integer specifying the verbosity of the function. Zero means silent, positive values will cause the function to print progress reports. |
indent |
integer specifying indentation of the diagnostic messages. Zero means no indentation, each unit adds two spaces. |
This function is basically a wrapper for the annotation packages available from Bioconductor. It requires the packages GO.db, AnnotationDbi, and org.xx.eg.db, where xx is the code corresponding to the organism that the user wishes to analyze (e.g., Hs for human Homo Sapiens, Mm for mouse Mus Musculus etc). For each cluster specified in the input, the function calculates all enrichments in the specified ontologies, and collects information about the terms with highest enrichment. The enrichment p-value is calculated using Fisher exact test. As background we use all of the supplied genes that are present in at least one term in GO (in any of the ontologies).
For best results, the newest annotation libraries should be used. Because of the way Bioconductor is set up, to get the newest annotation libraries you may have to use the current version of R.
According to http://www.geneontology.org/GO.evidence.shtml, the following codes are used by GO:
Experimental Evidence Codes EXP: Inferred from Experiment IDA: Inferred from Direct Assay IPI: Inferred from Physical Interaction IMP: Inferred from Mutant Phenotype IGI: Inferred from Genetic Interaction IEP: Inferred from Expression Pattern Computational Analysis Evidence Codes ISS: Inferred from Sequence or Structural Similarity ISO: Inferred from Sequence Orthology ISA: Inferred from Sequence Alignment ISM: Inferred from Sequence Model IGC: Inferred from Genomic Context IBA: Inferred from Biological aspect of Ancestor IBD: Inferred from Biological aspect of Descendant IKR: Inferred from Key Residues IRD: Inferred from Rapid Divergence RCA: inferred from Reviewed Computational Analysis Author Statement Evidence Codes TAS: Traceable Author Statement NAS: Non-traceable Author Statement Curator Statement Evidence Codes IC: Inferred by Curator ND: No biological Data available Automatically-assigned Evidence Codes IEA: Inferred from Electronic Annotation Obsolete Evidence Codes NR: Not Recorded
A list with the following components:
keptForAnalysis |
logical vector with one entry per given gene. |
inGO |
logical vector with one entry per given gene. |
If input labels
contained only one vector of labels, the following components:
countsInTerms |
a matrix whose rows correspond to given cluster, and whose columns correspond to GO terms, contaning number of genes in the intersection of the corresponding module and GO term. Row and column names are set appropriately. |
enrichmentP |
a matrix whose rows correspond to given cluster, and whose columns correspond to GO terms, contaning enrichment p-values of each term in each cluster. Row and column names are set appropriately. |
bestPTerms |
a list of lists with each inner list corresponding to an ontology given in
|
biggestTerms |
a list of the same format as |
If input labels
contained more than one vector, instead of the above components the return value
contains a list named setResults
that has one component per given set; each component is a list
containing the above components for the corresponding set.
Peter Langfelder
Bioconductor's annotation packages such as GO.db and organism-specific annotation packages such as org.Hs.eg.db.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.