-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make the app available as a desktop application #5
Comments
See cytoscape/cytoscape.js#1018 -- this might actually be pretty well-supported, from the looks of it |
OK, here's the (a?) plan:
This should work well! By running everything headlessly we avoid browser overhead, and by using node-sqlite3 we avoid the limitations of sql.js. Alternatively we could export from the python script directly to desktop Cytoscape (by preparing JSON output [we could even add our own data fields that we could parse via a Cytoscape plugin], or by using the existing dot-app for Cytoscape to load .gv or .dot files). |
I was previously running into an error in which UPDATE: Nope I'm dumb see commit message below |
Ok, so here's an idea. Things like Electron (https://electron.atom.io) can facilitate the creation of desktop apps from HTML/JS/etc code, right? And there's a tutorial available demonstrating that Cytoscape.js works ok with Electron. So it should be feasible to use electron to create a desktop version of the viewer interface, but using node.js et al for certain things (e.g. node-sqlite3 in lieu of sql.js). I'm a bit fuzzy on the details here, but I'll do some more research on this soon. This could result in a fairly performant application, if done right. |
Alternatively, we could have collate.py just generate a .json file that could be loaded in desktop cytoscape. Look into that also. |
Finagling the regexes took some time, but the solution is relatively flexible.
Since Electron sets the window's icon differently. Also since we don't have bubble.ico in the electron/ directory.
After commit 5b890ba, it should be feasible to modify certain spots in the JS code to function differently for the viewer interface's Electron application when performing operations where Node.js has native bindings (e.g. using node-sqlite3 instead of sql.js). |
Additional way we could do things differently: accept actual assembly graph files (GFA, GML, etc) in the viewer, and invoke the graph_collator script if those are passed? This would let users avoid the command-line stuff entirely. |
Could also leverage the desktop app status of this to enhance features like FASTA exporting/copying-to-clipboard/etc that are normally difficult or at least very limited in client-side apps. See Electron's clipboard API for more info |
apparently the Electron app supports using XML HTTP Requests to get demo files. Consider hooking it up to mgsc.umiacs.io's demo files? Or not, I guess, since the app isn't really "associated" with a hosted version of mgsc per se. |
For the FASTA stuff: add a button that lets the user upload (or even just specify the location of) a FASTA file. Also, add a FASTA option to the finishing output file type radio buttons that is enabled when the user links to a FASTA file for an assembly graph. If the user selects the FASTA export type for finishing, the JS creates the file (based on the contents of the FASTA file) and lets the user save it to their system as before. (Alternatively, the writing operation could be done automatically, if there isn't a good way to hold on to the file while the user selects a location. I gotta read up on the node.js file APIs.) |
Look into using something like electron-builder to expedite the building process. For the time being, users can build and then run the electron app by |
SHEESH why did I write these in fish in the first place. The bash script porting closes #149! I ended up removing the very basic in-progress electron/ version, because it added *a lot* of complexity to the minification process -- and I'm not confident that it's actually useful to keep around, until we go ahead with #5 and make it actually harness the node.js library. If/when I get around to doing that, I think it'll require the sort of changes that go beyond a few "sed" commands. Also, I updated the copyright years in the minified attributions (#150) -- need to actually change these throughout. Also I guess we should include 2016 in this range? TBH I don't think we'd have a problem with just "2016--".
Closing because I am probably not going to have time for this for a while, and I don't think this is high-priority |
From @fedarko on July 22, 2016 18:7
Using cy.json(), node.js, and node-sqlite3 would allow assembly graphs to be viewed in Cytoscape.js or (with less support for certain Cytoscape.js-specific features -- see this) the desktop version of Cytoscape.
The upside of this is that we get the best of both worlds: the ability to view the graph in a browser (and, theoretically, host it on a website) and the ability to view the graph in desktop Cytoscape (which would make viewing huge graphs faster).
Note that I have pretty much no experience with desktop Cytoscape, and we'll probably have to tweak things to get this to work. (I think compound nodes, in particular, are only somewhat supported in desktop Cytoscape -- so I'll have to look into that.)
Copied from original issue: fedarko/MetagenomeScope#12
The text was updated successfully, but these errors were encountered: