Reputation: 91
I used Cytoscape for biological network visualization before using Cytoscape.js.
Cytoscape is able to create an automatic layout from our network file using its internal placement algorithm. The layout placement is very reasonable--- nodes that are connected to each other are placed nearby, and nodes are spread out nicely with the central nodes placed in the center of each group of nodes, which is really good for biological networks since there are so many nodes and so many connections among nodes.
Now I am using Cytoscape.js. I want Cytoscape.js to automatically create a layout like what Cytoscape creates. I tried to use all different layout options (“random”, “grid”, “cose”, “circle”, “breadthfirst”), but none of them creates a layout like what Cytoscape creates.
I don’t what to write our own layout placement algorithm for biological networks (which is a big deal).
But we need to use Cytoscape.js instead of Cytoscape since we need to put our molecular network workflow on the website (and visualize the network result on the website).
So my question is: how can we let Cytoscape.js automatically create a layout like what Cytoscape creates?
Thank you very much in advance!
Upvotes: 3
Views: 7294
Reputation: 12250
Cytoscape desktop can make a lot of assumptions that a library can't --- or shouldn't. If you use a library like Cytoscape.js, you need to set explicit options for things that Cytoscape desktop can make assumptions about.
Look into the force-directed layouts. They're described in the docs, but I'll give an overview here:
cose
: Built-in, very fast, small impact on file size, but need to set options fairly precisely for good results (e.g.)cose-bilkent
: A version of the CoSE algorithm with more enhancements, optimised to work well for bio networks, a bit slower, larger file size, gives nice results without much or any tinkering (e.g.)cola
: Works well for most graphs (e.g.)spread
: Fast, clustering cases don't want the second phase enabledspringy
and arbor
: Basic, usually lots of tinkering needed, even with tinkering results can be poorMost layouts are not built-in, as Cytoscape.js is a lib. (It wouldn't be fair to force everyone to include large files when not everyone needs them.)
For more info, see
Upvotes: 5