Re: Cytoscape RPC Error Node Selection

18 views
Skip to first unread message

Paul Shannon

unread,
Jun 27, 2012, 8:05:22 AM6/27/12
to Anna Kosenko, Paul Shannon, rcyto...@googlegroups.com
Hi Anna,

It is likely that among the ~140 node names, some are not actually in the graph. Could you check, perhaps like this?

print (setdiff (selection, nodes (cw@graph)))

RCy needs a better approach, which I will add today:

1) select the nodes which ARE in the graph
2) notify you of the number of nodes which are not, and their names

Let me know if this is indeed the problem, okay?

Best,

- Paul

On Jun 27, 2012, at 4:56 AM, Anna Kosenko wrote:

> Hello Paul,
>
> I am using RCytoscape to select multiple nodes in a network. These nodes are stored in a list of strings, which I extract from my data frame with R functions.
> here is a relevant part of my code:
>
> library(RCytoscape);
> g <- read.csv2(as.character(data),header = TRUE, sep = ";",fill = TRUE);
> cy <- CytoscapeConnection();
> cw <- existing.CytoscapeWindow(as.character(getWindowList(cy)));
> selection <- selection(g,as.character(targetReaction)); #selection is a R function, which extracts the reaction names to a list of strings.
> selectNodes(cw,selection,preserve.current.selection=FALSE);
>
> After I call this function, I get following error message, but only if the list of strings is big (~140 strings):
>
> Fehler in convertToR(xmlParse(node, asText = TRUE)) :
> faultCode: 0 faultString: Failed to invoke method selectNodes in class tudelft.CytoscapeRPC.CytoscapeRPCCallHandler: null
>
> If the list is relatively small (~10 strings), function runs just fine and produces anticipated result in Cytoscape.
>
> Could it be a RCytoscape problem, or rather Cytoscape RPC problem? In latter case I am sorry for bothering you.
>
> Thank You in advance!
>
> Best regards,
> Anna Kosenko.
>
>
>
>
>

Paul Shannon

unread,
Jun 27, 2012, 8:18:18 AM6/27/12
to rcyto...@googlegroups.com, Paul Shannon, Anna Kosenko
And to proceed with your project in the meantime, here is a slight modification of the code you sent:

library(RCytoscape);
g <- read.csv2(as.character(data),header = TRUE, sep = ";",fill = TRUE);
cy <- CytoscapeConnection();
cw <- existing.CytoscapeWindow(as.character(getWindowList(cy)));
selection <- selection(g,as.character(targetReaction)); #selection is a R function, which extracts the reaction names to a list of strings.
selectNodes(cw,intersect (nodes (cw@graph), selection),preserve.current.selection=FALSE);
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- Paul
Reply all
Reply to author
Forward
0 new messages