How to export the edges information?


I was doing some analysis of bacterial images, and searching for the best way to plot a tree with the mother cells and the daughter cells and found the graphviz. I got the plot I wanted following the example, but I had some problems:

I would like to extract the information used in this plot, the connections between the cells, I tried and I couldn’t and I didn’t find how to do it. Looking at stackoverflow it is suggested to use a ‘cliptree’ file that does exactly what I want, lists with each hierarchy found ( I didn’t find this file in my installation and I couldn’t use the other suggestions.

Another point, is there any way to prune the plot? I have a very big dataset and the plot is getting unfeasible, I would like to plot only the nodes with a certain len. I attached the plot from my data
unix.gv.pdf (248.6 KB).

I know it may sound simple, but I would really appreciate the support.



Here is a copy of the cliptree code. I did not write it, I’m just the messenger.
Based on a very quick read, my solution on stackoverflow looks pretty inefficient. I’ll think about improving it.

/* Construct subgraph reachable from node ARGV[0] by forward edges */
  node_t r = node($,ARGV[0]);
  $tvroot = r;
  $tvtype = TV_fwd;

There are ways to cut-up graphs like yours, but I think you misspoke about “nodes with a certain length” (nodes don’t have length). Might you mean:

  • trees with a nodes minimum (or maximum) number of nodes?
  • trees with a minimum (or maximum) number of ranks (width in this case) ?
  • other?

Thank you. I’ll try this code.

Yes you are right, nodes don’t have length, but since this info are stored into a list or dict they have length. Sorry about this misunderstanding.

You might also look at the Graphviz program ccomps (
It may be just what you are looking for.