Fraser_Sim at URMC.Rochester.edu
Fri Apr 17 15:24:59 CEST 2009
Thanks for the update. I completely agree re: the warning and the fall
back to default arrows. I'll download the new package later today and
will give it a try.
On another related note, I am having difficulty using "rankdir = LR"
using the new layoutGraph/renderGraph interface.
Here's my code :
V <- letters[1:5]
M <- 1:2
g1 <- randomGraph(V, M, 0.5)
edgemode(g1) <- "directed"
attrs = list(graph = list(rankdir = "TB"))
x <- layoutGraph(g1, attrs = attrs)
# no difference
attrs = list(graph = list(rankdir = "LR"))
x <- layoutGraph(g1, attrs = attrs)
# this next code works but uses the old interface
plot(g1, attrs = attrs)
I took this from the Bioconductor Case Studies book and simplified for
the example. There is no difference between the two renderGraph steps
but the old 'plot' works as expected.
Also the LR setting didn't work using:
graphRenderInfo(x)$rankdir = "LR" # Which I find more intuitive but may
not be correct?
Thanks for all your help,
From: Florian Hahne [mailto:fhahne at fhcrc.org]
Sent: Thursday, April 16, 2009 7:31 PM
To: Sim, Fraser
Cc: bioconductor at stat.math.ethz.ch
Subject: Re: [BioC] RGraphviz
Sim, Fraser wrote:
> Hi Florian,
> Here is some example code:
> V <- letters[1:5]
> M <- 1:2
> g1 <- randomGraph(V, M, 0.5)
> edgemode(g1) <- "directed"
> x <- layoutGraph(g1)
> edgeRenderInfo(x) = list(arrowhead = "tee")
> edgeRenderInfo(x) = list(arrowhead = "normal")
> The first graph rendering is correct with arrowhead converted to
> The second generates open arrowheads more like the 'vee' according to
> the graphviz documentation. Also if you run the code with 'vee' there
> no difference from 'normal'.
The base R graphics arrow function doesn't know how to draw filled arrow
heads. And since all Rgraphviz plotting is done using base graphics, the
"normal" arrow shape was more like the 'vee' shape in Graphviz. I added
filled arrowheads to the latest Rgraphviz devel version (1.21.11), and
these are used as the default now. Things get a bit ugly once you start
resizing the X11 device, but that problem was there before, it's just
easier to spot for the filled arrow heads. Note that you will only get
those when you use the new layoutGraph/renderGraph interface.
> It appears that some of the other shapes are also not supported and
> revert back to the standard. I understand that not all shapes may be
> supported but it would be more intuitive if the renderGraph produced
> error or warning for non-supported shapes rather than just silently
> reverting them to an open arrow.
You will now get a warning when using a non-supported arrow head type.
We still fall back to the default arrowhead, which is a good thing, I
> -----Original Message-----
> From: Florian Hahne [mailto:fhahne at fhcrc.org]
> Sent: Tuesday, April 14, 2009 7:09 PM
> To: Sim, Fraser
> Cc: bioconductor at stat.math.ethz.ch
> Subject: Re: [BioC] RGraphviz
> Hi Fraser,
> could you provide a reproducible example for us to take look. From
> your post I can't tell how or where you tried to set the symbols.
> On 14.04.2009, at 14:09, Sim, Fraser wrote:
>> Hi all,
>> I am trying to set custom arrowheads in a graphviz-based plot. It I
>> to "tee" or "dot", I get the expected symbols.
>> However, if I use "normal", I do not get a closed arrowhead and
>> there is
>> no difference between "normal" and "vee" arrowheads.
>> Any idea why?
>> R version 2.8.1 (2008-12-22)
>> LC_COLLATE=English_United States.1252;LC_CTYPE=English_United
>> States.1252;LC_NUMERIC=C;LC_TIME=English_United States.1252
>> attached base packages:
>>  grid stats graphics grDevices utils datasets
>>  base
>> other attached packages:
>>  Rgraphviz_1.21.7 graph_1.20.0 rcom_2.0-4
>> loaded via a namespace (and not attached):
>>  cluster_1.11.12 tools_2.8.1
>> Bioconductor mailing list
>> Bioconductor at stat.math.ethz.ch
>> Search the archives:
Florian Hahne, PhD
Computational Biology Program
Division of Public Health Sciences
Fred Hutchinson Cancer Research Center
1100 Fairview Ave. N, M1-B514
PO Box 19024
Seattle, Washington 98109-1024
fhahne at fhcrc.org
More information about the Bioconductor