| Title: | Meta-analysis of high-throughput experiments using feature annotations |
|---|---|
| Description: | Calculates significant annotations (categories) in each of two (or more) feature (i.e. gene) lists, determines the overlap between the annotations, and returns graphical and tabular data about the significant annotations and which combinations of feature lists the annotations were found to be significant. Interactive exploration is facilitated through the use of RCytoscape (heavily suggested). |
| Authors: | Robert M. Flight <[email protected]> |
| Maintainer: | Robert M. Flight <[email protected]> |
| License: | GPL-2 |
| Version: | 1.57.0 |
| Built: | 2026-05-30 09:43:48 UTC |
| Source: | https://github.com/bioc/categoryCompare |
Calculates significant annotations (categories) in each of two (or more) feature (i.e. gene) lists, determines the overlap between the annotations, and returns graphical and tabular data about the significant annotations and which combinations of feature lists the annotations were found to be significant. Interactive exploration is facilitated through the use of RCytoscape (heavily suggested).
| Package: | categoryCompare |
| Version: | 1.21.2 |
| License: | GPL-2 |
| Depends: | Biobase (>= 1.15.29), AnnotationDbi (>= 0.1.15), Category |
| Suggests: | methods, GSEABase, hwriter, colorspace, graph, GO.db, KEGG.db, estrogen, org.Hs.eg.db, hgu95av2.db |
| Imports: | Biobase (>= 1.15.29), AnnotationDbi (>= 0.1.15), hwriter, GSEABase, Category (>= 2.21.2), GOstats, annotate, colorspace, graph, RCy3 |
| LazyLoad: | yes |
| biocViews: | Bioinformatics, Annotation, GO, MultipleComparisons, Pathways, GeneExpression |
| SystemRequirements: | Cytoscape (>= 2.8.0) (if used for visualization of results, heavily suggested), CytoscapeRPC plugin (>= 1.8) |
| TODO: | Text and HTML output without graphs. |
| Built: | R 2.15.0; ; 2012-03-15 18:42:40 UTC; windows |
Index:
GENccEnrichResult-class
Class '"GENccEnrichResult"'
HyperGParamsCC-class Class "HyperGParamsCC"
HyperGResultCC-class Class "HyperGResultCC"
breakEdges Break Cytoscape (or graphNEL) Network Edges
breakEdges-methods Methods for Function 'breakEdges' in Package
'categoryCompare'
categoryCompare-package
Meta-analysis of high-throughput experiments
using feature annotations
ccCompare-methods Comparison of enriched annotations
ccCompareCollection-class
Class '"ccCompareCollection"'
ccCompareGeneric-methods
Methods for Function 'ccCompareGeneric' in
Package 'categoryCompare'
ccCompareResult-class Class '"ccCompareResult"'
ccData Test data for 'categoryCompare'
ccEnrich-method Perform annotation enrichment for multiple gene
lists
ccEnrichCollection-class
Class "ccEnrichCollection"
ccEnrichResult-class Class "ccEnrichResult"
ccGeneList-class Class "ccGeneList"
ccOptions-class Class "ccOptions"
ccOutCyt-methods Methods for Function 'ccOutCyt' in Package
'categoryCompare'
ccSigList-class Class '"ccSigList"'
cwReload-methods Methods for Function 'cwReload' in Package
'categoryCompare'
cytOutData-methods Methods for Function 'cytOutData'
cytOutNodes-methods Methods for Function 'cytOutNodes'
fdr Number of FDR runs to perform
getGeneSymbol Entrez to name, symbol, GO and path conversion,
as well as general ID to ID conversion.
graphType-methods graphType
hyperGTestCC Hypergeometric testing with false discovery
rate
listNames listNames
mergeLists-methods Function 'mergeLists' in Package
'categoryCompare'
mergedData-class Class '"mergedData"'
minCount minCount
minNodes Delete nodes with less than a certain number of
genes annotated
pvalueType Type of p-values to return from object
resetColors-methods resetColors
show-methods Methods for Function show in Package
'categoryCompare'
Further information is available in the following vignettes:
categoryCompare_vignette |
categoryCompare: High-throughput data meta-analysis using gene annotations (source) |
Robert M. Flight <[email protected]>
Maintainer: Robert M. Flight <[email protected]>
breakEdges in Package categoryCompare Methods for function breakEdges in package categoryCompare
signature(cwObject = "ccCompareResult", cutoff = "numeric")Allows one to remove edges in the ccCompareResult mainGraph slot prior to passing it into Cytoscape for visualization. Given that the number of edges can be rather large (especially for Gene Ontology) this can easily speed up the transfer, without actually losing any information.
signature(cwObject = "numeric", cutoff = "numeric")Once an annotation graph is in Cytoscape, remove edges above or below the cutoff. Note that this does not affect the original graph in the ccCompareResult object.
Robert M Flight
breakEdges ccCompareResult ccOutCyt
data(ccData) # breaking the edges in a ccCompareResult ccResults$BP <- breakEdges(ccResults$BP, 0.8) ## Not run: hasCy <- (if (.Platform$OS.type %in% "windows") { (length(grep("Cytoscape", system("tasklist", intern=TRUE))) > 0)}) if hasCy { cwObj <- ccOutCyt(ccResults$BP,ccOpts) # now breaking them in the CytoscapeWindow object breakEdges(cwObj, 0.85) Sys.sleep(10) RCy3::deleteWindow(cwObj) } ## End(Not run)data(ccData) # breaking the edges in a ccCompareResult ccResults$BP <- breakEdges(ccResults$BP, 0.8) ## Not run: hasCy <- (if (.Platform$OS.type %in% "windows") { (length(grep("Cytoscape", system("tasklist", intern=TRUE))) > 0)}) if hasCy { cwObj <- ccOutCyt(ccResults$BP,ccOpts) # now breaking them in the CytoscapeWindow object breakEdges(cwObj, 0.85) Sys.sleep(10) RCy3::deleteWindow(cwObj) } ## End(Not run)
Takes the results from ccEnrich and compares the enriched annotations based on the settings previously set in ccOptions. Returns a ccCompareResult or ccCompareCollection object, see Details.
ccCompare(ccEnrichResult, ccOptions)ccCompare(ccEnrichResult, ccOptions)
ccEnrichResult |
The enriched annotations collection returned from |
ccOptions |
A |
Based on the enrichments found for each gene list, we now want to compare the annotations between lists. ccCompare accesses the annotations for each enrichment performed for each list, and makes the comparisons defined in ccOptions.
ccCompare generates both a graph of the comparisons (to show how the categories are linked to each list and each other) and tabular output. The tabular output is a data frame, with ID for each term that was considered as a candidate annotation for each list, as well as a long description (Desc) of what the term is, and then membership and statistics from each gene list.
For each type of comparison (GO, KEGG, etc) a ccCompareResult is generated, with the following slots:
mainGraph |
Annotations arranged as a graph |
mainTable |
The tabular results from all enrichment calculations combined into one |
allAnnotation |
A list of lists, where each entry is the annotation identifier, then a list for each comparison, with the genes that are annotated to that term that also belong to each list |
The default is to generate an overlap graph for GO and KEGG, where the overlap is a measure of the similarity of the features (genes) annotated to each annotation term (based on a formula from EnrichmentMap). Optionally for GO, one can generate a hierarchical layout where the parent GO terms of the significant terms will also be included in the graph, with term origin saved in the node annotation (see example below to do this).
Only those terms with more than 10 and less than 500 annotated genes (according to the GO annotation file) are included.
When using weighted overlap graphs and RCy3 for viewing, it is recommended to use breakEdges and minNodes to remove edges with low weights and nodes with only a few genes from the dataset annotated to them.
Robert M Flight
ccCompareResult ccCompareCollection ccOutCyt breakEdges outType ccEnrich
## Not run: require(GO.db) require(KEGG.db) require(org.Hs.eg.db) ## End(Not run) data(ccData) # note that enrichLists is generated from ccEnrich # ccResults <- ccCompare(enrichLists,ccOpts) ccResults # use the GO hierarchy tree graphType(enrichLists$BP) <- "hierarchical" # ccResultsBPHier <- ccCompare(enrichLists$BP,ccOpts) ccResultsBPHier## Not run: require(GO.db) require(KEGG.db) require(org.Hs.eg.db) ## End(Not run) data(ccData) # note that enrichLists is generated from ccEnrich # ccResults <- ccCompare(enrichLists,ccOpts) ccResults # use the GO hierarchy tree graphType(enrichLists$BP) <- "hierarchical" # ccResultsBPHier <- ccCompare(enrichLists$BP,ccOpts) ccResultsBPHier
"ccCompareCollection"
Holds multiple ccCompareResult objects.
Objects can be created by calls of the form new("ccCompareCollection", ...).
These are not normally created by the user, but rather by ccCompare while performing the categorical comparisons for each type of category
.Data:Object of class "list"
names:Object of class "character"
Class "namedList", directly.
Class "list", by class "namedList", distance 2.
Class "vector", by class "namedList", distance 3.
Class "AssayData", by class "namedList", distance 3.
No methods defined with class "ccCompareCollection" in the signature.
Robert M Flight
showClass("ccCompareCollection")showClass("ccCompareCollection")
ccCompareGeneric in Package categoryCompare Methods for function ccCompareGeneric in package categoryCompare
signature(gccResult = "GENccEnrichResult", ccOptions = "ccOptions")"ccCompareResult"
Holds the results from a single category comparison
Objects can be created by calls of the form new("ccCompareResult", ...).
mainGraph:Object of class "graph". Holds the graph describing the relationships between the annotations
subGraph:Object of class "list". Not currently used
mainTable:Object of class "data.frame". Table of results, with all the various statistics for each annotation in the category
allAnnotation:Object of class "list". For each annotation, which genes from which comparison are annotated to that particular annotation
categoryName:Object of class "character". Which category (e.g. GO, KEGG, etc) was used
ontology:Object of class "character". If GO, which ontology was used
signature(object = "ccCompareResult"): ...
signature(object = "ccCompareResult"): ...
signature(object = "ccCompareResult"): ...
Robert M Flight
showClass("ccCompareResult")showClass("ccCompareResult")
categoryCompare
Processed data from the estrogen example data set
data(ccData)data(ccData)
table10: Log-ratio output from limma for the comparison of presence-absence of estrogen at 10 hours
table48: Log-ratio output from limma for the comparison of presence-absence of estrogen at 48 hours
gUniverse: All of the genes measured on the chip
gseaRes: Toy results of GSEA analysis of 3 different tissues
enrichLists: Apply ccEnrich to a ccGeneList from table10 and table48
ccResults: Apply ccCompare to enrichLists
ccResultsBPHier: Modify enrichLists$BP to use a "hierarchical" layout
geneLists: a ccGeneList generated from genes in table10 and table48
ccOpts: a ccOptions object describing what we are going to do as far as feature list comparisons
Robert M Flight
Taken from the estrogen package in Bioconductor, and then processed using the normal affy and limma tools.
ccGeneList ccEnrichCollection ccCompareCollection ccEnrich ccCompare
data(ccData)data(ccData)
Takes a ccGeneList object containing all the information needed to perform enrichment calculations for Gene Ontology.
ccEnrich(ccGeneList)ccEnrich(ccGeneList)
ccGeneList |
A |
This function is essentially a wrapper for hyperGTestCC that performs all of the calculations for the many gene lists in one go, returning a list of HyperGResultCC objects, one for each of the ccTypes and each gene list. These various HyperGResultCC objects can then be accessed and results compared among the lists for each of the ontologies
A list of HyperGResultCC objects, one for each ccType and gene list, returned as ccEnrichResult objects for each ccType. This can be passed with a ccOptions object to ccCompare to generate actual annotation comparisons.
Robert M Flight
ccGeneList, hyperGTestCC, ccEnrichResult
## Not run: require(GO.db) require(KEGG.db) require(org.Hs.eg.db) ## End(Not run) data(ccData) g10 <- (unique(table10$Entrez[1:100])) g48 <- (unique(table48$Entrez[1:100])) list10 <- list(genes=g10, universe=gUniverse, annotation="org.Hs.eg.db") list48 <- list(genes=g48, universe=gUniverse, annotation="org.Hs.eg.db") geneLists <- list(T10=list10, T48=list48) geneLists <- new("ccGeneList", geneLists, ccType=c("BP","KEGG")) geneLists <- new("ccGeneList", geneLists, ccType=c("CC","KEGG")) # set number of fdr runs to 0 to speed up runtime, not generally recommended. geneLists <- new("ccGeneList", geneLists, ccType = c('BP','KEGG'), pvalueCutoff=0.01, fdr=0) # enrichLists <- ccEnrich(geneLists)## Not run: require(GO.db) require(KEGG.db) require(org.Hs.eg.db) ## End(Not run) data(ccData) g10 <- (unique(table10$Entrez[1:100])) g48 <- (unique(table48$Entrez[1:100])) list10 <- list(genes=g10, universe=gUniverse, annotation="org.Hs.eg.db") list48 <- list(genes=g48, universe=gUniverse, annotation="org.Hs.eg.db") geneLists <- list(T10=list10, T48=list48) geneLists <- new("ccGeneList", geneLists, ccType=c("BP","KEGG")) geneLists <- new("ccGeneList", geneLists, ccType=c("CC","KEGG")) # set number of fdr runs to 0 to speed up runtime, not generally recommended. geneLists <- new("ccGeneList", geneLists, ccType = c('BP','KEGG'), pvalueCutoff=0.01, fdr=0) # enrichLists <- ccEnrich(geneLists)
Holds multiple classes of ccEnrichResult in one object to allow ccCompare to work on only the one object and generate all of the results of a comparison.
Objects can be created by calls of the form new("ccEnrichCollection", ...).
.Data:Object of class "list"
names:Object of class "character" The names (generally GO ontologies or KEGG, but can be changed) of each set of results
Class "namedList", directly.
Class "list", by class "namedList", distance 2.
Class "vector", by class "namedList", distance 3.
Class "AssayData", by class "namedList", distance 3.
signature(r = "ccEnrichCollection"): Changes the pvalueCutoff to be used to decide significant annotations for all of the contained ccEnrichResult objects
signature(object = "ccEnrichCollection"): Changes whether to use p-values or fdr values to determine those annotations that are significant in all of the contained ccEnrichResult objects
signature(object = "ccEnrichCollection"): how many features have to be annotated to a term to be reported as significant
signature(object = "ccEnrichCollection"): Gets the type of graph that should be output for this collection
Robert M Flight
ccEnrich hyperGTestCC ccCompare ccEnrichResult
data(ccData) enrichListsdata(ccData) enrichLists
Acts as a container object for multiple HyperGResultCC objects.
Objects can be created by calls of the form new("ccEnrichResult", ...).
Class "namedList", directly.
Class "list", by class "namedList", distance 2.
Class "vector", by class "namedList", distance 3.
Class "AssayData", by class "namedList", distance 3.
signature(object = "ccEnrichResult"): get the number of runs using random feature lists were performed
signature(r = "ccEnrichResult"): what is the pvalueCutoff to determine significant annotations
signature(r = "ccEnrichResult"): change the pvalueCutoff for an annotation to be considered significant
signature(object = "ccEnrichResult"): change whether p-values used are from "FDR" or raw p-values
signature(object = "ccEnrichResult"): how many features need to belong to an annotation to be reported
signature(object = "ccEnrichResult"): adjust the minCount
signature(object = "ccEnrichResult"): what type of graph should be generated (generally set by the class of object)
signature(object = "ccEnrichResult"): change the type of graph to generate by ccCompare
Robert M Flight
data(ccData) enrichRes <- enrichLists[[1]] fdr(enrichRes) pvalueType(enrichRes) enrichRes pvalueType(enrichRes) <- 'pval' enrichRes pvalueCutoff(enrichRes) pvalueCutoff(enrichRes) <- 0.01 enrichResdata(ccData) enrichRes <- enrichLists[[1]] fdr(enrichRes) pvalueType(enrichRes) enrichRes pvalueType(enrichRes) <- 'pval' enrichRes pvalueCutoff(enrichRes) pvalueCutoff(enrichRes) <- 0.01 enrichRes
This stores the actual gene lists and related information that will be used in categoryCompare.
Objects can be created by calls of the form new("ccGeneList", list)). ccGeneList is actually just an extension of R list objects. The input list should be a list of lists. See Details for more information.
fdr:Object of class "numeric" The number of fdr runs to perform to account for different list sizes and term dependence
pvalueCutoff:Object of class "numeric" Value used to determine whether or not a particular term is significant or not
ccType:Object of class "character" What types of annotations to use. Currently supported ones include "BP", "MF", "CC" (from Gene Ontology) and "KEGG"
testDirection:Object of class "character" Are you interested in "over" or "under" represented annotations
signature(object = "ccGeneList"): how many random runs to perform
signature(object = "ccGeneList"): change the number of random runs
signature(object = "ccGeneList"): what is the pvalue to consider significant
signature(object = "ccGeneList"): change the cutoff for significance
signature(object = "ccGeneList"): what type of annotations are going to be examined
signature(object = "ccGeneList"): change the type of annotations to examine
signature(object = "ccGeneList"): query for "over" or "under" represented annotations
signature(object = "ccGeneList"): change the type of representation ("over" or "under")
signature(object = "ccGeneList"): what are the names of the lists contained
The input list should be a list of lists, with at least three sub-lists.
testList <- list(list1=list(genes='...',universe='...',annotation='...'), list2=list(...))
: These are the gene identifiers of the genes that are of interest (differentially expressed genes)
: All of the genes that were measured in this particular experiments (i.e. all the genes on the chip)
: What organism or chip do these ID's come from (e.g. "org.Hs.eg.db" for Human Entrez gene ID's, "hgu133a.db" for probe ID's from the Affymetrix U133A chip)
: A data-frame that contains extra information about the genes of interest. At the very least, the data-frame must have a column ID that matches the ID's contained in genes
What actually happens when running ccEnrich is that the appropriate HyperGParamsCC objects are generated for each geneList and each type of annotation (e.g. BP, CC, KEGG), and then the calculations performed on each one.
The ccGeneList object is what will undergo all of the enrichment calculations. When the results are combined with the ccOptions object, we can get our results of actual comparisons between experiments.
Robert M Flight
data(ccData) g10 <- (unique(table10$Entrez[1:100])) g48 <- (unique(table48$Entrez[1:100])) list10 <- list(genes=g10, universe=gUniverse, annotation="org.Hs.eg.db") list48 <- list(genes=g48, universe=gUniverse, annotation="org.Hs.eg.db") geneLists <- list(T10=list10, T48=list48) geneLists <- new("ccGeneList", geneLists, ccType=c("BP","KEGG")) geneListsdata(ccData) g10 <- (unique(table10$Entrez[1:100])) g48 <- (unique(table48$Entrez[1:100])) list10 <- list(genes=g10, universe=gUniverse, annotation="org.Hs.eg.db") list48 <- list(genes=g48, universe=gUniverse, annotation="org.Hs.eg.db") geneLists <- list(T10=list10, T48=list48) geneLists <- new("ccGeneList", geneLists, ccType=c("BP","KEGG")) geneLists
These objects store the various options required by categoryCompare for actually making comparisons and generating output.
Objects can be created by calls of the form new("ccOptions", listNames=c('list1','list2',etc)).
This is the minimum call required, and will generate a ccOptions object where comparisons are assumed between all the lists supplied. See the examples section for more examples of how to initialize new objects.
listNames:Object of class "character" The actual names of the various datasets defined in the ccData object
compareNames:Object of class "character" Which lists to compare, each entry should be a comma separated list
compareIndx:Object of class "list" List indices for each of the comparison, not usually set by the user. Generated automatically.
compareColors:Object of class "character" For graphical and tabular output each comparison can be colored. Should be one color for each comparison. Can be either an n by 3 matrix of rgb triples, or a character vector of hexadecimal color codes, or character vector of color names ('red','green','blue', etc)
cssClass:Object of class "character" Classnames used when generating HTML tables to color entries. Generated automatically upon initialization, or modifying compareNames
outType:Object of class "character" Sets the type of output generated by ccTables. Valid types are "html", "text", "rcy3" or "none", default is "text" when the ccOptions object is initialized without an outType specified.
signature(object = "ccOptions"): ...
signature(object = "ccOptions"): ...
signature(object = "ccOptions"): ...
signature(object = "ccOptions"): ...
signature(object = "ccOptions"): ...
signature(object = "ccOptions"): ...
signature(object = "ccOptions"): ...
signature(object = "ccOptions"): ...
signature(object = "ccOptions"): ...
signature(object = "ccOptions"): ...
Robert M Flight
showClass("ccOptions") ## A very basic "ccOptions" for a comparison of two sets of data, "list1" and "list2" c1 <- new("ccOptions", listNames=c('list1','list2')) c1 ## Now lets get a little more complicated c1 <- new("ccOptions", listNames=c('list1','list2'), compareNames=c('list1,list2','list1,list3'), compareColors=c('red','blue')) c1 # set the type of output you want to eventually produce c1 <- new("ccOptions", listNames=c('list1','list2'), outType='html') c1 c1 <- new("ccOptions", listNames=c('list1','list2'), outType=c('html','text','none')) c1 ## Using RGB colors ccCols <- matrix(c(255,0,0, 0,0,255), nrow=2, ncol=3) ccCols <- rgb(ccCols, maxColorValue=255) c1 <- new("ccOptions", listNames=c('list1','list2','list3'), compareNames=c('list1,list2','list1,list3'), compareColors=ccCols) ## Using Hex colors c1 <- new("ccOptions", listNames=c('list1','list2','list3'), compareNames=c('list1,list2','list1,list3'), compareColors=c('#FF0000','#0000FF')) c1 ## or even using a color palette from R. ## Note that you need at least enough colors to cover all of individual and ## possible permutations (n!) if you use compareNames='all' c1 <- new("ccOptions", listNames=c('list1','list2','list3'), compareNames=c('list1,list2','list1,list3'), compareColors=rainbow(4)) c1showClass("ccOptions") ## A very basic "ccOptions" for a comparison of two sets of data, "list1" and "list2" c1 <- new("ccOptions", listNames=c('list1','list2')) c1 ## Now lets get a little more complicated c1 <- new("ccOptions", listNames=c('list1','list2'), compareNames=c('list1,list2','list1,list3'), compareColors=c('red','blue')) c1 # set the type of output you want to eventually produce c1 <- new("ccOptions", listNames=c('list1','list2'), outType='html') c1 c1 <- new("ccOptions", listNames=c('list1','list2'), outType=c('html','text','none')) c1 ## Using RGB colors ccCols <- matrix(c(255,0,0, 0,0,255), nrow=2, ncol=3) ccCols <- rgb(ccCols, maxColorValue=255) c1 <- new("ccOptions", listNames=c('list1','list2','list3'), compareNames=c('list1,list2','list1,list3'), compareColors=ccCols) ## Using Hex colors c1 <- new("ccOptions", listNames=c('list1','list2','list3'), compareNames=c('list1,list2','list1,list3'), compareColors=c('#FF0000','#0000FF')) c1 ## or even using a color palette from R. ## Note that you need at least enough colors to cover all of individual and ## possible permutations (n!) if you use compareNames='all' c1 <- new("ccOptions", listNames=c('list1','list2','list3'), compareNames=c('list1,list2','list1,list3'), compareColors=rainbow(4)) c1
ccOutCyt in Package categoryCompare Passes a ccCompareResult object to Cytoscape for interactive visualization of ccCompare results.
Note that only some basic, required methods have been imported from RCy3 for use with categoryCompare, and these are hidden in the functions within categoryCompare and are not visible to the user. If access to all the functionality of RCytoscape is desired (and trust me, there is a lot of useful stuff in there), then the user should use library(RCy3) directly.
It should also be noted that deletion of edges via RCy3 is slow, so some edge filtering should be done by breakEdges prior to using ccOutCyt.
signature(ccCompRes = "ccCompareResult", ccOpts = "ccOptions", ...)At a minimum, this method requires a ccCompareResult and a ccOptions to work.
... may include:
to override the default layout set by ccCompare, as well as options
to add a user set string to the Cytoscape window
In addition, any of the arguments to CytoscapeWindow may also be set, such as host or port.
ccCompareResult ccOptions ccCompare CytoscapeWindowClass
## Not run: hasCy <- (if (.Platform$OS.type %in% "windows") { (length(grep("Cytoscape", system("tasklist", intern=TRUE))) > 0)}) if hasCy { ccResults$BP <- breakEdges(ccResults$BP, 0.8) cwObj <- ccOutCyt(ccResults$BP,ccOpts) Sys.sleep(10) RCy3::deleteWindow(cwObj) } ## End(Not run)## Not run: hasCy <- (if (.Platform$OS.type %in% "windows") { (length(grep("Cytoscape", system("tasklist", intern=TRUE))) > 0)}) if hasCy { ccResults$BP <- breakEdges(ccResults$BP, 0.8) cwObj <- ccOutCyt(ccResults$BP,ccOpts) Sys.sleep(10) RCy3::deleteWindow(cwObj) } ## End(Not run)
"ccSigList"
Holds a generic list of significant annotations. Allows one to use Bioconductor annotation packages, or when combined into a GENccEnrichResult, use custom annotation / gene mappings.
Objects can be created by calls of the form new("ccSigList", ...).
sigID:Object of class "character"
categoryName:Object of class "character"
ontology:Object of class "character"
annotation:Object of class "character"
signature(object = "ccSigList"): ...
signature(object = "ccSigList"): ...
signature(object = "ccSigList"): ...
signature(object = "ccSigList"): ...
Robert M Flight
GENccEnrichResult ccCompareGeneric
showClass("ccSigList")showClass("ccSigList")
cwReload in Package categoryCompare Methods for function cwReload in package categoryCompare
signature(oldCW = "numeric", windowName = "character", ccOpts = "ccOptions")This method is now deprecated as the cwObj doesn't store anything, but is
merely the network SUID pointing to the network in Cytoscape. See RCy3::getNetworkSuid.
cytOutData Takes the saveObj generated by cytOutNodes and writes the data to a file
A text file with the annotations previously saved using cytOutNodes
signature(saveObj = "list", compareResult = "ccCompareResult", mergedData = "mergedData")saveObj is the list object generated by cytOutNodes, compareResult is the object from ccCompare, and mergedData is created using mergeLists, but is optional.
...: optional arguments also include: orgType, default is "header" where each group is seperate, "annotate" pushes all the data into one table with a new column that designates which groups the annotation was found in; fileName, the name of a text file to output the results to; displayFile, whether or not to display the file (default is "FALSE")
## Not run: hasCy <- (if (.Platform$OS.type %in% "windows") { (length(grep("Cytoscape", system("tasklist", intern=TRUE))) > 0)}) if hasCy { data(ccData) ccResults$BP <- breakEdges(ccResults$BP, 0.8) cwObj <- ccOutCyt(ccResults$BP,ccOpts) # user selects some nodes in Cytoscape RCy3::selectNodes(cwObj, c("GO:0007017", "GO:0000226", "GO:0007051", "GO:0007052")) savedNodes <- cytOutNodes("random1", cwObj) # save them # and selects some other nodes RCy3::selectNodes(cwObj, c("GO:0071103", "GO:0034728", "GO:0006323", "GO:0030261", "GO:0006334"), preserve.current.selection=FALSE) savedNodes <- cytOutNodes("random2", cwObj, savedNodes) # now spit results out to a file cytOutData(savedNodes, ccResults$BP) } ## End(Not run)## Not run: hasCy <- (if (.Platform$OS.type %in% "windows") { (length(grep("Cytoscape", system("tasklist", intern=TRUE))) > 0)}) if hasCy { data(ccData) ccResults$BP <- breakEdges(ccResults$BP, 0.8) cwObj <- ccOutCyt(ccResults$BP,ccOpts) # user selects some nodes in Cytoscape RCy3::selectNodes(cwObj, c("GO:0007017", "GO:0000226", "GO:0007051", "GO:0007052")) savedNodes <- cytOutNodes("random1", cwObj) # save them # and selects some other nodes RCy3::selectNodes(cwObj, c("GO:0071103", "GO:0034728", "GO:0006323", "GO:0030261", "GO:0006334"), preserve.current.selection=FALSE) savedNodes <- cytOutNodes("random2", cwObj, savedNodes) # now spit results out to a file cytOutData(savedNodes, ccResults$BP) } ## End(Not run)
cytOutNodes Allows export of currently selected nodes in the Cytoscape window for data export
signature(descStr = "character", cwObj = "numeric", saveObj = "list")descStr is a string describing the nodes that are currently selected, cwObj is the CytoscapeWindow that the nodes are in, and then saveObj is a previously generated cytOutNodes list, and is optional.
## Not run: hasCy <- (if (.Platform$OS.type %in% "windows") { (length(grep("Cytoscape", system("tasklist", intern=TRUE))) > 0)}) if hasCy { ccResults$BP <- breakEdges(ccResults$BP, 0.8) cwObj <- ccOutCyt(ccResults$BP,ccOpts) # user selects some nodes in Cytoscape RCy3::selectNodes(cwObj, c("GO:0007017", "GO:0000226", "GO:0007051", "GO:0007052")) savedNodes <- cytOutNodes("random1", cwObj) # save them # and selects some other nodes RCy3::selectNodes(cwObj, c("GO:0071103", "GO:0034728", "GO:0006323", "GO:0030261", "GO:0006334"), preserve.current.selection=FALSE) savedNodes <- cytOutNodes("random2", cwObj, savedNodes) } ## End(Not run)## Not run: hasCy <- (if (.Platform$OS.type %in% "windows") { (length(grep("Cytoscape", system("tasklist", intern=TRUE))) > 0)}) if hasCy { ccResults$BP <- breakEdges(ccResults$BP, 0.8) cwObj <- ccOutCyt(ccResults$BP,ccOpts) # user selects some nodes in Cytoscape RCy3::selectNodes(cwObj, c("GO:0007017", "GO:0000226", "GO:0007051", "GO:0007052")) savedNodes <- cytOutNodes("random1", cwObj) # save them # and selects some other nodes RCy3::selectNodes(cwObj, c("GO:0071103", "GO:0034728", "GO:0006323", "GO:0030261", "GO:0006334"), preserve.current.selection=FALSE) savedNodes <- cytOutNodes("random2", cwObj, savedNodes) } ## End(Not run)
Queries or sets the number of random runs to perform to generate an estimate of the false discovery rate. Defaults to 50
fdr(object)fdr(object)
object |
Can be |
fdr(object) gets the number of fdr runs for ccGeneList, HyperGParamsCC, HyperGResultCC, ccEnrichResult
fdr(object)<- will set the number of fdr runs to be used by ccEnrich and HyperGTestCC when performing calculations on either a ccGeneList or HyperGParamsCC, respectively
Robert M Flight
HyperGResultCC ccEnrichResult ccGeneList HyperGParamsCC
"GENccEnrichResult"
Holds generic ccEnrich type results
Objects can be created by calls of the form new("GENccEnrichResult", ...).
.Data:Object of class "list" The actual list containing the ccEnrichResults
categoryName:Object of class "character"
ontology:Object of class "character"
geneAnnMapping:Object of class "namedList"
graphType:Object of class "character"
names:Object of class "character"
Class "namedList", directly.
Class "list", by class "namedList", distance 2.
Class "vector", by class "namedList", distance 3.
Class "AssayData", by class "namedList", distance 3.
signature(x = "GENccEnrichResult", i = "ANY", j = "ANY"): Subsets the object to just those lists that are desired
signature(object = "GENccEnrichResult"):
signature(gccResult = "GENccEnrichResult", ccOptions = "ccOptions"): ...
signature(object = "GENccEnrichResult"): ...
signature(object = "GENccEnrichResult"): ...
signature(object = "GENccEnrichResult"): ...
signature(object = "GENccEnrichResult"): ...
Robert M Flight
data(ccData) locA <- grep("A",gseaRes$Tissues) locL <- grep("L",gseaRes$Tissues) locM <- grep("M",gseaRes$Tissues) A <- new("ccSigList",sigID=gseaRes$KEGGID[locA],categoryName="KEGG",annotation="org.Mm.eg") L <- new("ccSigList",sigID=gseaRes$KEGGID[locL],categoryName="KEGG",annotation="org.Mm.eg") M <- new("ccSigList",sigID=gseaRes$KEGGID[locM],categoryName="KEGG",annotation="org.Mm.eg") ccEnrichCol <- list(A=A,L=L,M=M) ccEnrichCol <- new("GENccEnrichResult", ccEnrichCol, categoryName="KEGG")data(ccData) locA <- grep("A",gseaRes$Tissues) locL <- grep("L",gseaRes$Tissues) locM <- grep("M",gseaRes$Tissues) A <- new("ccSigList",sigID=gseaRes$KEGGID[locA],categoryName="KEGG",annotation="org.Mm.eg") L <- new("ccSigList",sigID=gseaRes$KEGGID[locL],categoryName="KEGG",annotation="org.Mm.eg") M <- new("ccSigList",sigID=gseaRes$KEGGID[locM],categoryName="KEGG",annotation="org.Mm.eg") ccEnrichCol <- list(A=A,L=L,M=M) ccEnrichCol <- new("GENccEnrichResult", ccEnrichCol, categoryName="KEGG")
Get different attributes for the Entrez gene Ids
getGeneSymbol(id, annPackage) getGeneName(id, annPackage) getGO2ALLEGS(id, annPackage) getPATH2EG(id, annPackage) getAnnotation(id, annPackage, mapID, doUnlist=TRUE)getGeneSymbol(id, annPackage) getGeneName(id, annPackage) getGO2ALLEGS(id, annPackage) getPATH2EG(id, annPackage) getAnnotation(id, annPackage, mapID, doUnlist=TRUE)
id |
The IDs one wants to get information for. |
annPackage |
Which annotation package to use. |
mapID |
Which mapping to use |
doUnlist |
should the results be unlisted or not? |
The type of ID will change depending on the function. For getGene... the ID should be Entrez IDs. For getGO2ALLEGS Gene Ontology IDs should be used, and for getPATH2EG KEGG pathways IDs should be used. For getAnnotation, any ID can be used.
Returns the requested information.
These functions are generally called internally for mapping between genes and various objects.
Robert M Flight
Gets and sets the graphType for a couple of different ccEnrichResults objects
signature(object = "ccEnrichResult")signature(object = "GENccEnrichResult")ccEnrichResult GENccEnrichResult
This class extends the HyperGParams class in Category by providing options for multiple testing and the storing of extra data in addition to the gene list of interest (not currently used, but might be in the future).
Objects can be created by calls of the form new("HyperGParamsCC", ...). In general the user will not create these directly, but they are created and used by to carry out the enrichment calculations.
fdr:Object of class "numeric" The number of FDR runs to perform
data:Object of class "data.frame" Extra data stored in the object
geneIds:Object of class "ANY" The genes of interest
universeGeneIds:Object of class "ANY" The gene universe or background used (all the genes on the chip)
annotation:Object of class "character" The annotation package used to get information about the geneIds
datPkg:Object of class "DatPkg" Generated automatically from the annotation slot
categorySubsetIds:Object of class "ANY" A specific set of category IDs that one wants to restrict the testing to
categoryName:Object of class "character" What type of category to use, currently either "GO" or "KEGG"
pvalueCutoff:Object of class "numeric" What should be the p-value to decide significance
testDirection:Object of class "character" "over" or "under" represented annotation terms
Class "GOHyperGParams", directly.
No methods defined with class "HyperGParamsCC" in the signature.
Robert M Flight
HyperGResultCC ccEnrich Category-package
showClass("HyperGParamsCC")showClass("HyperGParamsCC")
Contains the results of performing a hypergeometric test on a HyperGParams object.
Objects can be created by calls of the form new("HyperGResultCC", ...).
fdr:Object of class "numeric" The number of FDR runs performed
fdrvalues:Object of class "numeric" The FDR values generated
pvalueType:Object of class "character" Whether to use p-values or FDR values in determing the significant terms returned
data:Object of class "data.frame" Extra data
pvalues:Object of class "numeric" P-values calculated for each term
oddsRatios:Object of class "numeric"
expectedCounts:Object of class "numeric"
catToGeneId:Object of class "list"
organism:Object of class "character"
annotation:Object of class "character"
geneIds:Object of class "ANY"
testName:Object of class "character"
pvalueCutoff:Object of class "numeric"
testDirection:Object of class "character"
Class "HyperGResult", directly.
Class "HyperGResultBase", by class "HyperGResult", distance 2.
signature(object = "HyperGResultCC"): ...
signature(object = "HyperGResultCC"): ...
signature(object = "HyperGResultCC"): ...
signature(r = "HyperGResultCC"): ...
signature(object = "HyperGResultCC"): ...
signature(object = "HyperGResultCC"): ...
signature(object = "HyperGResultCC"): ...
signature(object = "HyperGResultCC"): ...
Robert M Flight
showClass("HyperGResultCC")showClass("HyperGResultCC")
Performs the hypergeometric testing for HyperGParamsCC objects.
hyperGTestCC(p)hyperGTestCC(p)
p |
A |
This is the heart of categoryCompare, the function that calculates the HyperGeometric statistics for the given categories of annotation for each gene list.
Returns a HyperGResultCC object
Robert M Flight
HyperGParamsCC HyperGResultCC GOHyperGParamsCC KEGGHyperGParamsCC GOHyperGResultCC KEGGHyperGResultCC
require(GO.db) require(org.Hs.eg.db) data(ccData) g10 <- unique(table10$Entrez) testGO <- new("GOHyperGParamsCC", geneIds=g10, universeGeneIds=gUniverse, annotation="org.Hs.eg.db", ontology="CC", conditional=FALSE, testDirection="over",fdr=0, pvalueCutoff = 0.01) # ccHypRes <- hyperGTestCC(testGO) # summary(ccHypRes)require(GO.db) require(org.Hs.eg.db) data(ccData) g10 <- unique(table10$Entrez) testGO <- new("GOHyperGParamsCC", geneIds=g10, universeGeneIds=gUniverse, annotation="org.Hs.eg.db", ontology="CC", conditional=FALSE, testDirection="over",fdr=0, pvalueCutoff = 0.01) # ccHypRes <- hyperGTestCC(testGO) # summary(ccHypRes)
Extracts the listNames from ccGeneList or ccOptions objects.
listNames(object)listNames(object)
object |
This will be either a |
Robert M Flight
"mergedData"
Stores merged data tables from the "data" entry in a ccGeneList. This is useful for output later.
Objects can be created by calls of the form new("mergedData", ...).
.Data:Object of class "list"
useIDName:Object of class "character"
names:Object of class "character"
row.names:Object of class "data.frameRowLabels"
.S3Class:Object of class "character"
Class "data.frame", directly.
Class "list", by class "data.frame", distance 2.
Class "oldClass", by class "data.frame", distance 2.
Class "data.frameOrNULL", by class "data.frame", distance 2.
Class "vector", by class "data.frame", distance 3.
signature(saveObj = "list", compareResult = "ccCompareResult", mergedData = "mergedData")
Robert M. Flight
showClass("mergedData") data(ccData) mergeDat <- mergeLists(geneLists, ccOpts)showClass("mergedData") data(ccData) mergeDat <- mergeLists(geneLists, ccOpts)
mergeLists in Package categoryCompare
Merges the gene lists or the data tables from a ccGeneList object, providing a single table with all the input data, that can then be queried later, using cytTableOut
mergeLists(ccGeneList,ccOptions,isGene=TRUE)mergeLists(ccGeneList,ccOptions,isGene=TRUE)
ccGeneList |
a |
ccOptions |
a |
isGene |
are the identifiers genes, or something else (metabolites, etc) |
A mergedData object which is really just a glorified data frame. If the ccGeneList input had a data list, then these are all merged into a single table. Otherwise, it contains just the gene names and which list they were present in.
signature(ccGeneList = "ccGeneList", ccOptions = "ccOptions")ccGeneList ccOptions mergedData
data(ccData) g10 <- (unique(table10$Entrez[1:100])) g48 <- (unique(table48$Entrez[1:100])) list10 <- list(genes=g10, universe=gUniverse, annotation="org.Hs.eg.db", data=table10[1:100,]) list48 <- list(genes=g48, universe=gUniverse, annotation="org.Hs.eg.db", data=table48[1:100,]) geneLists <- list(T10=list10, T48=list48) geneLists <- new("ccGeneList", geneLists, ccType=c("BP","KEGG")) ccOpts <- new("ccOptions", listNames = names(geneLists)) mergedDat <- mergeLists(geneLists,ccOpts) list10 <- list(genes=g10, universe=gUniverse, annotation="org.Hs.eg.db") list48 <- list(genes=g48, universe=gUniverse, annotation="org.Hs.eg.db") geneLists <- list(T10=list10, T48=list48) geneLists <- new("ccGeneList", geneLists, ccType=c("BP","KEGG")) ccOpts <- new("ccOptions", listNames = names(geneLists)) mergedDat <- mergeLists(geneLists,ccOpts)data(ccData) g10 <- (unique(table10$Entrez[1:100])) g48 <- (unique(table48$Entrez[1:100])) list10 <- list(genes=g10, universe=gUniverse, annotation="org.Hs.eg.db", data=table10[1:100,]) list48 <- list(genes=g48, universe=gUniverse, annotation="org.Hs.eg.db", data=table48[1:100,]) geneLists <- list(T10=list10, T48=list48) geneLists <- new("ccGeneList", geneLists, ccType=c("BP","KEGG")) ccOpts <- new("ccOptions", listNames = names(geneLists)) mergedDat <- mergeLists(geneLists,ccOpts) list10 <- list(genes=g10, universe=gUniverse, annotation="org.Hs.eg.db") list48 <- list(genes=g48, universe=gUniverse, annotation="org.Hs.eg.db") geneLists <- list(T10=list10, T48=list48) geneLists <- new("ccGeneList", geneLists, ccType=c("BP","KEGG")) ccOpts <- new("ccOptions", listNames = names(geneLists)) mergedDat <- mergeLists(geneLists,ccOpts)
Extracts and sets the minimum number of genes that an annotation must have to be considered in subsequent steps.
minCount(object)minCount(object)
object |
This will be either a |
minCount(object) fetches the set minCount for HyperGResultCC and ccEnrichResult objects
minCount(object)<- will set the minCount for HyperGResultCC objects, and when applied to ccEnrichResult and ccEnrichCollection sets the minCount for all of the contained objects, so be careful if you want to use different minCounts for different results
Robert M Flight
HyperGResultCC ccEnrichResult ccEnrichCollection
data(ccData) enrichLists minCount(enrichLists) <- 5 enrichListsdata(ccData) enrichLists minCount(enrichLists) <- 5 enrichLists
Deletes from the graph those annotations with less than a certain number of genes
minNodes(cwObj, cutoff)minNodes(cwObj, cutoff)
cwObj |
a |
cutoff |
the minimum number of genes that an annotation must have |
Robert M Flight
CytoscapeWindowClass ccOutCyt
## Not run: hasCy <- (if (.Platform$OS.type %in% "windows") { (length(grep("Cytoscape", system("tasklist", intern=TRUE))) > 0)}) if hasCy { data(ccData) ccResults$BP <- breakEdges(ccResults$BP, 0.8) cwObj <- ccOutCyt(ccResults$BP,ccOpts) minNodes(cwObj, 5) } ## End(Not run)## Not run: hasCy <- (if (.Platform$OS.type %in% "windows") { (length(grep("Cytoscape", system("tasklist", intern=TRUE))) > 0)}) if hasCy { data(ccData) ccResults$BP <- breakEdges(ccResults$BP, 0.8) cwObj <- ccOutCyt(ccResults$BP,ccOpts) minNodes(cwObj, 5) } ## End(Not run)
Queries or sets the type of p-values to return from objects, either base calculated (pvals) or from fdr calculations (fdr)
pvalueType(object)pvalueType(object)
object |
Can be |
pvalueType(object) gets the type of p-values to be returned from HyperGResultCC and ccEnrichResult objects
pvalueType(object)<- will set the type of p-values to be returned from HyperGResultCC, ccEnrichResult, ccEnrichCollection. Note that for a ccEnrichCollection, the type is changed for all contained ccEnrichResults
Robert M Flight
HyperGResultCC ccEnrichResult ccEnrichCollection
# pvalueType-Methods data(ccData) ## Not run: pvalueType(enrichLists) # this returns an error pvalueType(enrichLists[[1]]) pvalueType(enrichLists[[1]][[1]]) # change the type for one of the results pvalueType(enrichLists[[1]]) <- 'pval' # Not recommended practice enrichLists # change for all of the results pvalueType(enrichLists) <- 'pval' enrichLists# pvalueType-Methods data(ccData) ## Not run: pvalueType(enrichLists) # this returns an error pvalueType(enrichLists[[1]]) pvalueType(enrichLists[[1]][[1]]) # change the type for one of the results pvalueType(enrichLists[[1]]) <- 'pval' # Not recommended practice enrichLists # change for all of the results pvalueType(enrichLists) <- 'pval' enrichLists
If the color of particular nodes have been modified from the original color scheme in ccOptions, this will reset them
signature(cwObj = "numeric", ccOpts = "ccOptions")What CytoscapeWindow to apply this to, and what ccOptions to use for the color scheme.
Note that optional arguments include node.attribute.name (default is 'fillcolor') and mode (default is 'lookup')
Robert M Flight
The show and summary methods for HyperGResultCC objects generated using hyperGTestCC
show, signature(object = "HyperGResultCC")summary, signature(object = "HyperGResultCC")Robert M Flight
## Not run: data(ccData) show(enrichLists) summary(enrichLists[[1]][[1]]) ## End(Not run)## Not run: data(ccData) show(enrichLists) summary(enrichLists[[1]][[1]]) ## End(Not run)