Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nodes not colored when using large network #91

Open
nilsoberg opened this issue Jul 14, 2022 · 2 comments
Open

Nodes not colored when using large network #91

nilsoberg opened this issue Jul 14, 2022 · 2 comments

Comments

@nilsoberg
Copy link
Contributor

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
Copy link
Collaborator

Thanks, Nils --

A number of comments ...

  • In the REST output for 3.10, when I see "In cyrest_get(): No Views Available for Network with SUID: 124", I suppose that Cytoscape hasn't yet finished importing the network and creating the view, even though the import_network_from_file() has completed ... and so the get_network_views() function is failing. The import function does have a delay built in (4 seconds), and for small/medium networks, this is usually sufficient. For a large network, a larger delay may be needed. There's a way to set the delay in py4cytoscape (using the undocumented set_catchup_network_secs() function.) You can see if this is happening by simply inserting your own time.sleep() after your import_network_from_file() call. If you make it absurdly long (e.g., 60 seconds), you should find that the get_network_views() function gives a good result.

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).

  • In your .py file, the reason your cytoscape_ping() function would fail is that Cytoscape may be just starting up, and the CyREST server may not yet be available. On my PC, it's available about 20 seconds after Cytoscape starts. You may already know this. In the (unreleased) py4cytoscape 1.6.0 branch, failed Cytoscape connections are automatically retried using an exponential backoff strategy. I'm not sure how this would affect your startup code, but I can imagine that it may cut down on your retries. FYI.

  • I see that you're passing in the Cytoscape port, presumably because you may have multiple Cytoscapes running. I don't think this configuration has been supported in quite a while. Can you limit your testing to a single Cytoscape instance for now?

  • On the large_ssn.xgmml file, I see that you have set up node.fillColor as a red bypass. (I'm not sure how the XGMML parsing works, so I'd have to verify that node.fillColor affects the bypass setting.) On my PC, that's exactly how each node is rendered. Interestingly, all of your nodes are rendered as square on my PC, even if I set a node bypass to circle. This seems like a Cytoscape problem. (I'm using only Cytoscape to duplicate this.) I'll post this to the Cytoscape support group.

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??

  • I notice an error in the 3.8 logs ... they can't find the filetransfer app. I think filetransfer was distributed with Cytoscape starting in 3.9.0, so if you're using 3.8, you should use App Manager to download/install it manually ... that is, file-transfer-1.2.jar should end up in your CytoscapeConfiguration/3/apps/installed directory.

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
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants