tmuetze / Bioconductor_RCy3_the_new_RCytoscape

Update RCytoscape to work for Cytoscape 3.0 and higher using CyREST
16 stars 10 forks source link

get an error with getGraphFromCyWindow when there are "(" in the node names #28

Closed risserlin closed 8 years ago

risserlin commented 8 years ago

When trying to get the graph from CyWindow and some of the node labels have brackets in the name I get an error: Error in .local(object, from, to, ...): unknown nodes in 'from': ‘XBP1’, ‘XBP1’, ‘XBP1’, ‘XBP1’, ‘ACTIVATION OF GENE EXPRESSION BY SREBF’, ‘ACTIVATION OF GENE EXPRESSION BY SREBF’, ‘MICRORNA’, ‘MICRORNA’

the node names associated with the above error are: ACTIVATION OF GENE EXPRESSION BY SREBF (SREBP)%REACTOME DATABASE ID RELEASE 56%2426168 MICRORNA (MIRNA) BIOGENESIS%REACTOME%R-HSA-203927.2 XBP1(S) ACTIVATES CHAPERONE GENES%REACTOME DATABASE ID RELEASE 56%381038

And when I delete those nodes the function returns correctly.

Also, for large networks I am finding this function really slow. Is there a way to improve this (different functions to call? I am calling this function because in order to get the node attributes I need a graph object.)

Thanks, Ruth

tmuetze commented 8 years ago

Hi Ruth,

Good catch. I can reproduce your errors and added a error/warning statement (see commit 002a3c10d960b76d4d9e74efa6495355420966e9). You cannot have parentheses in node names as edge names are defined as "Node A (interaction type) Node B" and we go by node and edge names rather than SUIDs to be back compatible to RCytoscape and for ease of use for the users. Hence, in order for us to parse edge names, we extract the node names by disregarding everything in the parentheses. If you have a better idea how we could handle this situation, we'd love to hear it.

That's right. Unfortunately, we don't know of anyway to make the function even more efficient. RCy3 is already much faster than RCytoscape. Any suggestions for improvements are welcome, though.

risserlin commented 8 years ago

Would it be possible to have a variant of the getGraphFromCyWindow that only gets the nodes and their associated information and ignores the edge information. I have a pretty large network and it does work much faster when I delete all the edges. All my information that I need from R is on the nodes.

tmuetze commented 8 years ago

It won't be a problem to a write a function that only gets the network with only nodes and no edges. However, the same issues persist if we want to also get the edges. Which one of these two would you like to have?

m-grimes commented 8 years ago

Tanja

Not sure what you are asking. I am plotting networks with nodes and edge both. In the nodekey.R test file, the nodes-only attributes are plotted but don't persist because some are set with set_Direct functions, and the edge example shows that the setEdgeColorRule function doesn't work in the bioconductor RCy3 1.1.2, but does work with your GitHub RCy3 (still labeled 1.1.16 today). But the set_Direct attributes are lost when saving, saving styles, etc.

Maybe a real example would help. Attached is a .cys file and two screenshots showing how I'd like the networks to look when opening from a saved file. Note the lack of node border colors. Also occasionally and stochastically I get the result observed where one node (TAOK1 in the network with grey background) doesn't lock node height and width even if I check and uncheck the box (which also removes the node border colors set with set_Direct functions). This was plotted today with the sessionInfo in the nodeKey.R file.

Mark


Mark Grimes Division of Biological Sciences University of Montana Missoula, Montana 59812-4824 Grimes lab website Office Telephone: (406) 243-4977 Fax Number: (406) 243-4184 E-mail: Mark.Grimes@mso.umt.edu

On 28 Jul 2016, at 14:48, Tanja wrote:

It's not problem to get the network with only nodes and no edges. However, the same issues persist if we want to also get the edges. Which one of these two would you like to have?


You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/tmuetze/Bioconductor_RCy3_the_new_RCytoscape/issues/28#issuecomment-236020480

risserlin commented 8 years ago

Hi Tanya, For my use case I really only need the node information so having a variant of the getGraphFromCyWindow function that has a flag node_info_only would be perfect for me. Right now I create my network, delete all edges, call getGraphFromCyWindow, and then undo the delete edges in cytoscape. If I need to get the edge info I can call the getGraphFromCyWindow as normal (and wait for it to compute it) Thanks, Ruth