topGOdata-class: Class "topGOdata"

Description Objects from the Class Slots Methods Author(s) See Also Examples

Description

TODO: The node attributes are environments containing the genes/probes annotated to the respective node

If genes is a numeric vector than this should represent the gene's score. If it is factor it should discriminate the genes in interesting genes and the rest

TODO: it will be a good idea to replace the allGenes and allScore with an ExpressionSet class. In this way we can use tests like global test, globalAncova.... – ALL variables starting with . are just for internal class usage (private)

Objects from the Class

Objects can be created by calls of the form new("topGOdata", ontology, allGenes, geneSelectionFun, description, annotationFun, ...). ~~ describe objects here ~~

Slots

description:

Object of class "character" ~~

ontology:

Object of class "character" ~~

allGenes:

Object of class "character" ~~

allScores:

Object of class "ANY" ~~

geneSelectionFun:

Object of class "function" ~~

feasible:

Object of class "logical" ~~

nodeSize:

Object of class "integer" ~~

graph:

Object of class "graphNEL" ~~

expressionMatrix:

Object of class "matrix" ~~

phenotype:

Object of class "factor" ~~

Methods

allGenes

signature(object = "topGOdata"): ...

attrInTerm

signature(object = "topGOdata", attr = "character", whichGO = "character"): ...

attrInTerm

signature(object = "topGOdata", attr = "character", whichGO = "missing"): ...

countGenesInTerm

signature(object = "topGOdata", whichGO = "character"): ...

countGenesInTerm

signature(object = "topGOdata", whichGO = "missing"): ...

description<-

signature(object = "topGOdata"): ...

description

signature(object = "topGOdata"): ...

feasible<-

signature(object = "topGOdata"): ...

feasible

signature(object = "topGOdata"): ...

geneScore

signature(object = "topGOdata"): ...

geneSelectionFun<-

signature(object = "topGOdata"): ...

geneSelectionFun

signature(object = "topGOdata"): ...

genes

signature(object = "topGOdata"): A method for obtaining the list of genes, as a characther vector, which will be used in the further analysis.

numGenes

signature(object = "topGOdata"): A method for obtaining the number of genes, which will be used in the further analysis. It has the same effect as: lenght(genes(object)).

sigGenes

signature(object = "topGOdata"): A method for obtaining the list of significant genes, as a charachter vector.

genesInTerm

signature(object = "topGOdata", whichGO = "character"): ...

genesInTerm

signature(object = "topGOdata", whichGO = "missing"): ...

getSigGroups

signature(object = "topGOdata", test.stat = "classicCount"): ...

getSigGroups

signature(object = "topGOdata", test.stat = "classicScore"): ...

graph<-

signature(object = "topGOdata"): ...

graph

signature(object = "topGOdata"): ...

initialize

signature(.Object = "topGOdata"): ...

ontology<-

signature(object = "topGOdata"): ...

ontology

signature(object = "topGOdata"): ...

termStat

signature(object = "topGOdata", whichGO = "character"): ...

termStat

signature(object = "topGOdata", whichGO = "missing"): ...

updateGenes

signature(object = "topGOdata", geneList = "numeric", geneSelFun = "function"): ...

updateGenes

signature(object = "topGOdata", geneList = "factor", geneSelFun = "missing"): ...

updateTerm<-

signature(object = "topGOdata", attr = "character"): ...

usedGO

signature(object = "topGOdata"): ...

Author(s)

Adrian Alexa

See Also

buildLevels, annFUN

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
## load the dataset 
data(geneList)
library(package = affyLib, character.only = TRUE)

## the distribution of the adjusted p-values
hist(geneList, 100)

## how many differentially expressed genes are:
sum(topDiffGenes(geneList))

## build the topGOdata class 
GOdata <- new("topGOdata",
              ontology = "BP",
              allGenes = geneList,
              geneSel = topDiffGenes,
              description = "GO analysis of ALL data: Differential Expression between B-cell and T-cell",
              annot = annFUN.db,
              affyLib = affyLib)

## display the GOdata object
GOdata

##########################################################
## Examples on how to use the methods
##########################################################

## description of the experiment
description(GOdata)

## obtain the genes that will be used in the analysis
a <- genes(GOdata)
str(a)
numGenes(GOdata)

## obtain the score (p-value) of the genes
selGenes <- names(geneList)[sample(1:length(geneList), 10)]
gs <- geneScore(GOdata, whichGenes = selGenes)
print(gs)

## if we want an unnamed vector containing all the feasible genes
gs <- geneScore(GOdata, use.names = FALSE)
str(gs)

## the list of significant genes
sg <- sigGenes(GOdata)
str(sg)
numSigGenes(GOdata)

## to update the gene list 
.geneList <- geneScore(GOdata, use.names = TRUE)
GOdata ## more available genes
GOdata <- updateGenes(GOdata, .geneList, topDiffGenes)
GOdata ## the available genes are now the feasible genes

## the available GO terms (all the nodes in the graph)
go <- usedGO(GOdata)
length(go)

## to list the genes annotated to a set of specified GO terms
sel.terms <- sample(go, 10)
ann.genes <- genesInTerm(GOdata, sel.terms)
str(ann.genes)

## the score for these genes
ann.score <- scoresInTerm(GOdata, sel.terms)
str(ann.score)

## to see the number of annotated genes
num.ann.genes <- countGenesInTerm(GOdata)
str(num.ann.genes)

## to summarise the statistics
termStat(GOdata, sel.terms)

Example output

Loading required package: BiocGenerics
Loading required package: parallel

Attaching package: 'BiocGenerics'

The following objects are masked from 'package:parallel':

    clusterApply, clusterApplyLB, clusterCall, clusterEvalQ,
    clusterExport, clusterMap, parApply, parCapply, parLapply,
    parLapplyLB, parRapply, parSapply, parSapplyLB

The following objects are masked from 'package:stats':

    IQR, mad, sd, var, xtabs

The following objects are masked from 'package:base':

    Filter, Find, Map, Position, Reduce, anyDuplicated, append,
    as.data.frame, cbind, colMeans, colSums, colnames, do.call,
    duplicated, eval, evalq, get, grep, grepl, intersect, is.unsorted,
    lapply, lengths, mapply, match, mget, order, paste, pmax, pmax.int,
    pmin, pmin.int, rank, rbind, rowMeans, rowSums, rownames, sapply,
    setdiff, sort, table, tapply, union, unique, unsplit, which,
    which.max, which.min

Loading required package: graph
Loading required package: Biobase
Welcome to Bioconductor

    Vignettes contain introductory material; view with
    'browseVignettes()'. To cite Bioconductor, see
    'citation("Biobase")', and for packages 'citation("pkgname")'.

Loading required package: GO.db
Loading required package: AnnotationDbi
Loading required package: stats4
Loading required package: IRanges
Loading required package: S4Vectors

Attaching package: 'S4Vectors'

The following object is masked from 'package:base':

    expand.grid


Loading required package: SparseM

Attaching package: 'SparseM'

The following object is masked from 'package:base':

    backsolve


groupGOTerms: 	GOBPTerm, GOMFTerm, GOCCTerm environments built.

Attaching package: 'topGO'

The following object is masked from 'package:IRanges':

    members

Loading required package: org.Hs.eg.db


[1] 50

Building most specific GOs .....
	( 1555 GO terms found. )

Build GO DAG topology ..........
	( 4396 GO terms and 10270 relations. )

Annotating nodes ...............
	( 310 genes annotated to the GO terms. )
Warning message:
In rsqlite_fetch(res@ptr, n = n) :
  Don't need to call dbFetch() for statements, only for queries

------------------------- topGOdata object -------------------------

 Description:
   -  GO analysis of ALL data: Differential Expression between B-cell and T-cell 

 Ontology:
   -  BP 

 323 available genes (all genes from the array):
   - symbol:  1095_s_at 1130_at 1196_at 1329_s_at 1340_s_at  ...
   - score :  1 1 0.62238 0.541224 1  ...
   - 50  significant genes. 

 310 feasible genes (genes that can be used in the analysis):
   - symbol:  1095_s_at 1130_at 1196_at 1329_s_at 1340_s_at  ...
   - score :  1 1 0.62238 0.541224 1  ...
   - 46  significant genes. 

 GO graph (nodes with at least  1  genes):
   - a graph with directed edges
   - number of nodes = 4396 
   - number of edges = 10270 

------------------------- topGOdata object -------------------------

[1] "GO analysis of ALL data: Differential Expression between B-cell and T-cell"
 chr [1:310] "1095_s_at" "1130_at" "1196_at" "1329_s_at" "1340_s_at" ...
[1] 310
    258_at   36047_at   32641_at   40726_at   39630_at   33266_at  1095_s_at 
1.00000000 0.16212923 0.13557561 0.35745356 0.66562728 1.00000000 1.00000000 
  41717_at   36839_at   41869_at 
0.12531451 0.01390908 1.00000000 
 num [1:310] 1 1 0.622 0.541 1 ...
 chr [1:46] "1347_at" "1792_g_at" "31864_at" "32074_at" "32861_s_at" ...
[1] 46

------------------------- topGOdata object -------------------------

 Description:
   -  GO analysis of ALL data: Differential Expression between B-cell and T-cell 

 Ontology:
   -  BP 

 323 available genes (all genes from the array):
   - symbol:  1095_s_at 1130_at 1196_at 1329_s_at 1340_s_at  ...
   - score :  1 1 0.62238 0.541224 1  ...
   - 50  significant genes. 

 310 feasible genes (genes that can be used in the analysis):
   - symbol:  1095_s_at 1130_at 1196_at 1329_s_at 1340_s_at  ...
   - score :  1 1 0.62238 0.541224 1  ...
   - 46  significant genes. 

 GO graph (nodes with at least  1  genes):
   - a graph with directed edges
   - number of nodes = 4396 
   - number of edges = 10270 

------------------------- topGOdata object -------------------------


------------------------- topGOdata object -------------------------

 Description:
   -  GO analysis of ALL data: Differential Expression between B-cell and T-cell 

 Ontology:
   -  BP 

 310 available genes (all genes from the array):
   - symbol:  1095_s_at 1130_at 1196_at 1329_s_at 1340_s_at  ...
   - score :  1 1 0.62238 0.541224 1  ...
   - 46  significant genes. 

 310 feasible genes (genes that can be used in the analysis):
   - symbol:  1095_s_at 1130_at 1196_at 1329_s_at 1340_s_at  ...
   - score :  1 1 0.62238 0.541224 1  ...
   - 46  significant genes. 

 GO graph (nodes with at least  1  genes):
   - a graph with directed edges
   - number of nodes = 4396 
   - number of edges = 10270 

------------------------- topGOdata object -------------------------

[1] 4396
List of 10
 $ GO:0043312: chr [1:19] "1793_at" "307_at" "32837_at" "33153_at" ...
 $ GO:0031124: chr [1:2] "1945_at" "34736_at"
 $ GO:0070371: chr [1:18] "1130_at" "1408_at" "1542_at" "1634_s_at" ...
 $ GO:0072677: chr [1:2] "1574_s_at" "33981_at"
 $ GO:0045190: chr [1:7] "1574_s_at" "1634_s_at" "1830_s_at" "32861_s_at" ...
 $ GO:0060148: chr [1:5] "1130_at" "1634_s_at" "1830_s_at" "1844_s_at" ...
 $ GO:0060389: chr [1:4] "1634_s_at" "1830_s_at" "40421_at" "41445_at"
 $ GO:1903055: chr [1:5] "1634_s_at" "1830_s_at" "38711_at" "39838_at" ...
 $ GO:0007067: chr [1:171] "1095_s_at" "1196_at" "1329_s_at" "1340_s_at" ...
 $ GO:0051702: chr [1:2] "32241_at" "34763_at"
List of 10
 $ GO:0043312: num [1:19] 1 1 1 1 1 ...
 $ GO:0031124: num [1:2] 0.522 0.383
 $ GO:0070371: num [1:18] 1 0.43 1 1 1 ...
 $ GO:0072677: num [1:2] 0.1222 0.0416
 $ GO:0045190: num [1:7] 0.122156 1 1 0.000395 0.041561 ...
 $ GO:0060148: num [1:5] 1 1 1 1 1
 $ GO:0060389: num [1:4] 1 1 0.158 1
 $ GO:1903055: num [1:5] 1 1 0.02424 0.00121 1
 $ GO:0007067: num [1:171] 1 0.622 0.541 1 1 ...
 $ GO:0051702: num [1:2] 0.4903 0.0263
 Named int [1:4396] 83 7 2 1 1 1 1 9 52 37 ...
 - attr(*, "names")= chr [1:4396] "GO:0000003" "GO:0000018" "GO:0000022" "GO:0000045" ...
           Annotated Significant Expected
GO:0043312        19           5     2.82
GO:0031124         2           0     0.30
GO:0070371        18           1     2.67
GO:0072677         2           0     0.30
GO:0045190         7           1     1.04
GO:0060148         5           0     0.74
GO:0060389         4           0     0.59
GO:1903055         5           1     0.74
GO:0007067       171          17    25.37
GO:0051702         2           0     0.30

topGO documentation built on Nov. 8, 2020, 6:55 p.m.