[BioC] Rgraphviz edge weight question

Kimpel, Mark William mkimpel at iupui.edu
Mon Jun 12 02:23:03 CEST 2006


Wolfgang,

I spent some time today trying to figure out how to accomplish what you
outlined below and I believe there is a roadblock with the C code of
.Call("Rgraphviz_agopen"....) . In agopen, the lwd slot of edgeAttrs
looks like

$lwd
     Ace~Cat       Ace~Cs  Adcyap1~Avp  Adcyap1~Gal Adcyap1~Ghrh
Akt1~Igf1    Akt1~Insr     Akt1~Src   Akt1~Vegfa      Avp~Gal
Avp~Gast     Avp~Ghrh 
           4            4            4            4            4
4            4            4            4            4            4
4

Which is correct for the test code I am using. Once the C function is
called, 

attr(attr(g,"AgEdge")[[1]], "lwd")
numeric(0) 

which indicates to me that the C code is not translating the "lwd"
parameter from the graph to the Ragraph object.

Jeff, am I correct? If so, is this something that you can address? If
so, while you are at it, could you also get the function to pass along
the "lty" parameter as well?

If I'm all wet here, please pardon my ignorance, I'm a novice
programmer!

Mark

Mark W. Kimpel MD 

 

(317) 490-5129 Home, Work, & Mobile

1-(317)-536-2730 FAX


-----Original Message-----
From: Wolfgang Huber [mailto:huber at ebi.ac.uk] 
Sent: Sunday, June 11, 2006 1:22 PM
To: Kimpel, Mark William
Cc: Bioconductor Newsgroup
Subject: Re: [BioC] Rgraphviz edge weight question

Hi Mark,

I believe that is not currently possible (Rgraphviz 1.11.0) without 
changing some of the code in Rgraphviz (or overwriting exisitings 
methods with your own ones). Seth, Jeff, please correct me if I am
wrong.

The method "lines" for "AgEdge" objects (defined in 
Rgraphviz/R/Ragraph.R) has and honours a parameter "lwd". Its  default 
is the global option par("lwd").

However, that parameter is not set (or read from any kind of graph 
attribute or function call parameter) by the plot method for the 
"graphNEL" class (which in turn calls the plot method for the class 
"Ragraph"). Both of these are defined in Rgraphviz/R/graph.R.

It should be relatively straightforward to modify these latter two 
methods to honor an element "lwd" in the edgeAttrs list and pass it on 
to "lines" (for "AgEdge").

Mark, if you feel adventurous, you could try to contribute a patch for 
doing this?

Also, in the Bioconductor book on p.368 and Fig. 21.15 there is an 
example how can really do anything you want...

Best wishes
  Wolfgang

PS  - for the purists, when I said method for class X, I meant a method 
whose signature contains X in the first position.


Kimpel, Mark William wrote:
> I am visualizing graphNEL objects using Rgraphviz. I would like to set
the thickness of the edge lines, in points, proportional to the edge
weights. Is this an attribute that can be set? I have looked through the
Rgraphviz documentation as well as the Graphviz website without finding
an answer.
> 
> Thanks,
> 
> Mark
> 
> Mark W. Kimpel MD 
> 
>  
> Official Business Address:
>  
> Department of Psychiatry
> Indiana University School of Medicine
> Biotechnology, Research, & Training Center
> 1345 W. 16th Street
> Indianapolis, IN  46202
>  
> Preferred Mailing Address:
>  
> 15032 Hunter Court
> Westfield, IN  46074
>  
> (317) 490-5129 Home, Work, & Mobile
> 1-(317)-536-2730 FAX
> 
> _______________________________________________
> 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


-- 
------------------------------------------------------------------
Wolfgang Huber  EBI/EMBL  Cambridge UK  http://www.ebi.ac.uk/huber



More information about the Bioconductor mailing list