prune.graph               package:nem               R Documentation

_P_r_u_n_e_s _s_p_u_r_i_o_u_s _e_d_g_e_s _i_n _a _p_h_e_n_o_t_y_p_i_c _h_i_e_r_a_r_c_h_y

_D_e_s_c_r_i_p_t_i_o_n:

     A heuristic to prune spurious edges in a pehnotypic hierarchy

_U_s_a_g_e:

     prune.graph(g,cutIN=NULL,cutOUT=NULL,quant=.95,verbose=TRUE)

_A_r_g_u_m_e_n_t_s:

       g: an adjacency matrix or a 'graphNEL' object

   cutIN: minimum number of missing in-edges required to cut all
          in-edges. Default

  cutOUT: minimum number of missing out-edges required to cut all
          out-edges

   quant: if 'cutIN' or 'cutOUT' are not assigned, a quantile 'quant'
          of the distribution of missing in- or out-edges for all nodes
          is used

 verbose: Default: TRUE

_D_e_t_a_i_l_s:

     'prune.graph' provides a heuristic approach to prune surious
     edges. 'prune.graph' compares the input graph to its transitive
     closure, and counts for each node how many incoming and outgoing
     edges are missing. If the number is bigger than a user-defined
     cutoff, all incoming (outgoing) edges are removed.

_V_a_l_u_e:

   graph: the pruned phenotypic hierarchy (a 'graphNEL' object)

 removed: number of removed edges

missing.in: number of missing in-edges for each node

missing.out: number of missing out-edges for each node

_A_u_t_h_o_r(_s):

     Florian Markowetz <URL: http://genomics.princeton.edu/~florian>

_E_x_a_m_p_l_e_s:

         # a transitively closed core with two spurious edges
         g <- matrix(0,5,5)
         g[1,2] <- 1
         g[2,c(3,4)] <- 1
         g[3,4] <- 1
         g[4,5] <- 1
         dimnames(g) <- list(LETTERS[1:5],LETTERS[1:5])
         g <- as(g,"graphNEL")
         
         # prune graph
         gP <- prune.graph(g)
         
         # plot
         par(mfrow=c(1,2))
         plot(g,main="two spurious edges")
         plot(gP$graph,main="pruned")
         
         

