cytoscape / RCy3

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

Cannot call mapVisualProperty without specifying a remote URL when Cytoscape is running locally #216

Closed taraeicher closed 1 year ago

taraeicher commented 1 year ago

Our R package makes the following function call, which expects that the user has Cytoscape running on their local machine:

mapVisualProperty("node shape", "group", "d", c("TF", "Gene"), c("ELLIPSE", "RECTANGLE"))

However, the call fails with the following stack trace.

netZooR::createPandaStyle(style_name="PandaStyle") Failed to execute: http://127.0.0.1:1234/v1/commands/network/get%20attribute Error: Network must be specified 7. stop(simpleError(RJSONIO::fromJSON(rawToChar(res$content))$errors[[1]]$message)) 6. .cyFinally(res) 5. tryCatch(res <- POST(url = post.url, body = post.body, encode = "json", content_type_json()), error = function(c) .cyError(c, res), warnings = function(c) .cyWarnings(c, res), finally = .cyFinally(res)) 4. commandsPOST(cmd, base.url = base.url) 3. getNetworkSuid(network, base.url) 2. mapVisualProperty("node shape", "group", "d", c("TF", "Gene"), c("ELLIPSE", "RECTANGLE")) at createPandaStyle.R#22 1. netZooR::createPandaStyle(style_name = "PandaStyle")

Looking at your code, it appears that a change was made 2 months ago requiring users to input a remote URL when calling mapVisualProperty, as a fix to Issue #212.

Will you please restore the functionality of mapVisualProperty prior to the Issue #212 fix when the user does not input a remote URL?

AlexanderPico commented 1 year ago

Thanks for catching this and report it!

AlexanderPico commented 1 year ago

@yihangx Can you also add a test for this. We should have caught this before pushing the code.

AlexanderPico commented 1 year ago

Ah, main dev is on vacation. I'll look into it...

yihangx commented 1 year ago

@AlexanderPico I could not reproduce this locally. From Tara's error message, the network is not specified.

taraeicher commented 1 year ago

@AlexanderPico @yihangx Thank you for your quick response. Can you reproduce it with the following call:

mapVisualProperty("node shape", "group", "d", c("TF", "Gene"), c("ELLIPSE", "RECTANGLE"))

yihangx commented 1 year ago

@taraeicher This call works for me if I change "group" to my own node column, since I don't have this column in my network. Can you share your workflow or Cytoscape session file with me? You can mail me your session file to yihang.xin@gladstone.ucsf.edu if you want. Thanks!

yihangx commented 1 year ago

@taraeicher I installed netZooR packages and ran https://github.com/netZoo/netZooR/blob/ac2288424300dad5455ff079ab29f92fc6c4a3c3/vignettes/pandaRApplicationinGTExData.Rmd#L143 this vignettes. Everything works perfect for me.

yihangx commented 1 year ago

@taraeicher I think I know what is happening here. When you run this line, the network is not selected in Cytoscape for some reasons. You can add this line to manually set current network to avoid this. setCurrentNetwork('LCL')

taraeicher commented 1 year ago

Thank you @yihangx , that solves the problem!