dhimmel / rephetio

Miscellaneous Content for Project Rephetio to repurpose drugs
https://think-lab.github.io/p/rephetio/
6 stars 2 forks source link

Hetnet visualization: methods to create Figure 1B #4

Open aliocee01 opened 5 years ago

aliocee01 commented 5 years ago

Please would like to ask which software you used to create the network in the the repo figure?

Thank you!

dhimmel commented 5 years ago

Thanks @aliocee01 for your interest. I believe the question is about Figure 1B of the Project Rephetio manuscript:

Please see the discussion Describing Hetionet v1.0 through visualization and statistics, which goes over many of our hetnet visualizations. Specifically, the Figure 1B was created using Cytoscape. Quoting from the discussion:

We create this visualization in Cytoscape — a Java-based desktop application for network visualization with strong adoption in biology (current version 3.3.0). Creating this visualization is labor intensive and frustrating, since our hetnets push Cytoscape to its limits.

To make the visualization possible, we limit the number of edges per type to 5,000 (by setting max_edges = 5000). One side effect is that Cytoscape only shows the subset of nodes connected by the selected edge subset. Hence, the visualization moderately reflects the number of nodes per metanode and poorly reflects the number of edges per metaedge.

If you want to play around with the Cytoscape session files, they are located here. Overall, it was a pretty time-consuming process to create these visualizations as the layout is manual, and the high node & edge number made the Cytoscape App laggy. I'd love a more scripted and automated way to create such figures.

aliocee01 commented 5 years ago

Thank you so much.

turoger commented 4 years ago

@dhimmel. Adding onto this thread, I can’t figure out how you managed to align all the nodes to the edge of each metanode in cytoscape. I’ve tried grouping each node by its meta node, and representing it as a single metanode. However, the nested nodes within the metanode don’t line the circumference of the metanode; they end up circumscribed. Would you share with me some pointers?

dhimmel commented 4 years ago

I can’t figure out how you managed to align all the nodes to the edge of each metanode in cytoscape.

Our cytoscape network did not have metanodes as actual nodes, just as a node property. We used a layout, perhaps the Circular yfiles one, that had an option to group nodes by a property, for which we specified the metanode / node type. This then created the circular layout of each set of nodes.

To move the nodes around, I'd hide all the edges so Cytoscape wouldn't get too bogged down. Then I'd select a circle of nodes and move it.

Having some trouble running cytoscape on my laptop, so won't be able to give you more detailed instructions for a few days, but let me know if that helps.

turoger commented 4 years ago

@dhimmel, thanks for the helpful suggestion; I figured it out! I instead used the yRadial layout to get the desired results. To create the circular layout for each set of metanodes, I hid the nodes that weren't of interest, then applied the format. After doing so for all of my metanodes, I highlighted all the nodes of interest, hovered over a node, double clicked to collapse it, and then rearranged each 'collapsed' meta node to the position I desired. It is quite manual.