0

I tried using the RCytoscape package to export networks from R to cytoscape. I tried to follow the documentation butfailed. The following are the commands Iused:

data(liver.toxicity)
X <- liver.toxicity$gene
Y <- liver.toxicity$clinic
toxicity.spls <- spls(X, Y, ncomp = 3, keepX = c(50, 50, 50), keepY = c(10, 10, 10))
result<-network(toxicity.spls, comp = 1:3, threshold = 0.8, 
 X.names = NULL, Y.names = NULL, keep.var = TRUE,
 color.node = c("mistyrose", "lightcyan"),
  shape.node = c("rectangle", "circle"),
  color.edge = c("red", "blue"),
   lty.edge = c("solid", "solid"), lwd.edge = c(1, 1), 
   show.edge.labels = FALSE, interactive = FALSE)
  library(RCytoscape)
  cw <- CytoscapeWindow ("result", graph=makeSimpleGraph())
  displayGraph (cw)

Instead of importing the 42 vertices and 78 edges it just imports those three edges and nodes that are shown in the documentation. I do not realise whee am making the mistake.

Spontifixus
  • 6,570
  • 9
  • 45
  • 63
Stacey John
  • 151
  • 3
  • 3
  • 13

1 Answers1

3

If 'result' is your graph, then this should work:

cw <- CytoscapeWindow ("result", graph=result);
displayGraph (cw)

In the current form of your code -- it's an easy mistake to make! -- you are asking RCytoscpe to display a demo graph, one made by the RCy demo method, 'makeSimpleGraph ()'

Let me also ask, to save a bit of trouble perhaps: does your network function return a graphNEL?

If you have any uncertainty about how to create a graphNEL, typing simply makeSimpleGraph at the R prompt will show you all the code that goes into making a graphNEL, with nodes, edges, and attributes.

Make sense? Let us know if you run into any more difficulties.

Brian Diggs
  • 57,757
  • 13
  • 166
  • 188