cytoscape

Mapping nodes sizes and adding legends in cytoscape network

旧街凉风 提交于 2021-01-28 09:19:24
问题 I used networkx package in python to construct multiple networks, where each represents a biological experiment. I then exported these networks as gml files to visualize in cytoscape and make comparisons. In each file, I have two attributes for nodes- i.e., count and color. In cytoscape, I assign the node size to its count. However, there is a huge difference between the counts of nodes, for instance some have a count of 100 while others have a count of 50,000. I would like map the sizes of

how to use different colors to mark nodes in cytoscape.js?

一笑奈何 提交于 2020-06-27 04:09:31
问题 currently I'm trying to realize this function: I've created a color selector on the website. Once a user selects a specific color, the colors of nodes he/she selected and their neighbouring nodes will be changed into the color selected after tap. For example, in the case below, if I select "red" and then choose the node "cytoscape", the "cytoscape" and the "cytoscape.js" will both be red. Now if I change the color into "green" and then I click on "test", the "test" node will change into green

Cytoscape JS - Modifying Container Height After Initialization

↘锁芯ラ 提交于 2020-06-13 05:58:51
问题 I initialize Cytoscape with something that looks like the following: var cy = cytoscape({ container: $('#my-element'), height: 500px }); I would like to change the height of the container element to something other than the original 500px value when an user commits an action. How would I do this with Cytoscape? There is a height() method in the main Cytoscape object, but this only functions as a getter. 回答1: There is a documented method cy.resize() that you can call to redraw the graph to fit

cytoscape.js disable grab&moving nodes

我只是一个虾纸丫 提交于 2020-02-02 06:29:06
问题 I'm having trouble building a graph network with cytoscapeJS. I can add nodes and handle them which is quite easy, but I'm not able to configure cytospace to disable Dragging/Moving nodes. I have found a JSbin from somebody where you can try: http://jsbin.com/vasenatimu/2/edit?html,js,output Have a look at http://js.cytoscape.org under 'Initialisation options', I tried all the options, but they dont solve my problem (I set nearly all options to false and I can still grab and select nodes).

Replace all elements and redraw graph softly in cytoscape.js

让人想犯罪 __ 提交于 2020-01-24 06:14:45
问题 Is there any one-command way to replace all elements of my graph with new data in cytoscape.js? In my case, after some operations on backend I have new graph-data and want to redraw my graph with this new data, but not to lose my camera settings, maybe something like cy.elements = my_elements; cy.redraw(); 回答1: Options: (1) cy.elements().remove(); cy.add( newEleJsons ); (2) cy.json({ elements: newEleJsons }); 来源: https://stackoverflow.com/questions/35770055/replace-all-elements-and-redraw

Convert adjacency matrix to a csv file

こ雲淡風輕ζ 提交于 2020-01-15 07:36:21
问题 I want to convert the adjacency matrix output from ARACNE into a csv file using python (or possibly R). The adj file is set up to show one gene one the right and each of its interactions with other genes. For example: A B 0.4 C 0.3 B C 0.1 E 0.4 C D 0.2 E 0.3 So above, A and B interact with each other and the value of that interaction is 0.4. A and C interact with each other and the value is 0.3 and so on. I want to change the layout so I get... A B 0.4 A C 0.3 B C 0.1 B E 0.4 C D 0.2 C E 0.3

Convert adjacency matrix to a csv file

不打扰是莪最后的温柔 提交于 2020-01-15 07:36:06
问题 I want to convert the adjacency matrix output from ARACNE into a csv file using python (or possibly R). The adj file is set up to show one gene one the right and each of its interactions with other genes. For example: A B 0.4 C 0.3 B C 0.1 E 0.4 C D 0.2 E 0.3 So above, A and B interact with each other and the value of that interaction is 0.4. A and C interact with each other and the value is 0.3 and so on. I want to change the layout so I get... A B 0.4 A C 0.3 B C 0.1 B E 0.4 C D 0.2 C E 0.3

How to load both html and javascript into webengine from loadContent()?

旧街凉风 提交于 2020-01-10 03:56:09
问题 Could someone provide some suggestions on how to load the following onto webviewer from loadContent()? http://jsbin.com/aqupun/6/edit I was trying to do something like this, but it doesn't seem to work. Thanks! Scanner sc1 = new Scanner(new File("src/web/web.html")); String webStr = sc1.useDelimiter("\\Z").next(); Scanner sc2 = new Scanner(new File("src/web/data.js")); String dataStr = sc2.useDelimiter("\\Z").next(); Scanner sc3 = new Scanner(new File("src/web/cytoscape.min.js")); String