cytoscape / RCy3

New version of RCy3, redesigned and collaboratively maintained by Cytoscape developer community
MIT License
48 stars 20 forks source link

cytoscape cannot be launched #100

Closed saeedfc closed 3 years ago

saeedfc commented 3 years ago

Hi,

I cannot launch/connect cytoscape form R. I have installed cytoscape 3.8.1 and the app itself is working. Can you kindly help? Thanks in advance! NB: I am on windows 10

>cytoscapePing()
Error in curl::curl_fetch_memory(url, handle = handle) : 
  Failed to connect to localhost port 1234: Connection refused
> cytoscapeVersionInfo ()
Error in curl::curl_fetch_memory(url, handle = handle) : 
  Failed to connect to localhost port 1234: Connection refused

> sessionInfo()
R version 3.6.1 (2019-07-05)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 17763)

Matrix products: default

locale:
[1] LC_COLLATE=English_United States.1252  LC_CTYPE=English_United States.1252    LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C                           LC_TIME=English_United States.1252    

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] RCy3_2.4.6     igraph_1.2.4.2

loaded via a namespace (and not attached):
 [1] XML_3.99-0.3        R.methodsS3_1.8.1   R6_2.4.1            stats4_3.6.1        magrittr_1.5        graph_1.62.0       
 [7] httr_1.4.2          curl_4.3            R.oo_1.24.0         R.utils_2.10.1      RJSONIO_1.3-1.4     tools_3.6.1        
[13] parallel_3.6.1      compiler_3.6.1      pkgconfig_2.0.3     BiocGenerics_0.30.0
AlexanderPico commented 3 years ago

Hi. I notice you are running an old version of RCy3. There have been two major releases since 2.4.6, and the next release is scheduled by Bioconductor at the end of this month.

However, this error should not occur even with the older version. Here are some details to help troubleshoot the issue:

When you launch Cytoscape, it hosts a server with a default port of 1234 and exposes an API called CyREST. RCy3 communicates with Cytoscape through that port and API. So, if cytoscapePing() fails, then indeed nothing is going to work.

Things to check:

  1. Did you change the default port for Cytoscape? This would require going in and changing a preference setting in Cytoscape. You might do this to work around a firewall situation for example. If you did, then you need to pass a custom 'base.url' parameter in RCy3 to match the new port.
  2. Is CyREST working? The easiest way to test this is to go to the Help menu in Cytoscape and click on Automation>CyREST API. That should open a web page with Swagger docs showing available functions. If that does not work, then CyREST is not working. Try a restart of Cytoscape. Try a reboot of the machine.
  3. If CyREST is working, can you perform any other functions. Some don't require any networks to be loaded, e.g., Cytoscape System > version. If that doesn't work, then CyREST is not connecting to Cytoscape.

Let me know if you still have issues after trying the above steps.

AlexanderPico commented 3 years ago

And I just thought of something obvious... You have to launch Cytoscape yourself. RCy3 cannot launch Cytoscape. You mentioned that Cytoscape is working, but perhaps you mean in a separate instance. If Cytoscape is not actively running, then CyREST and RCy3 will not work.

The newest version of RCy3 gives this suggestion when running cytoscapePing() as an example of why running the latest version is always best :)