[BioC] Rgraphviz - arrowhead

Deepayan Sarkar deepayan.sarkar at gmail.com
Wed Jun 24 18:48:31 CEST 2009


On Wed, Jun 24, 2009 at 3:30 AM, Yaniv Semel<ys1276 at gmail.com> wrote:
> here is my session info after i updated the Rgraphviz package. its 1.20.4
> (whereas yours is 1.22).
> the manual page for layoutGraph is still the same as i had before the
> update.

You need to use R 2.9.x and the associated version of Rgraphviz. The
manual page there shows you how to change the layout algorithm, and
also how to use custom arrowheads.

-Deepayan

>
>
> R version 2.8.1 (2008-12-22)
> i386-pc-mingw32
>
> locale:
> LC_COLLATE=English_United States.1252;LC_CTYPE=English_United
> States.1252;LC_MONETARY=English_United
> States.1252;LC_NUMERIC=C;LC_TIME=English_United States.1252
>
> attached base packages:
> [1] grid      stats     graphics  grDevices utils     datasets  methods
> [8] base
>
> other attached packages:
> [1] Rgraphviz_1.20.4 graph_1.20.0
>
> loaded via a namespace (and not attached):
> [1] cluster_1.12.0 tools_2.8.1
>
>
> Yaniv
>
>
>
>
>
> 2009/6/24 Robert Gentleman <rgentlem at fhcrc.org>
>
>> Hi Yaniv,
>>  Perhaps your R  or Rgraphviz are out of date? Please follow the posting
>> guide, and provide the output of sessionInfo. The example I see on this man
>> page is much longer and answers your question (my sessionInfo is below)
>>
>> > sessionInfo()
>> R version 2.9.1 RC (2009-06-22 r48824)
>> x86_64-unknown-linux-gnu
>>
>> locale:
>>
>> LC_CTYPE=en_US.UTF-8;LC_NUMERIC=C;LC_TIME=C;LC_COLLATE=C;LC_MONETARY=C;LC_MESSAGES=en_US.UTF-8;LC_PAPER=en_US.UTF-8;LC_NAME=C;LC_ADDRESS=C;LC_TELEPHONE=C;LC_MEASUREMENT=en_US.UTF-8;LC_IDENTIFICATION=C
>>
>> attached base packages:
>> [1] grid stats graphics grDevices utils datasets methods
>> [8] base
>>
>> other attached packages:
>> [1] Rgraphviz_1.22.1 graph_1.22.2
>>
>> loaded via a namespace (and not attached):
>> [1] tools_2.9.1
>>
>>
>>
>> On Wed, Jun 24, 2009 at 2:38 AM, Yaniv Semel <ys1276 at gmail.com> wrote:
>>
>>> Thanks, Robert
>>>
>>> this is the example in layoutGraph:
>>>
>>> library(graph)
>>> set.seed(123)
>>> V <- letters[1:10]
>>> M <- 1:4
>>>
>>> g1 <- randomGraph(V, M, 0.8)
>>> x <- layoutGraph(g1)
>>>
>>>
>>>
>>> now, if i do
>>> renderGraph(x)
>>>
>>> it draws it as "dot" layout by default. how can i change it to "neato" or
>>> "twopi"?
>>>
>>>
>>> Thanks,
>>> Yaniv
>>>
>>>
>>>
>>>
>>> 2009/6/23 Robert Gentleman <rgentlem at fhcrc.org>
>>>
>>> Hi Yaniv,
>>>>      Let me direct you to the examples on the manual page for
>>>> layoutGraph.
>>>> best wishes
>>>>    Robert
>>>>
>>>> On Tue, Jun 23, 2009 at 9:30 AM, Yaniv Semel <ys1276 at gmail.com> wrote:
>>>>
>>>>> >
>>>>> > regarding the arrowhead issue, its written in the documentation of the
>>>>> > ?GraphvizAttributes that the arrowhead is very limited in R compared
>>>>> to the
>>>>> > Graphviz library and it can only be of "open" or "none" shape, but not
>>>>> any
>>>>> > of the "box", "diamnod" shapes that are contained in the Graphviz
>>>>> library.
>>>>> > so i guess (correct me if i wrong) that i just cant do any shaped
>>>>> > arrowhead.
>>>>> >
>>>>> > when following the instructions of newRgraphvizInterface vignette, how
>>>>> can
>>>>> > i set the layout of a graph to be "neato"?
>>>>> > the default is "dot" and i dont know how to change it.
>>>>> > in the old interface i just did:
>>>>> >
>>>>> > plot(g, "neato")      # neato layout
>>>>> >
>>>>> > or:
>>>>> >
>>>>> > plot(g, "dot")          # dot layout
>>>>> >
>>>>> > but now, the code doesnt use plot at all. instead it uses layoutGraph:
>>>>> >
>>>>> > library("Rgraphviz")
>>>>> > set.seed(123)
>>>>> > V <- letters[1:10]
>>>>> > M <- 1:4
>>>>> > g1 <- randomGraph(V, M, 0.2)
>>>>> > g1 <- layoutGraph(g1)
>>>>> > renderGraph(g1)
>>>>> >
>>>>> > how do i change it to be of neato layout?
>>>>> >
>>>>> > Thanks,
>>>>> > Yaniv
>>>>> >
>>>>> >
>>>>> >
>>>>> >
>>>>> >
>>>>> >
>>>>> >
>>>>> > 2009/6/18 Deepayan Sarkar <deepayan.sarkar at gmail.com>
>>>>> >
>>>>> >> On Wed, Jun 17, 2009 at 3:00 PM, Yaniv Semel<ys1276 at gmail.com>
>>>>> wrote:
>>>>> >>
>>>>> >> > Hi all,
>>>>> >> >
>>>>> >> >
>>>>> >> > i'm using the package Rgraphviz to draw graphs, and its really
>>>>> awesome.
>>>>> >> > there is only one thing that i cant accomplish no matter what i
>>>>> try: to
>>>>> >> draw
>>>>> >> > arrowhead (on edges) that are different than the normal.
>>>>> >> > i'm trying to change the arrowhead property to be "box" or
>>>>> "diamond" or
>>>>> >> > anything else according to the instructions here:
>>>>> >> >
>>>>> >> > http://www.graphviz.org/pub/scm/graphviz2/doc/info/attrs.html
>>>>> >> >
>>>>> >> > but it doesnt have any effect. i always get the normal arrowhead.
>>>>> >> >
>>>>> >> > what am i missing here?
>>>>> >> > can somebody please show me a working code that produce a simple
>>>>> graph
>>>>> >> with
>>>>> >> > not normal arrowheads (for example box or diamonds) ?
>>>>> >> >
>>>>> >> > here is a simple code that shows that i can manage to control the
>>>>> edge
>>>>> >> color
>>>>> >> > (red), but not the arrowhead:
>>>>> >> >
>>>>> >> >
>>>>> >> > nodes <- c(n1="a", n2="b", n3="c")
>>>>> >> > edges <- list(a=list(edges=c("b", "c")), b=list(edges=c("c")),
>>>>> >> > c=list(edges=c()))
>>>>> >> > g <- new("graphNEL", nodes=nodes, edgeL=edges, edgemode="directed")
>>>>> >> > plot(g, attrs=list(edge=list(color="red", arrowhead="box",
>>>>> >> > dir="forward")))
>>>>> >>
>>>>> >> Try the new layoutGraph/renderGraph interface, described in the "A
>>>>> New
>>>>> >> Interface to Plot Graphs Using Rgraphviz" vignette:
>>>>> >>
>>>>> >>
>>>>> >>
>>>>> http://bioconductor.org/packages/2.4/bioc/vignettes/Rgraphviz/inst/doc/newRgraphvizInterface.pdf
>>>>> >>
>>>>> >> -Deepayan
>>>>> >>
>>>>> >
>>>>>
>>>>>         [[alternative HTML version deleted]]
>>>>>
>>>>> _______________________________________________
>>>>> Bioconductor mailing list
>>>>> Bioconductor at stat.math.ethz.ch
>>>>> https://stat.ethz.ch/mailman/listinfo/bioconductor
>>>>> Search the archives:
>>>>> http://news.gmane.org/gmane.science.biology.informatics.conductor
>>>>>
>>>>>
>>>>
>>>>
>>>> --
>>>> Robert Gentleman, PhD
>>>> Program in Computational Biology
>>>> Division of Public Health Sciences
>>>> Fred Hutchinson Cancer Research Center
>>>> 1100 Fairview Ave. N, M2-B876
>>>> PO Box 19024
>>>> Seattle, Washington 98109-1024
>>>> 206-667-7700
>>>> rgentlem at fhcrc.org
>>>>
>>>>
>>
>>
>> --
>> Robert Gentleman, PhD
>> Program in Computational Biology
>> Division of Public Health Sciences
>> Fred Hutchinson Cancer Research Center
>> 1100 Fairview Ave. N, M2-B876
>> PO Box 19024
>> Seattle, Washington 98109-1024
>> 206-667-7700
>> rgentlem at fhcrc.org
>>
>>
>
>        [[alternative HTML version deleted]]
>
> _______________________________________________
> Bioconductor mailing list
> Bioconductor at stat.math.ethz.ch
> https://stat.ethz.ch/mailman/listinfo/bioconductor
> Search the archives: http://news.gmane.org/gmane.science.biology.informatics.conductor
>



More information about the Bioconductor mailing list