cytoscape / py4cytoscape

Python library for calling Cytoscape Automation via CyREST
https://Py4Cytoscape.readthedocs.io
Other
69 stars 15 forks source link

Nodes not colored when using large network #91

Open nilsoberg opened 2 years ago

nilsoberg commented 2 years ago

When using py4cytoscape with large networks, images are generated but not colored like smaller networks are. (The network files contain the node.fillColor attribute which is what Cytoscape uses to color the nodes by default.) This occurs in 3.8 and 3.10 (latest snapshot tested 0714).

The files that are attached are used for debugging. py4c_test.py uses py4cytoscape and can be used for testing using the CyREST API.

cytoscape-3.10-01714-rest-output.txt cytoscape-3.10-0714-terminal-log.txt cytoscape-3.10-framework-cytoscape.log ssn_3 10

cytoscape-3.8-rest-output.txt cytoscape-3.8-terminal-log.txt cytoscape-3.8-framework-cytoscape.log ssn_3 8

py4c_test.py.txt

large_ssn.zip

First reported in #81

bdemchak commented 2 years ago

Thanks, Nils --

A number of comments ...

So ... as regards your original observation that the nodes aren't colored as smaller networks are, the node.fillColor in your XGMML An alternate explanation would be when there are too many nodes/edges, and Cytoscape decides not to create the view, as it would be very time consuming. If so, it would be appropriate for you to create_view(), which is how your .py is set up. FYI, on my test setup, your large_ssn network does cause Cytoscape to skip the view creation. The view must be created afterward, and all nodes have coordinates (0,0) ... they're all right on top of each other until a layout is performed. Once I execute a layout, I get the expected topography.

It's also possible that you could get this error if you try to lay out a network where the view is not completely created yet. Py4cytoscape doesn't have a delay at the end of create_view(), so if that's a problem, you'll need your own sleep() after your create_view() call. At first, try something absurdly large (e.g., 60 seconds).

On the images you supplied, I see that your nodes are blue. Are you telling me that they're blue despite the XGMML indicating that they should be red??

So, as to your main issue, I think you're telling me that you expect the nodes to be painted red, but they're coming up blue? I'm not seeing that, but I'm seeing that nodes are square and should be round. These are probably related. Worse ... if I use Style to try to make them round, I still get square. Very unsavory.

Comments?

nilsoberg2 commented 2 years ago

Just FYI, I will be away for a few weeks so I'll get back to you when I return.