Hi Paul
A little bit of Zen was really helpful: the example you provided, when executed in a calm, quiet place,  works :-)

There are a couple of things going on here: please confirm if you agree.

1. The only difference between the example in the help page and the example you provide is " displayGraph(cw) " call after creating the Cytoscape Window object. May I suggest including that in the help page example for both setNodeColorRule and setEdgeColorRule?

More specifically:
I would insert displayGraph(cw) after this line
cw <- new.CytoscapeWindow ('setNodeColorRule.test', graph=makeSimpleGraph())
I realize that I am still confused when to call displayGraph or redraw, after already calling displayGraph for the first time. Can you comment on this?

2. You tried earlier in vain to convince me to initiate the edge attributes.  Calling "InitEdgeAttributes" solved the issues I was having. Now I am really convinced. I am still confused, though, why you force this even when attributes exist for all edges.

Many thanks
-burak



On Mar 17, 2012, at 11:13 AM, Paul Shannon wrote:

> Thanks, Burak.  
> 
> So far so good.  Now try, if you will --  just to step through this slow and easy:
> 
>> cw = new.CytoscapeWindow (title = 'bug?', graph=g)
>> displayGraph (cw)
>   entering RCytoscape::displayGraph
>   sending 3 nodes
>   sending 3 edges
>   adding node attributes...
>   [1] "type"
>   [1] "lfc"
>   [1] "label"
>   [1] "count"
>   adding edge attributes...
>   [1] "edgeType"
>   entering setEdgeAttributesDirect, edgeType, with 3 names and 3 values
>   [1] "score"
>   entering setEdgeAttributesDirect, score, with 3 names and 3 values
>   [1] "misc"
> 
>> noa (cw@graph, 'lfc')
>   A  B  C
>  -3  0  3
> 
>> control.points <- c (-3.0, 0.0, 3.0)   # typical range of log-fold-change ratio values
>> node.colors <- c ("#00AA00", "#00FF00", "#FFFFFF", "#FF0000", "#AA0000")
>> noa (cw@graph, 'lfc')  # do this again, just to be sure
>   A  B  C
>  -3  0  3
>> setNodeColorRule (cw, node.attribute.name='lfc', control.points, node.colors, mode='interpolate')
>> redraw (cw)
> 
> - Paul
> 
> 
> On Mar 17, 2012, at 11:04 AM, Burak Kutlu wrote:
> 
>> Hi Paul
>> Thanks for the prompt response!!
>> 
>> Here's the output which looks identical to yours. 
>> 
>>> noa.names (cw@graph)
>> [1] "type"  "lfc"   "label" "count"
>>> noa (cw@graph, 'lfc')
>> A  B  C 
>> -3  0  3 
>> 
>> -burak
>> 
>> On Mar 17, 2012, at 11:02 AM, Paul Shannon wrote:
>> 
>>> noa.names (cw@graph)
>>> noa (cw@graph, 'lfc')
>> 
> 


	[[alternative HTML version deleted]]

