[BioC] 5000 nodes RCytoscape
Paul Shannon
pshannon at fhcrc.org
Fri Mar 22 01:16:06 CET 2013
(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 = CytoscapeWindow(window.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>
>
More information about the Bioconductor
mailing list