subKEGGgraph            package:KEGGgraph            R Documentation

_S_u_b_s_e_t _K_E_G_G _g_r_a_p_h, _i_n_c_l_u_d_i_n_g _s_u_b_s_e_t_t_i_n_g _n_o_d_e _a_n_d _e_d_g_e _a_t_t_r_i_b_u_t_e_s

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

     'subKEGGgraph' extends generic method 'subGraph' and subsets the
     KEGG graph. Both 'subKEGGgraph' and 'subGraph' can be used to
     subset the graph, the difference lies in whether the node and edge
     attributes from KEGG are also subset ('subKEGGgraph') or not
     ('subGraph').

     See details below.

_U_s_a_g_e:

     subKEGGgraph(nodes, graph)

_A_r_g_u_m_e_n_t_s:

   nodes: Node names to subset

   graph: A graph parsed from KGML files, produced by
          'parseKGML2Graph', 'KEGGpathway2Graph' or
          'parseKGMLexpandMaps'

_D_e_t_a_i_l_s:

     'subGraph' does not subset the node or edge attributes, hence the
     results of 'getKEGGnodeData' and 'getKEGGedgeData' does not map to
     the nodes and edges in the subgraph in a one-to-one manner, with
     attributes of removed nodes and edges still remaining in the
     subGraph.

     'subKEGGgraph' calls 'subGraph' first to subset the graph, and
     then it also subsets the KEGGnodeData and KEGGedgeData so that
     they are one-to-one mapped to the nodes and edges in the subgraph.

_V_a_l_u_e:

     A graph with nodeData and edgeData.

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

     Jitao David Zhang <URL: mailto:j.zhang@dkfz.de>

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

     sfile <- system.file("extdata/hsa04010.xml",package="KEGGgraph")
     gR <- parseKGML2Graph(sfile,expandGenes=TRUE)
     subs <-  c("hsa:1432",edges(gR)$`hsa:1432`,"hsa:5778","hsa:5801",
     "hsa:84867","hsa:11072","hsa:5606","hsa:5608","hsa:5494","hsa:5609")
     gR.keggsub <- subKEGGgraph(subs, gR)
     gR
     gR.keggsub

