[BioC] RCytoscape: object 'graph' not found error

Christopher T Gregg chris.gregg at neuro.utah.edu
Tue Dec 31 19:33:39 CET 2013


Hi,

I have encountered an error with RCytoscape that is unclear to me.  I have attached our script and data file and sessionInfo (at the bottom of the script) below.

Our data is an adjacency matrix and we wish to construct a weighted network graph in Cytoscape.  I am able to generate the graph object ('g'), which contains the gene names in the @adjMat slot from the adjacency matrix and it will generate a graph in Cytoscape.  However, when I attempt to add node and edge attributes to the g object, I get the following error:

> g <<- initEdgeAttribute (g, "edgeInteger", "integer", 0)
> edgeData (g, from, to, "edgeInteger") <<- edgeInteger
Error in edgeData(g, from, to, "edgeInteger") <<- edgeInteger :
  object 'g' not found

The edgeInteger, from and to variables have the data of interest and the g object is successfully generated (see below), so I can't understand where the error lies.  Thank you for any and all help.

best wishes,
Chris

#SUCCESSFUL GENERATION OF GRAPH OBJECT and EDGE INTEGER
g <<- new ("graphAM", adjMat = dataNetR, edgemode="weighted")
> g
A graphAM graph with weighted edges
Number of Nodes = 6
Number of Edges = 7.5
> str(g)
Formal class 'graphAM' [package "graph"] with 5 slots
  ..@ adjMat    : num [1:6, 1:6] 0 0 0 0 0 0 1 0 0 0 ...
  .. ..- attr(*, "dimnames")=List of 2
  .. .. ..$ : NULL
  .. .. ..$ : chr [1:6] "ENSMUSG00000000037" "ENSMUSG00000004267" "ENSMUSG00000016757" "ENSMUSG00000019849" ...
  ..@ edgeData  :Formal class 'attrData' [package "graph"] with 2 slots
  .. .. ..@ data    : list()
  .. .. ..@ defaults: list()
  ..@ nodeData  :Formal class 'attrData' [package "graph"] with 2 slots
  .. .. ..@ data    : list()
  .. .. ..@ defaults:List of 1
  .. .. .. ..$ nodeChar:Class 'STRING'  chr ""
  ..@ renderInfo:Formal class 'renderInfo' [package "graph"] with 4 slots
  .. .. ..@ nodes: list()
  .. .. ..@ edges: list()
  .. .. ..@ graph: list()
  .. .. ..@ pars : list()
  ..@ graphData :List of 1
  .. ..$ edgemode: chr "weighted"

> edgeInteger
 [1] 0.13080159 0.14678129 0.10697558 0.12109223 0.14722505 0.19004585 0.08775686 0.15081269 0.04768105 0.21863816 0.19299134 0.17825061
[13] 0.18689388 0.10821313 0.14221187

Christopher Gregg, PhD.
New York Stem Cell Foundation-Robertson Investigator
Assistant Professor, Neurobiology and Anatomy
Adjunct Assistant Professor, Human Genetics
323 Wintrobe Bldg 530
University of Utah, School of Medicine
20 North 1900 East
Salt Lake City, Utah 84132-3401

phone: (801) 581-8212
fax: (801) 585-9736
------------------------------------
Gregg Lab Website: www.neuro.utah.edu/labs/gregg/index.html<http://www.neuro.utah.edu/labs/gregg/index.html>



More information about the Bioconductor mailing list