Skip to content
This repository has been archived by the owner on Sep 12, 2018. It is now read-only.

Make the app available as a desktop application #12

Closed
fedarko opened this issue Jul 22, 2016 · 6 comments
Closed

Make the app available as a desktop application #12

fedarko opened this issue Jul 22, 2016 · 6 comments

Comments

@fedarko
Copy link
Owner

fedarko commented Jul 22, 2016

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.)

@fedarko
Copy link
Owner Author

fedarko commented Jul 22, 2016

See cytoscape/cytoscape.js#1018 -- this might actually be pretty well-supported, from the looks of it

@fedarko fedarko modified the milestone: Important Things Aug 2, 2016
@fedarko
Copy link
Owner Author

fedarko commented Aug 7, 2016

OK, here's the (a?) plan:

  • We use node.js in conjunction with the .db file parser we write in JavaScript (aka that I'll finish tomorrow).
  • However, instead of using sql.js, we use node-sqlite3 (which uses native SQLite, which means we have more usable space to process large .db files).
  • We load the results of that into a headless (run using node.js) instance of Cytoscape.js, then we call cy.json() to export to a format that desktop Cytoscape can read.

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).

fedarko added a commit that referenced this issue Aug 7, 2016
WHOOOOO GET HYPE I CAN STOP WORRYING ABOUT THIS

...Anyway, yeah, this wasn't that bad. Just needed to reuse the
_ele2parent statements in the right places.

I guess next important things are:

-Add biodata stuff (#34)
-Add jQuery UI progress bar
-Fix inefficient(-ish) code (likely includes moving xdot parsing in
 xdot2cy.js to another repository or something -- a bit annoying
 trying to manage both .xdot and .db parsing...)
-Node/edge scaling (#23)
-node.js json export stuff (#12)
@fedarko fedarko changed the title Exporting the graph as a JSON file Use cy.json(), node.js, and node-sqlite3 to render the graph in desktop Cytoscape Jan 3, 2017
@fedarko
Copy link
Owner Author

fedarko commented Jan 5, 2017

I was previously running into an error in which cy.json() generated circular JSON which couldn't be string-ified (i.e., couldn't be exported to desktop Cytoscape). I think I identified the source of this error: just reported it at cytoscape/cytoscape.js#1667, so hopefully that will be resolved.

UPDATE: Nope I'm dumb see commit message below

fedarko added a commit that referenced this issue Jan 5, 2017
Turns out the bug was on my end: collections of nodes are evidently
unserializable in JSON, which prevented the call to
JSON.stringify(cy.json()) from working. This data is now stored in
scratch, and I'm looking into using less scratch/data stuff in
general (a lot of this we can deduce from the elements themselves,
without extra space requirements of storing lots of stuff).
@fedarko fedarko changed the title Use cy.json(), node.js, and node-sqlite3 to render the graph in desktop Cytoscape Make the app available as a desktop application Jul 6, 2017
@fedarko
Copy link
Owner Author

fedarko commented Jul 6, 2017

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.

@fedarko
Copy link
Owner Author

fedarko commented Jul 6, 2017

Alternatively, we could have collate.py just generate a .json file that could be loaded in desktop cytoscape. Look into that also.

@fedarko
Copy link
Owner Author

fedarko commented Aug 9, 2017

This issue was moved to marbl/MetagenomeScope#5

@fedarko fedarko closed this as completed Aug 9, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant