[BioC] Edge attributes in Rgraphviz

Robert Gentleman rgentlem at fhcrc.org
Tue Jan 29 18:23:57 CET 2008


You did not tell us what version - please include the output of 
sessionInfo in your posts.

Things have changed a lot and the devel version 1.17.11 is somewhat 
improved. Is that what you are using, and if not could you please try it?

best wishes
   Robert


Srinivas Iyyer wrote:
> Dear group, 
> 
> I am finding difficult to control edge size and color
> in the following piece of code. 
> natt = makeNodeAttrs(
>                      g4, 
>                      shape = "ellipse", 
>                      fillcolor= "goldenrod1",
>                      size=0,
>                      fontsize=8,
>                      label = substr(nodes(g4),6, 10)
>                     )
>> lgGO = agopen(
>              g4, 
>              recipEdges = "distinct", 
>              layoutType = "dot",
>              nodeAttrs = natt, 
>              name = "",
>              edgeAttrs=list(c(color='green',
>                               weight=0.3)
>                             )
>              )
> 
> Error in buildEdgeList(graph, recipEdges, edgeAttrs,
> subGList, attrs$edge) : 
>   STRING_ELT() can only be applied to a 'character
> vector', not a 'NULL'
> 
> 
> Here in agopen, I made a edgeAttrs list object with 
> color and weight attributes and I get above error. 
> 
> 
> Instead, I tried like the following:
> 
>> x = buildEdgeList(g4,
>                     recipEdges='distinct',
>                     edgeAttrs=list(c(color='green'))
>                    )
> Error in buildEdgeList(g4, recipEdges = "distinct",
> edgeAttrs = list(c(color = "green"))) : 
>   STRING_ELT() can only be applied to a 'character
> vector', not a 'NULL'
> 
> 
> Also when I just make a buildEdgeList object, I can
> make it with wight=1 (which is default)
> 
> 
> 
>> x = buildEdgeList(g4,recipEdges='distinct')
>> y = unlist(x)
>> y[[1]]
> An object of class “pEdge”
> Slot "from":
> [1] "GO:0030199"
> 
> Slot "to":
> [1] "GO:0030198"
> 
> Slot "attrs":
> $arrowhead
> [1] "open"
> 
> $weight
> [1] "1"
> 
> $dir
> [1] "forward"
> 
> 
> Slot "subG":
> [1] 0
> 
> 
> 
> How can I control, the edge global parameters. 
> I do not see makeEdgeAttr function just like
> makeNodeAttr. Could some one help me here please. A
> working code is given at bottom. 
> 
>> makeEdgeAttrs
> Error: object "makeEdgeAttrs" not found
> 
> 
> 
> 
> 
> ##### code that works#######
> g4 <- GOGraph(summary(hgOver)$GOBPID, GOBPPARENTS)
> 
> natt = makeNodeAttrs(g4, shape = "ellipse", fillcolor
> = "goldenrod1",size=0,fontsize=8,label =
> substr(nodes(g4),6, 10))
> 
> natt$fillcolor[summary(hgOver)$GOBPID] = "red" 
> 
> lgGO = agopen(g4, recipEdges = "distinct", layoutType
> = "dot",nodeAttrs = natt, name =
> "",edgeAttrs=list(c(color='green')))
> 
> plot(lgGO)
> 
> ###### end of code that works #######
> 
> 
>       ____________________________________________________________________________________
> Never miss a thing.  Make Yahoo your home page.
> 
> _______________________________________________
> 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



More information about the Bioconductor mailing list