GetSubGraph: Extract a subgraph with a given topology from a graph

Description Usage Arguments Value

View source: R/graphs.R


Note that all subgraph are returned only once. So, for example, if A and B are two end leaves of a tree and 'end2end' is being used, only the path for A to B or the path from Bt o A will be returned.


GetSubGraph(Net, Structure, Nodes = NULL, Circular = TRUE,
  KeepEnds = TRUE)



an igraph network object


a string specifying the structure to return. The following options are available:

  • 'circle', all the circles of a given length (specified by Nodes) present in the data. If Nodes is unspecified the algorithm will look for the largest circle avaialble.

  • 'branches', all the linear path connecting the branching points

  • 'branches&bpoints', all the linear path connecting the branching points and all of the branching points

  • 'branching', all the subtree associted with a branching point (i.e., a tree encompassing the branching points and the closests branching points and end points)

  • 'end2end', all linear paths connecting end points (or leaf)


the number of nodes (for cycle detection)


a boolean indicating whether the circle should contain the initial points at the beginning and at the end


boolean, should the end points (overlapping between structures) be included when Structure = 'branches' or 'branching'


a list of nodes defining the structures under consideration

Albluca/ElPiGraph.R documentation built on June 10, 2018, 5:22 p.m.