[BioC] problem getting setNodeColorRule from RCytoscape to work
Paul Shannon
pshannon at fhcrc.org
Sat Mar 17 19:02:03 CET 2012
Hi Burak,
Sorry you are running into trouble. Suggestions below.
On Mar 17, 2012, at 10:13 AM, Burak Kutlu wrote:
> Hello,
> Trying to replicate the example provided in the help page for setNodeColorRule, unfortunately it does not work for me.
> Any suggestions?
> thanks
> -burak
>
> # example from the help page for setNodeColorRule
>
>> cw <- new.CytoscapeWindow ('setNodeColorRule.test', graph=makeSimpleGraph())
> control.points <- c (-3.0, 0.0, 3.0) # typical range of log-fold-change ratio values
> # paint negative values shades of green, positive values shades of
> # red, out-of-range low values are dark green; out-of-range high
> # values are dark red
> node.colors <- c ("#00AA00", "#00FF00", "#FFFFFF", "#FF0000", "#AA0000")
> setNodeColorRule (cw, node.attribute.name='lfc', control.points, node.colors, mode='interpolate')
> redraw (cw)
> data.values <- c ("kinase", "transcription factor", "glycoprotein")
> node.colors <- c ("#0000AA", "#FFFF00", "#0000AA")
> setNodeColorRule (cw, node.attribute.name='type', data.values, node.colors, mode='lookup', default.color='#AA0000')
>> control.points <- c (-3.0, 0.0, 3.0) # typical range of log-fold-change ratio values
>> # paint negative values shades of green, positive values shades of
>> # red, out-of-range low values are dark green; out-of-range high
>> # values are dark red
>> node.colors <- c ("#00AA00", "#00FF00", "#FFFFFF", "#FF0000", "#AA0000")
>> setNodeColorRule (cw, node.attribute.name='lfc', control.points, node.colors, mode='interpolate')
> Error in convertToR(xmlParse(node, asText = TRUE)) :
> faultCode: 1001 faultString: Attribute lfc could not be found.
This error message may point to the problem. Could you run this command and send me the output?
noa.names (cw at graph)
noa (cw at graph, 'lfc')
When I do so, here is what I see:
> g = makeSimpleGraph ()
> noa.names (g)
[1] "type" "lfc" "label" "count"
> noa (g, 'lfc')
A B C
-3 0 3
I have simplified the approach here, but I think the crucial aspects are included:
1) RCytoscape::makeSimpleGraph () returns a 3-node, 3-edge graph with a few node and edge attributes
2) setNodeColorRule (cw, 'lfc', <control.points>, <color.list>, mode) uses the values of the lfc attribute
If you will be so kind as to send my your results, we can think about either bug fixes I need to make, or better checks to add to the RCy package so that you (and others) have an easier time of it.
Regards,
- Paul
>> redraw (cw)
>> data.values <- c ("kinase", "transcription factor", "glycoprotein")
>> node.colors <- c ("#0000AA", "#FFFF00", "#0000AA")
>> setNodeColorRule (cw, node.attribute.name='type', data.values, node.colors, mode='lookup', default.color='#AA0000')
> Error in convertToR(xmlParse(node, asText = TRUE)) :
> faultCode: 1001 faultString: Attribute type could not be found.
>>
>
>
> ## session info
>
>> sessionInfo()
> R version 2.14.2 (2012-02-29)
> 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.5.2 XMLRPC_0.2-4 graph_1.32.0
> [4] BiocInstaller_1.2.1
>
> loaded via a namespace (and not attached):
> [1] RCurl_1.91-1 tools_2.14.2 XML_3.9-4
More information about the Bioconductor
mailing list