Changes between Version 1 and Version 2 of MussaPython


Ignore:
Timestamp:
12/05/2006 06:43:18 PM (17 years ago)
Author:
diane
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • MussaPython

    v1 v2  
    11= Python Embedded into Mussa =
     2
     3This quite a new feature, and is only available as of [493].
    24
    35There 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).
     
    911The result of this is a mussa executable which has a python interpreter embedded in it.
    1012
    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,
     16they probably need to be fixed, but as a quick hack this'll probably still work.)
    1217
    1318=== Running ===
     
    5863  m.analyze()
    5964}}}
     65
     66If you're running the embedded version of mussa python, you can view that analysis with
     67
     68{{{
     69  mussaqui.MussaWindow(m)
     70}}}
     71
     72Since 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
     74Also since the GUI and interpreter are implemented in separate threads changing the mussa analysis while the GUI is viewing it is not safe.
     75
     76Alternatively if one wants to examine the results of running a mussa analysis...
     77{{{ paths = m.paths() }}}
     78will return an object that holds the Nway Paths.
     79
     80From there, you can do {{{ len(paths) }}} to see how many paths were found.
     81
     82The interface to this part of the code is a bit clunky so actually viewing the nway offsets are a bit clunky.
     83
     84{{{
     85conserved_paths = [ x for x in paths.pathz] # (pathz is only available as an iterable)
     86}}}
     87
     88Conserved 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{{{
     91print [ x for x in conserved_paths[0].track_indices
     92}}}
     93
     94Negative values indicate that the match is to the reverse strand.