annotate toolboxes/FullBNT-1.0.7/docs/graphviz.html @ 0:cc4b1211e677 tip

initial commit to HG from Changeset: 646 (e263d8a21543) added further path and more save "camirversion.m"
author Daniel Wolff
date Fri, 19 Aug 2016 13:07:06 +0200
parents
children
rev   line source
Daniel@0 1 <h1>Visualizing graph structures in matlab</h1>
Daniel@0 2
Daniel@0 3 We discuss some methods for visualizing graphs/ networks, including automatic
Daniel@0 4 layout of the nodes.
Daniel@0 5 We assume the graph is represented as an adjacency matrix.
Daniel@0 6 If using BNT, you can access the DAG using
Daniel@0 7 <pre>
Daniel@0 8 G = bnet.dag;
Daniel@0 9 </pre>
Daniel@0 10
Daniel@0 11 <h2>Matlab's biograph function</h2>
Daniel@0 12
Daniel@0 13 The Mathworks computational biology toolbox
Daniel@0 14 has many useful graph related functions, including visualization.
Daniel@0 15 <br>
Daniel@0 16 Click
Daniel@0 17 <a href="http://www.mathworks.com/products/bioinfo/demos.html?file=/products/demos/shipping/bioinfo/graphtheorydemo.html#4">
Daniel@0 18 here</a>
Daniel@0 19 for a demo.
Daniel@0 20
Daniel@0 21
Daniel@0 22
Daniel@0 23 <h2>Cemgil's draw_graph</h2>
Daniel@0 24
Daniel@0 25 You can visualize an arbitrary graph (such as one learned using the
Daniel@0 26 structure learning routines) with Matlab code written by
Daniel@0 27 <a href="http://www-sigproc.eng.cam.ac.uk/~atc27/matlab/layout.html">
Daniel@0 28 Ali Taylan Cemgil</a>
Daniel@0 29 from the University of Cambridge.
Daniel@0 30 A modified version of this code
Daniel@0 31 is <a href="GraphViz.zip">here</a>
Daniel@0 32 (this is already bundled with BNT).
Daniel@0 33 Just type
Daniel@0 34 <pre>
Daniel@0 35 draw_graph(G);
Daniel@0 36 </pre>
Daniel@0 37 For example, this is the output produced on a
Daniel@0 38 <a href="http://www.cs.ubc.ca/~murphyk/Software/BNT/usage.html#qmr">random QMR-like model</a>:
Daniel@0 39 <p>
Daniel@0 40 <img src="Figures/qmr.rnd.jpg">
Daniel@0 41 <p>
Daniel@0 42
Daniel@0 43 <h2>Pajek</h2>
Daniel@0 44
Daniel@0 45 <a href="http://vlado.fmf.uni-lj.si/pub/networks/pajek">Pajek</a>
Daniel@0 46 is an excellent, free Windows program for graph layout.
Daniel@0 47 Use <a href="adj2pajek2.m">adj2pajek2.m</a> to convert a graph to the
Daniel@0 48 Pajek file format.
Daniel@0 49 <br>
Daniel@0 50 Then Choose File->Network->Read from the menu.
Daniel@0 51
Daniel@0 52 <h2>AT&T Graphviz</h2>
Daniel@0 53
Daniel@0 54 <a href="http://www.research.att.com/sw/tools/graphviz">graphhviz</a>
Daniel@0 55 is an
Daniel@0 56 open-source graph visualization package from AT&T.
Daniel@0 57 Use
Daniel@0 58 <a href="graph_to_dot.m">graph_to_dot</a>
Daniel@0 59 to convert an adjacency matrix to
Daniel@0 60 the AT&T file format (the "dot" format).
Daniel@0 61 You then use dot to convert it to postscript:
Daniel@0 62 <pre>
Daniel@0 63 graph_to_dot(G, 'filename', 'foo.dot');
Daniel@0 64 dot -Tps foo.dot -o foo.ps
Daniel@0 65 ghostview foo.ps &
Daniel@0 66 </pre>