{"id":49,"date":"2018-09-15T21:33:00","date_gmt":"2018-09-15T21:33:00","guid":{"rendered":"http:\/\/192.231.106.19\/blog\/?p=49"},"modified":"2019-07-06T06:15:32","modified_gmt":"2019-07-06T06:15:32","slug":"how-to-adjust-metascape-network-plots","status":"publish","type":"post","link":"https:\/\/metascape.org\/blog\/?p=49","title":{"rendered":"How to Adjust Metascape Network Plots?"},"content":{"rendered":"\n<h5 class=\"wp-block-heading\"><strong>[This is an old blog written on Saturday, September 15, 2018]<\/strong><\/h5>\n\n\n\n<p class=\"wp-block-paragraph\">Metascape relies on Cytoscape [1] to render networks, including both enrichment networks and protein-protein interaction networks.&nbsp; When a network contains too many edges, it can become a visual &#8220;hair ball&#8221; and no longer serves as an intuitive depiction.&nbsp; Such visual clutter can be significantly reduced by an edge bundling algorithm [2] implemented in Cytoscape (Figure 1).<\/p>\n\n\n\n<figure class=\"wp-block-image is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/192.231.106.19\/blog\/wp-content\/uploads\/2019\/02\/v1.png\" alt=\"\" class=\"wp-image-61\" width=\"300\" height=\"147\"\/><figcaption>Figure 1.&nbsp; An example network rendered with straight edges (left) and bundled edges (right).&nbsp; High-level network edge patterns are more readily visible in the latter case.&nbsp; Screenshots were taken from a YouTube video&nbsp;<a href=\"https:\/\/www.youtube.com\/watch?v=UC_H1hnS9MY\">here<\/a>.<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">To bundle edges in Cytoscape, use menu Layout &gt; Bundle Edges &gt; All Nodes and Edges (Figure 2).&nbsp; The default parameters work well for most networks.<\/p>\n\n\n\n<figure class=\"wp-block-image is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/192.231.106.19\/blog\/wp-content\/uploads\/2019\/02\/V2.png\" alt=\"\" class=\"wp-image-60\" width=\"300\" height=\"65\"\/><figcaption>Figure 2. Operations lead to edge bundling in Cytoscape.<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Since edge bundling is so useful, it is used by default in network visualization outputs generated by Metascape.&nbsp; For example, Figure 3 shows an enrichment network generated based on four input gene lists.<\/p>\n\n\n\n<figure class=\"wp-block-image is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/192.231.106.19\/blog\/wp-content\/uploads\/2019\/02\/V3.png\" alt=\"\" class=\"wp-image-59\" width=\"300\" height=\"215\"\/><figcaption>Figure 3. An enrichment network, where each node is colored by its cluster ID.<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Sometimes, users would like to rearrange the nodes in the exported network, in order to better illustrate its biological context.&nbsp; Simply moving the nodes, for instance the red cluster in Figure 3, can result in floppy edges (Figure 4).&nbsp; We sometimes see unaesthetic network plots due to this limitation, Figure 5 is an example taken from a recent publication.<\/p>\n\n\n\n<figure class=\"wp-block-image is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/192.231.106.19\/blog\/wp-content\/uploads\/2019\/02\/V4.png\" alt=\"\" class=\"wp-image-58\" width=\"300\" height=\"211\"\/><figcaption>Figure 4. Simply moving the nodes for the red cluster results in floppy edges circled in red.<\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-image is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/192.231.106.19\/blog\/wp-content\/uploads\/2019\/02\/V5.png\" alt=\"\" class=\"wp-image-57\" width=\"300\" height=\"186\"\/><figcaption>Figure 5.&nbsp; Floppy bundled edges can lead to unreadable networks.&nbsp; The example is Figure 5.C taken from&nbsp;<a href=\"https:\/\/www.ncbi.nlm.nih.gov\/pubmed\/30154100\">this<\/a>&nbsp;PubMed entry.<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">To adjust Metascape networks, we first need to use the menu option Layout &gt; Clear All Edge Bends.&nbsp; This will straighten all edges, then you can move the nodes around (the result is in Figure 6, left).&nbsp; Once you are happy with the new locations of the nodes, simply use Layout &gt; Bundle Edges &gt; All Nodes and Edges to bundle the edges again (right).<\/p>\n\n\n\n<figure class=\"wp-block-image is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/192.231.106.19\/blog\/wp-content\/uploads\/2019\/02\/V6.png\" alt=\"\" class=\"wp-image-56\" width=\"300\" height=\"107\"\/><figcaption>Figure 6. Unbundle edges first and them move the red nodes (left).&nbsp; At the end, bundle edges to produce more visually compact edge patterns for easier interpretation (right).&nbsp; This final plot is a significant improvement over Figure 4.<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">To summarize, to change the layout of networks generated by Metascape, we need to unbundle edges and then rebundle them.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Referene<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">1. http:\/\/cytoscape.org<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">2.&nbsp;http:\/\/citeseerx.ist.psu.edu\/viewdoc\/download?doi=10.1.1.212.7989&amp;rep=rep1&amp;type=pdf<\/p>\n","protected":false},"excerpt":{"rendered":"<p>[This is an old blog written on Saturday, September 15, 2018] Metascape relies on Cytoscape [1] to render networks, including both enrichment networks and protein-protein interaction networks.&nbsp; When a network contains too many edges, it can become a visual &#8220;hair &hellip; <a href=\"https:\/\/metascape.org\/blog\/?p=49\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[10,6],"tags":[11,12,9],"class_list":["post-49","post","type-post","status-publish","format-standard","hentry","category-comment","category-visualization","tag-cytoscape","tag-edge-bundle","tag-protein-network"],"_links":{"self":[{"href":"https:\/\/metascape.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/49","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/metascape.org\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/metascape.org\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/metascape.org\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/metascape.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=49"}],"version-history":[{"count":2,"href":"https:\/\/metascape.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/49\/revisions"}],"predecessor-version":[{"id":63,"href":"https:\/\/metascape.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/49\/revisions\/63"}],"wp:attachment":[{"href":"https:\/\/metascape.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=49"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/metascape.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=49"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/metascape.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=49"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}