cytoscape / RCy3

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

deleteSelectedNodes not working when you specify the base.url #158

Closed risserlin closed 2 years ago

risserlin commented 2 years ago

deleteSelectedNodes(base.url = cyto_url) Returned error - Oh no! I can't find Cytoscape. RCy3 can not continue! Please check that Cytoscape is running, CyREST is installed and your base.url parameter is correct. Error in .cyError(c, res) : object 'res' not found Error in .cyFinally(res) : object 'res' not found

Ran the following code right before the above statement and they worked with no issues: selectNodes(nodes=current_protein,by.col = "gene name", base.url = cyto_url) selectFirstNeighbors(base.url = cyto_url) invertNodeSelection(base.url = cyto_url)

Note - cyto_url = "host.docker.internal:1234/v1" (which is a different issue. Running from within a docker bioc 3.13 base and --add-host=localhost:MY.IP" no longer works and the only way I could get the docker to communicate with cytoscape was to change the base.url to above. without the /v1 it doesn't work)

AlexanderPico commented 2 years ago

Cool! Er, I mean, it's cool that you are paving new ground using RCy3 with docker. Can you describe more about the use case and exactly what you are doing? I'm really interested in documenting solutions like this for others.

Regarding the error, not cool! Sorry for that. The base.url isn't used much. We have zero use cases in our team, so I'm not surprised that it breaks in some cases. Thanks for reporting these! @yihangx do you want to look into this?

risserlin commented 2 years ago

Hi Alex, I have been using RCy3 and Cytoscape from docker for a long time. It makes jumping to different versions of R and bioc really easy and prevents pipelines from breaking with every new R package update.

For the longest time, when I launch my docker in the docker run command I just added --add-host "localhost:MY.IP.ADDRESS" and RCy3 works seamlessly from within any of my R notebooks. Yesterday, when I was having issues with Intact command I realized I was using an older version of R and bioc on my computer and went over to my docker (but I first updated my docker to bioc 3.13) and none of RCy3 would work. For some reason my docker is no longer redirecting localhost to my ip address for some reason. I think it might be an issue with the docker engine but I haven't been able to figure it out yet. I did get RCy3 to work though when I specify base_url to "host.docker.internal:1234/v1". That in itself seems weird. It should have worked with just host.docker.internal:1234. I don't understand why the docker needs the v1 but from my computer it doesn't. When testing directly from my web browser it required that /v1 though.

AlexanderPico commented 2 years ago

Interesting. @yihangx has done a lot of work to add cloud notebook support, which involved tweaking REST communications to identify when it's running remote and when it's local. I wonder if that messed up your use case (which wasn't really on our radar at all).

If you could provide or point to some basic instructions or protocols, maybe we could include these in our regular testing? E.g., are the docker images you are making publicly available via DockerHub?

Have you tried running these server side as well? Or just local?

risserlin commented 2 years ago

I only use it locally because I am running Cytoscape locally but I am very interested in how I can run on a server or cloud and communicate with Cytoscape on my machine (if that is an option)

I have a few different dockers for different pipelines but the one that I am currently using can be found here - https://hub.docker.com/repository/docker/risserlin/em_base_image and is available on docker hub.

risserlin commented 2 years ago

Now that you mention it maybe that is the issue. Maybe RCy3 is detecting that I am not running locally on my machine and doing something with the routing.

Anyway besides specifying the the base.url to get around that? (because some of the functions aren't working with the base.url)

AlexanderPico commented 2 years ago

Ah, I see. We have been thinking of the following scenarios and yours is a varant of Scenario 2 that our Jupyter-Bridge solution may have messed up. What do you think, @yihangx? And, yes, we are also interested in Scenario 4. It has worked for some here and there, but it's well documented yet.

Automation Scenarios

risserlin commented 2 years ago

It can't be an issue with RCy3 though. I have gone back to my older images and it is an issue in every image (That are running older version of RCy3). It has to be something in docker.