cytoscape / RCy3

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

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

Closed taraeicher closed 8 months ago

taraeicher commented 8 months 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 8 months ago

Thanks for catching this and report it!

AlexanderPico commented 8 months ago

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

AlexanderPico commented 8 months ago

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

yihangx commented 8 months ago

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

taraeicher commented 8 months 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 8 months 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 8 months 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 8 months 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 8 months ago

Thank you @yihangx , that solves the problem!