topGOdata-class            package:topGO            R Documentation

_C_l_a_s_s "_t_o_p_G_O_d_a_t_a"

_D_e_s_c_r_i_p_t_i_o_n:

     TODO: The node atributes 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 exprSet class. In this way we can use tests like global
     test, globalAncova.... - ALL variables sarting with . are just for
     internal class usage (private)

_O_b_j_e_c_t_s _f_r_o_m _t_h_e _C_l_a_s_s:

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

_S_l_o_t_s:

     '_d_e_s_c_r_i_p_t_i_o_n': Object of class '"character"' ~~ 

     '_o_n_t_o_l_o_g_y': Object of class '"character"' ~~ 

     '_a_l_l_G_e_n_e_s': Object of class '"character"' ~~ 

     '_a_l_l_S_c_o_r_e_s': Object of class '"ANY"' ~~ 

     '_g_e_n_e_S_e_l_e_c_t_i_o_n_F_u_n': Object of class '"function"' ~~ 

     '_f_e_a_s_i_b_l_e': Object of class '"logical"' ~~ 

     '_g_r_a_p_h': Object of class '"graphNEL"' ~~ 

_M_e_t_h_o_d_s:

     _a_l_l_G_e_n_e_s 'signature(object = "topGOdata")': ... 

     _a_t_t_r_I_n_T_e_r_m 'signature(object = "topGOdata", attr = "character",
          whichGO = "character")': ... 

     _a_t_t_r_I_n_T_e_r_m 'signature(object = "topGOdata", attr = "character",
          whichGO = "missing")': ... 

     _c_o_u_n_t_G_e_n_e_s_I_n_T_e_r_m 'signature(object = "topGOdata", whichGO =
          "character")': ... 

     _c_o_u_n_t_G_e_n_e_s_I_n_T_e_r_m 'signature(object = "topGOdata", whichGO =
          "missing")': ... 

     _d_e_s_c_r_i_p_t_i_o_n<- 'signature(object = "topGOdata")': ... 

     _d_e_s_c_r_i_p_t_i_o_n 'signature(object = "topGOdata")': ... 

     _f_e_a_s_i_b_l_e<- 'signature(object = "topGOdata")': ... 

     _f_e_a_s_i_b_l_e 'signature(object = "topGOdata")': ... 

     _g_e_n_e_S_c_o_r_e 'signature(object = "topGOdata")': ... 

     _g_e_n_e_S_e_l_e_c_t_i_o_n_F_u_n<- 'signature(object = "topGOdata")': ... 

     _g_e_n_e_S_e_l_e_c_t_i_o_n_F_u_n 'signature(object = "topGOdata")': ... 

     _g_e_n_e_s 'signature(object = "topGOdata")': ... 

     _g_e_n_e_s_I_n_T_e_r_m 'signature(object = "topGOdata", whichGO =
          "character")': ... 

     _g_e_n_e_s_I_n_T_e_r_m 'signature(object = "topGOdata", whichGO =
          "missing")': ... 

     _g_e_n_T_a_b_l_e 'signature(object = "topGOdata", resList = "list")': ... 

     _G_e_n_T_a_b_l_e 'signature(object = "topGOdata", ...)': ... 

     _g_e_t_S_i_g_G_r_o_u_p_s 'signature(object = "topGOdata", test.stat =
          "classicCount")': ... 

     _g_e_t_S_i_g_G_r_o_u_p_s 'signature(object = "topGOdata", test.stat =
          "classicScore")': ... 

     _g_r_a_p_h<- 'signature(object = "topGOdata")': ... 

     _g_r_a_p_h 'signature(object = "topGOdata")': ... 

     _i_n_i_t_i_a_l_i_z_e 'signature(.Object = "topGOdata")': ... 

     _n_u_m_G_e_n_e_s 'signature(object = "topGOdata")': ... 

     _o_n_t_o_l_o_g_y<- 'signature(object = "topGOdata")': ... 

     _o_n_t_o_l_o_g_y 'signature(object = "topGOdata")': ... 

     _p_r_i_n_t 'signature(x = "topGOdata")': ... 

     _s_i_g_G_e_n_e_s 'signature(object = "topGOdata")': ... 

     _t_e_r_m_S_t_a_t 'signature(object = "topGOdata", whichGO = "character")':
          ... 

     _t_e_r_m_S_t_a_t 'signature(object = "topGOdata", whichGO = "missing")':
          ... 

     _u_p_d_a_t_e_G_e_n_e_s 'signature(object = "topGOdata", geneList = "numeric",
          geneSelFun = "function")': ... 

     _u_p_d_a_t_e_G_e_n_e_s 'signature(object = "topGOdata", geneList = "factor",
          geneSelFun = "missing")': ... 

     _u_p_d_a_t_e_T_e_r_m<- 'signature(object = "topGOdata", attr =
          "character")': ... 

     _u_s_e_d_G_O 'signature(object = "topGOdata")': ... 

_A_u_t_h_o_r(_s):

     Adrian Alexa

_S_e_e _A_l_s_o:

     'buildLevels', 'mapGenes2GOgraph', 'annFUN.hgu'

_E_x_a_m_p_l_e_s:

     ## load the ALL dataset and the annotation library
     library(ALL); data(ALL)
     affyLib <- annotation(ALL)
     library(package = affyLib, character.only = TRUE)

     library(genefilter)
     f1 <- pOverA(0.25, log2(100))
     f2 <- function(x) (IQR(x) > 0.5)
     ff <- filterfun(f1, f2)
     ALL <- ALL[genefilter(ALL, ff), ]

     ## obtain the list of differentially expressed genes
     ## discriminate B-cell from T-cell
     classLabel <- as.integer(sapply(ALL$BT, function(x) return(substr(x, 1, 1) == 'T')))

     ## over-expressed genes for T-cell samples
     geneList <- getPvalues(exprs(ALL), classlabel = classLabel)

     ## the distribution of the adjusted p-values
     hist(geneList, 100)
     hist(geneList[geneList < 1], 100)

     ## define a function to select the "significant" genes
     topDiffGenes <- function(allScore) {
       return(allScore < 0.01)
     }
     ## 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.hgu,
                   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)

