not all edge attributes send from R to Cytoscape

0 views
Skip to first unread message

ramona

unread,
Aug 27, 2009, 6:46:32 AM8/27/09
to gaggle-discuss
Hi all,

I just started using the gaggle and tried to send an edge as well as
node annotated graph from R to Cytoscape. Unfortunately, not all of
the attributes are recieved by Cytoscape. Does anyone know why this
could happen?

Would be really happy about any advice!

Many thanks
Ramona

Dan Tenenbaum

unread,
Aug 27, 2009, 11:59:59 AM8/27/09
to gaggle-...@googlegroups.com
Can you send the R code you used to generate the graph?
Thanks!
Dan

Christopher Bare

unread,
Aug 28, 2009, 4:21:21 PM8/28/09
to Dan Tenenbaum, ramona, gaggle-...@googlegroups.com
Hi Ramona,

To shorten your example a little:

graph=randomEGraph(LETTERS[1:8], edges=10)
nodeDataDefaults(graph, "attr1") <- NA
nodeData(graph, n=nodes(graph) , attr="attr1") <-
rep(list(1:numNodes(graph)),numNodes(graph))
broadcast(graph)

If I understand your question right, you're expecting each node in the
graph to have an attribute called attr1 with a value of
[1,2,3,4,5,6,7,8]? The problem is that although an R graph allows you
to assign a list as a node attribute, Gaggle networks don't allow
that.

I doubt Cytoscape could do anything with a multiple values for an
attribute either, but I don't know that for sure. The fact that you're
seeing attr1=8 on the Cytoscape side, where 8 is the last element of
list(1:numNodes(graph)), is an artifact of the funny way the R goose
transforms an R graph object into a Gaggle network object.

I hope this helps,

-chris

------------------------------------------------
J. Christopher Bare
Software Engineer, Baliga Lab
Institute for Systems Biology
------------------------------------------------

On Fri, Aug 28, 2009 at 11:15 AM, Dan
Tenenbaum<dtene...@systemsbiology.org> wrote:
>
>
> ---------- Forwarded message ----------
> From: ramona <ramona.s...@googlemail.com>
> Date: Fri, Aug 28, 2009 at 7:30 AM
> Subject: Re: not all edge attributes send from R to Cytoscape
> To: Dan Tenenbaum <dtene...@systemsbiology.org>
>
>
> Dear Dan,
>
> the program I wrote is quite big as well as is the resulting graph.I
> extracted a subgraph from my real graph which then has 50 nodes, 25
> edges and 4 node and 10 edge attributes assigned. Could it simply be
> too big and I do not get an error message by windows about the fact
> that not all data is send to/received by Cytoscape? Maybe it would
> help if I sent you my saved graph object?
> The generalized way i generate the graph is
> ##########
> graph=randomEGraph(LETTERS[1:8], edges=10)
> nodeDataDefaults(graph, "attr1") <- NA
> nodeData(graph,n=nodes(graph) , attr="attr1") <- rep(list(1:numNodes
> (graph)),numNodes(graph))
> nodeDataDefaults(graph, "attr2") <- NA
> nodeData(graph, n=nodes(graph), attr="attr2") <- rep(list(rep("ca",
> 5)),numNodes(graph))
>
> graph_edgeMatrix=edgeMatrix(graph)
> node_a=nodes(graph)[graph_edgeMatrix[1,]]
> node_b=nodes(graph)[graph_edgeMatrix[2,]]
>
> edgeDataDefaults(graph, "attr3") <- list(rep(NA, 5))
> edgeData(graph, from=node_a, to=node_b, attr="attr3") <- rep(list(rep
> ("ca", 5)),numEdges(graph))
>
> edgeDataDefaults(graph, "attr4") <- list(rep(NA, numEdges))
> edgeData(graph, from=node_a, to=node_b, attr="attr4") <- rep(list
> (1:numEdges(graph)),numEdges(graph))
> edgeDataDefaults(graph, "attr5") <- list(rep(NA, 5))
> edgeData(graph, from=node_a, to=node_b, attr="attr5") <- rep(list(rep
> ("ca", 5)),numEdges(graph))
>
> broadcast(graph)
> #######
>
> All of the attibute types are displayed in Cytoscape, what is not the
> case for my graph. What I did not realize before is in the case of
> vectors assigned, only the last element is displayed in Cytoscape.
>
> How do I have to assign vectors such that they are completely
> displayed by Cytoscape?
>
> Many thanks
> Ramona
>
>
> On 27 Aug., 17:59, Dan Tenenbaum <dtenenb...@systemsbiology.org>


> wrote:
>> Can you send the R code you used to generate the graph?Thanks!
>> Dan
>>
>> On Thu, Aug 27, 2009 at 3:46 AM, ramona

>> <ramona.schmid...@googlemail.com>wrote:


>>
>>
>>
>>
>>
>> > Hi all,
>>
>> > I just started using the gaggle and tried to send an edge as well as
>> > node annotated graph from R to Cytoscape. Unfortunately, not all of
>> > the attributes are recieved by Cytoscape. Does anyone know why this
>> > could happen?
>>
>> > Would be really happy about any advice!
>>
>> > Many thanks

>> > Ramona- Zitierten Text ausblenden -
>>
>> - Zitierten Text anzeigen -
>
>

burak kutlu

unread,
Aug 28, 2009, 9:44:56 PM8/28/09
to gaggle-...@googlegroups.com
Hi Ramona
One way around the problem would be pass one concatanated character string. You may split them later in R.
-burak
Reply all
Reply to author
Forward
0 new messages