makeGOGraph             package:GOstats             R Documentation

_C_o_n_s_t_r_u_c_t _a _G_O _G_r_a_p_h

_D_e_s_c_r_i_p_t_i_o_n:

     The directed acyclic graph (DAG) based on finding the most
     specific terms for the supplied Entrez Gene IDs is constructed and
     returned. The constructuion is per GO ontology (there are three,
     MF, BP and CC) and once the most specific terms have been
     identified then all less specific terms are found (these are the
     parents of the terms) and then their parents and so on, until the
     root is encountered.

_U_s_a_g_e:

     makeGOGraph(x, Ontology = "MF", removeRoot = TRUE, mapfun = NULL,
                 chip = NULL)

_A_r_g_u_m_e_n_t_s:

       x: A vector of Entrez Gene IDs. 

Ontology: Which GO ontology to use (CC, BP, or MF). 

removeRoot: A logical value indicating whether the GO root node should
          be removed or not.

  mapfun: A function taking a character vector of Entrez Gene IDs as
          its only argument and returning a list of "GO lists" matching
          the structure of the lists in the GO maps of annotation data
          packages. The function should behave similarly to 'mget(x,
          eg2gomap, ifnotfound=NA)', that is, 'NA' should be returned
          if a specified Entrez ID has no GO mapping.  See details for
          the interaction of 'mapfun' and 'chip'.

    chip: The name of a DB-based annotation data package (the name will
          end in ".db").  This package will be used to generate an
          Entrez ID to GO ID mapping instead of 'mapfun'.

_D_e_t_a_i_l_s:

     For each supplied Entrez Gene identifier all the GO annotations
     (in the specified ontology) are found.  The mapping is achieved in
     one of three ways:

        1.  If 'mapfun' is provided, it will be used to perform the
           needed lookups.  In this case, 'chip' will be ignored.

        2.  If 'chip' is provided and 'mapfun=NULL', then the needed
           lookups will be done based on the Entrez to GO mappings
           encapsulated in the specified annotation data package.  This
           is the recommended usage.

        3.  If 'mapfun' and 'chip' are 'NULL' or missing, then the
           function will attempt to load the GO package (the
           environment-based package, distinct from GO.db).  This
           package contains a legacy environment mapping Entrez IDs to
           GO IDs.  If the GO package is not available, an error will
           be raised. Omitting both 'mapfun' and 'chip' is not
           recommended as it is not compatible with the DB-based
           annotation data packages.

     The mappings are different for the different ontologies. Typically
     a GO indentifier is used only in one specific ontology.

     The resulting structure is stored in a graph using the 'graph'
     package, again from Bioconductor.

_V_a_l_u_e:

     An object that inherits from the 'graph' class. The particular
     implementation is not specified.

_A_u_t_h_o_r(_s):

     R. Gentleman

_R_e_f_e_r_e_n_c_e_s:

     The Gene Ontology Consortium

_S_e_e _A_l_s_o:

     'oneGOGraph'

_E_x_a_m_p_l_e_s:

      library("hgu95av2.db")
      set.seed(321)
      uniqun <- function(x) unique(unlist(x))
      gN <- uniqun(sample(hgu95av2ENTREZID, 4))
      gg1 <- makeGOGraph(gN, "BP", chip="hgu95av2.db")

