5000 nodes RCytoscape
1
0
Entering edit mode
Paul Shannon ▴ 750
@paul-shannon-5161
Last seen 9.6 years ago
Hi Ruben, Please send me the results of your sessionInfo() as well as the version numbers of Cytoscape and the CytoscapeRPC plugin. It would also help to see the precise code you used, presented in order, statement by statement, so that I can confidently recreate the error you see. Thanks, - Paul On Mar 19, 2013, at 10:42 PM, rubens at andrew.cmu.edu wrote: > Hi Paul Shannon, > > I used the code pasted below (posted by you in a thread) to create a 5000 > nodes graph (using an adjacency matrix). But it outputs the next errors: > >> cw = CytoscapeWindow window.name, g) > Error in convertToR(xmlParse(node, asText = TRUE)) : > faultCode: 0 faultString: Failed to invoke method createNetwork in class > tudelft.CytoscapeRPC.CytoscapeRPCCallHandler: minimum bounding rectangle > of movable nodes and edge anchors not free to rotate within > MutableGraphLayout boundaries >> displayGraph (cw) > entering RCytoscape::displayGraph > sending 625 nodes > Error in convertToR(xmlParse(node, asText = TRUE)) : > faultCode: 1001 faultString: Network 3 not found >> redraw (cw) > Error in convertToR(xmlParse(node, asText = TRUE)) : > faultCode: 1001 faultString: Network 3 not found >> layout (cw, 'jgraph-spring') > Error in convertToR(xmlParse(node, asText = TRUE)) : > faultCode: 1001 faultString: Network 3 not found > > > I try the same code with 1875 nodes and it works perfectly. I try it with > 2500 and it outputs the same errors. > > I will be very grateful if you help me to solve this problem. > > Thanks > > Ruben Sanchez > CMU > > > > > > > > > > R CODE USED > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% > > library (RCytoscape) > > > # if you want to remove self-loops, enable this line > #diag (m) = 0 # remove any self-loops > > # now create a Bioconductor graph of subclass 'graphAM' > g = new ('graphAM', adjMat=m, edgemode='directed') > > # these next few lines are useful if you run this script repetetively, > since RCy requires that all window names are unique, > # these lines allows you to detect and then delete any pre-existing > window with the same name > > if (!exists ('cy')) # get access to application-level Cytoscape operations. > cy = CytoscapeConnection () > > window.name = 'adjacency matrix graph simple demo' > > if window.name %in% as.character (getWindowList (cy))) > deleteWindow (cy, window.name) > > # now create a window, send the graph, render it, lay it out > > cw = CytoscapeWindow window.name, g) > displayGraph (cw) > redraw (cw) > layout (cw, 'jgraph-spring') >
Network graph Network graph • 1.1k views
ADD COMMENT
0
Entering edit mode
Paul Shannon ▴ 750
@paul-shannon-5161
Last seen 9.6 years ago
(Summarizing to the bioc list so the record will be complete.) Your 5000-node, 6000-edge graph transmits from R to Cytoscape in less than 20 seconds. Layout takes a bit longer. All this works reliably up-to-date versions of the packages -- yours are quite old! This crucially includes Duncan Temple Lang's XMLRPC_0.3.0. which just reached Duncan's OmegaHat website. http://www.omegahat.org/XMLRPC/ It should be picked up soon, and automatically, along with everything else you need, via our standard mechanism: biocLite("RCytoscape") A slightly condensed and somewhat improved version of your application code (creating the graph, sending it via RCytoscape) is included below. Please let us know how this works. Cheers! - Paul On Mar 21, 2013, at 5:02 PM, Paul Shannon wrote: > Hi Ruben, > > Your difficulties should disappear with the update of a few packages. > > (In addition, a slightly updated version of the code is pasted in below.) > > You need to update many of your packages -- there are seriously out of date! RCytoscape, graph, XMLRPC, XML all need to be updated. See below for how to do this quick and easy with "biocLite". > > > attached base packages: > [1] stats graphics grDevices utils datasets methods base > > other attached packages: > [1] RCytoscape_1.9.7 XMLRPC_0.3-0 graph_1.37.7 BiocInstaller_1.9.8 > > loaded via a namespace (and not attached): > [1] BiocGenerics_0.5.6 RCurl_1.95-3 XML_3.95-0.1 compiler_3.0.0 parallel_3.0.0 stats4_3.0.0 tools_3.0.0 > > The preferred way to update -- since it picks up all dependencies -- is > > source("http://bioconductor.org/biocLite.R") > biocLite("RCytoscape") > > I am doing my best to encourage Duncan Temple Lang, author of XMLRPC, to update his public offering to the version which has his speedup fixes, XMLRPC_0.3-0. In the absence of that, I attach the package here: > > <xmlrpc_0.3-0.tar.gz> > > > Let me know how this works. > > - Paul > > > ---- graph creation and display code > > filename <- "adj.txt" > adj<-read.table(filename,sep=",") > rownames(adj)=1:5000 > colnames(adj)=1:5000 > p=as.matrix(adj) > > library (RCytoscape) > > # if you want to remove self-loops, enable this line > diag (p) = 0 # remove any self-loops > > # now create a Bioconductor graph of subclass 'graphAM' > g = new ('graphAM', adjMat=p, edgemode='directed') > > # these next few lines are useful if you run this script repetetively, since RCy requires that all window names are unique, > # these lines allows you to detect and then delete any pre-existing window with the same name > > if (!exists('cy')) # get access to application-level Cytoscape operations. > cy = CytoscapeConnection () > > window.name = 'adjacency matrix graph ' > > # now create a window, send the graph, render it, lay it out > > cw = CytoscapeWindowwindow.name, g, overwriteWindow=TRUE) > system.time(displayGraph (cw)) # 19 seconds elapsed time for me > redraw (cw) > > # I suggest you do layout from the Cytoscape menu (Layout->yFiles->Organic) > # It is faster and better than jgraph-spring > # layoutNetwork (cw, 'jgraph-spring') > > > > > > > > On Mar 20, 2013, at 1:47 PM, rubens at andrew.cmu.edu wrote: > >> Hi Paul, >> >> I attach you all the required information: >> >> a) The exact R code I used is in a txt file call coderuben.txt (attached) >> b) I made a zip file with the adjacency matrix adj.txt.zip (attached) >> c) the sessionInfo() and versions are: >> >> >>> sessionInfo() >> R version 2.14.0 (2011-10-31) >> Platform: x86_64-apple-darwin9.8.0/x86_64 (64-bit) >> >> locale: >> [1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8 >> >> attached base packages: >> [1] stats graphics grDevices utils datasets methods base >> >> other attached packages: >> [1] RCytoscape_1.4.4 XMLRPC_0.2-4 graph_1.32.0 >> >> loaded via a namespace (and not attached): >> [1] RCurl_1.91-1 tools_2.14.0 XML_3.9-4 >> >> Cytoscape version 2.8.3 >> CytoscapeRPC plugin version 1.8 >> >> >> >> Thanks >> Ruben >> <coderuben.txt><adj.txt.zip> >
ADD COMMENT

Login before adding your answer.

Traffic: 492 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6