This sounds like a great idea, James.  I suspect Titus Brown will have some 
thoughts on this very nice approach to visualization (i.e. marrying an NCList 
based GUI with an NCList based backend (pygr)).

Regarding the simple problem of getting JSON output from a Pygr NLMSA, it's 
really straightforward.  Note that pygr already has an XMLRPC service that 
accepts an interval query to an NLMSA and sends results back through XMLRPC.  
See the NLMSAServer class in xnestedlist.py -- it's very little code.  I guess 
you could just copy this class and modify the getSlice() method to return JSON 
format, for which Python support exists.  Note that in addition to interval 
data NLMSAServer also returns some extra index data needed by the NLMSAClient, 
which would be unnecessary in your case.  Note also that the NCList data get 
"flattened" in this process (converted to a single list of intervals, rather 
than a tree of nested lists), but presumably jbrowse doesn't care about that.

If you implement the JSON part, the rest is trivial, something like (assuming 
your JsonNLMSAServer class exists):

from SimpleXMLRPCServer import SimpleXMLRPCServer
server = SimpleXMLRPCServer((host, port))
nlmsa = JsonNLMSAServer('/path/to/mynlmsa') # the usual NLMSA args
server.register_instance(nlmsa)
server.run_forever()

You would now use xmlrpc calls from JavaScript to run the getSlice() method on 
your JsonNLMSAServer, and get back JSON data.

-- Chris

-- 
You received this message because you are subscribed to the Google Groups 
"pygr-dev" group.
To post to this group, send email to pygr-...@googlegroups.com.
To unsubscribe from this group, send email to 
pygr-dev+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/pygr-dev?hl=en.

Reply via email to