[Bio] / Speck / README Repository:
ViewVC logotype

Annotation of /Speck/README

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (view) (download)

1 : sheradon 1.1 Larry Sheradon
2 :     sheradon@uchicago.edu
3 :     September 9, 2004
4 :    
5 :     ====================
6 :     Included modules:
7 :     ====================
8 :    
9 :     SpeckCanvas - Base class for the other various canvases. Doesn't draw or
10 :     do anything by itself, just sets up windowing, events, etc. that should
11 :     be common to derived canvas classes.
12 :    
13 :     DotCanvas - Displays Graphviz objects. Constructor takes the parent window
14 :     and the data, which is the string representation of a graph, as in a .dot file.
15 :     Optional color= argument can be given to specify the color scheme; see DotCanvas.py
16 :     for specifics.
17 :    
18 :     *DotViewer - Run from the command-line, reads the DOT file you give as the argument and
19 :     makes a DotCanvas view on it.
20 :    
21 :     *SpeckRemoteControl - A standalone wxPython app that provides a mouse/kb input area to remotely
22 :     manipulate a SpeckCanvas (derivative). It uses xmlrpc to send events to the specified
23 :     server (be sure to press "set server" after typing in the hostname of the machine
24 :     running your canvas). It can be run on multiple computers (tablets, PCs, laptops, etc)
25 :     simultaneously, sending input to the same app.
26 :    
27 :     SpeckServer - Runs an xmlrpc server, listening for events from the above client. If you want
28 :     to use this, pass a serverPort=nnnn parameter to your SpeckCanvas constructor. Otherwise the
29 :     canvas won't run as a server. You needn't interact with anything in this file, really.
30 :    
31 :     Chromium - Communicates with the Chromium tiled display package to put up one of
32 :     the canvases on a mural. Call display() with the name of the mural, the classname
33 :     of the canvas you want to create, and any arguments to pass to the canvas' constructor.
34 :     At the moment it's only been used/tested with the uM2. The AM probably needs more complicated
35 :     procedures to use the TeraGrid?
36 :     See documentation in Chromium.py for details.
37 :    
38 :     JGLayout (2,3) - Perform a JGraph layout. JGLayout.layoutDot is what you would use.
39 :     2.py runs via Jython and interacts with the JGraph Java package. 3.java is straight Java and
40 :     implements a custom algorithm in JGraph style.
41 :    
42 :     KPLayout - A little experimental algorithm based on papers by Karp&Paley and Becker&Rojas.
43 :     Not especially useful... slow and needs more work to give useful results on graphs of any size.
44 :    
45 :     PixFont - Just allows more reasonable OpenGL text drawing. Scalable (unlike GL's bitmap fonts)
46 :     and perhaps faster? For usage, see documentation in PixFont.py for drawString().
47 :    
48 :     (* signifies executable scripts)
49 :    
50 :    
51 :    
52 :     ======================
53 :     Some usage examples:
54 :     ======================
55 :    
56 :     1) As in DotViewer.py, creates a simple wx app that displays the DOTfile specified at cmdline.
57 :    
58 :     --------------------------------------------------------------------------------------------
59 :     #!/usr/bin/env python
60 :    
61 :     from Speck.DotCanvas import DotCanvas
62 :     from wxPython.wx import *
63 :    
64 :     if len(sys.argv) > 1: fn = sys.argv[1]
65 :     else:
66 :     print 'Usage: %s <filename.dot>' % sys.argv[0]
67 :     sys.exit(-1)
68 :     app = wxPySimpleApp()
69 :     win = wxFrame(None, wxID_ANY, 'Speck DOT viewer', size = (640, 480))
70 :     DotCanvas(win, file(fn).read())
71 :     win.Show(True)
72 :     app.MainLoop()
73 :     --------------------------------------------------------------------------------------------
74 :    
75 :    
76 :     2) You can grab the data object and twiddle its attributes while it's being displayed.
77 :     Suppose we want to write an application that shows a graph and updates node or edge labels
78 :     periodically, maybe running a simulation on the side or getting new data. Assume we've
79 :     already opened such a window and canvas, then we might use a function like this...
80 :    
81 :     --------------------------------------------------------------------------------------------
82 :     def update(dc, src, tgt, label, redrawNow=False):
83 :     """Changes the label on the edge src->tgt to label.
84 :     Will repaint the canvas immediately if redrawNow is True, otherwise the change will be
85 :     visible on the next OnPaint().
86 :     @type g: DotCanvas
87 :     @type src, tgt: string
88 :     @type rate: string, int, float... anything representable as a string.
89 :     """
90 :     g = dc.dot # get data object from canvas
91 :     e = g.get_edge(src, tgt) # grab Edge object
92 :     e.label = str(label) # set its label attribute
93 :     fred.needUpdate = True # flag that the next paint should look at the data
94 :     if redrawNow: fred.OnPaint()
95 :     --------------------------------------------------------------------------------------------
96 :    
97 :     That is, if you haven't started a wxApp loop... then execution is stuck in there. It shouldn't
98 :     be too hard to figure out a way around this, but here are some ideas:
99 :     a) Put the side calculating stuff inside the wx application, as a button event etc.
100 :     b) Make a subclass of the canvas and put your fancy calculating/updating routines there
101 :     c) Make a thread to do other processing alongside the graphics part (probably dangerous)
102 :    
103 :     3)
104 :    
105 :    
106 :    
107 :     ====================
108 :     Packages utilized:
109 :     ====================
110 :    
111 :     Chromium 1.4
112 :     ------------
113 :     http://chromium.sourceforge.net
114 :     - It's available on oddball2, but not the standard unix
115 :     environment, so I installed for myself. All you need is
116 :     for the-install-dir/bin/Linux to be in your PATH
117 :     - currently in ~sheradon/pax/cr-1.4
118 :     - Note: to display on the uM2 you need to be able to login
119 :     to oddball2.mcs.anl.gov. Running ssh-agent also helps to
120 :     streamline that operation.
121 :    
122 :    
123 :     Graphviz 1.8.10
124 :     ---------------
125 :     http://www.research.att.com/sw/tools/graphviz/
126 :     - From AT&T. Very popular graphing package. You'll want
127 :     a proper installation, with the programs (dot, neato, etc)
128 :     available in your PATH.
129 :     - Other, more recent versions are also fine, probably better.
130 :    
131 :    
132 :     JGraph 5.0 (for Java 1.3) and JGraphAddons 1.0
133 :     ----------------------------------------------
134 :     http://www.jgraph.com
135 :     - Needed only for the JGLayout modules.
136 :     - jgraph.jar and jgraphaddons.jar must be in CLASSPATH
137 :     - currently in ~sheradon/pax/jgraph-5.0-java1.3-gpl
138 :     and ~sheradon/pax/jgraphaddons-1.0
139 :    
140 :    
141 :     Jython 2.1
142 :     ----------
143 :     http://www.jython.org
144 :     - Needed only for the JGLayout modules.
145 :     - It's a Python interpreter written in Java, which is used
146 :     to interface python to the Java graph layout library JGraph.
147 :     - Just need a running installation, and the "jython" command
148 :     to be available in your PATH.
149 :    
150 :    
151 :     Pydot 0.9.9
152 :     -----------
153 :     http://dkbza.org/pydot.html
154 :     - pydot.py and dot_parser.py in the Speck/ dir, though it could
155 :     be installed anywhere in the PYTHONPATH.
156 :     - A Python implementation of the Graphviz data structures, &
157 :     interface to its layout stuff.
158 :    
159 :    
160 :     PyOpenGL 2.0.0.44
161 :     -----------------
162 :     http://pyopengl.sourceforge.net
163 :     - currently in SysBio dirs, for Python 2.3
164 :     - (also in /usr/lib/python2.2/site-packages for 2.2, but we
165 :     aren't using that one)
166 :    
167 :    
168 :     Pyparsing 1.2
169 :     -------------
170 :     http://pyparsing.sourceforge.net
171 :     - used by pydot to parse DOT files.
172 :    
173 :    

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3