Changes between Version 1 and Version 2 of MussaPython
- Timestamp:
- 12/05/2006 06:43:18 PM (18 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
MussaPython
v1 v2 1 1 = Python Embedded into Mussa = 2 3 This quite a new feature, and is only available as of [493]. 2 4 3 5 There are two ways to interact with mussa via python. One is via the embedded interpreter, the other by a python extension module. The advantage to the embedded interpreter is that it is possible to launch a Mussa GUI window to view an analysis that was created via python. The advantage to the extension module is that it doesn't replace your interpreter and that its easier to run scripts from the shell. (There's also the problem that the embedded interpreter probably wont work under Microsoft Windows). … … 9 11 The result of this is a mussa executable which has a python interpreter embedded in it. 10 12 11 [http://mussagl-universal-b494.dmg OS X Universal Binary of Mussa with Python] 13 [http://mussagl-universal-b493.dmg OS X Universal Binary of Mussa with Python] 14 15 (Note there's a problem that only shows up when shipping mussa that causes thread error messages to pop-up, 16 they probably need to be fixed, but as a quick hack this'll probably still work.) 12 17 13 18 === Running === … … 58 63 m.analyze() 59 64 }}} 65 66 If you're running the embedded version of mussa python, you can view that analysis with 67 68 {{{ 69 mussaqui.MussaWindow(m) 70 }}} 71 72 Since this functionality is so new, the window doesn't necessarily render with all the paths displayed on it, so you'll need to change the threshold in order to update the display. 73 74 Also since the GUI and interpreter are implemented in separate threads changing the mussa analysis while the GUI is viewing it is not safe. 75 76 Alternatively if one wants to examine the results of running a mussa analysis... 77 {{{ paths = m.paths() }}} 78 will return an object that holds the Nway Paths. 79 80 From there, you can do {{{ len(paths) }}} to see how many paths were found. 81 82 The interface to this part of the code is a bit clunky so actually viewing the nway offsets are a bit clunky. 83 84 {{{ 85 conserved_paths = [ x for x in paths.pathz] # (pathz is only available as an iterable) 86 }}} 87 88 Conserved paths have 3 useful variables, a score, a window size, and the indices into the sequences. Unfortunately the indices are also only available as an interable. 89 90 {{{ 91 print [ x for x in conserved_paths[0].track_indices 92 }}} 93 94 Negative values indicate that the match is to the reverse strand.