[BioC] fontsize in Rgraphviz

Mark W Kimpel mwkimpel at gmail.com
Wed Jan 30 06:43:20 CET 2008


Deepayan,

Thanks for your efforts, it looks like you are working on major changes 
to Rgraphviz for BioC 2.2.

Your example worked for me (with R-devel), but I can't get my own 
function to work. Below is my code, or what I hope is the relevant part, 
with the error output. It looks to me like layoutGraph is looking for a 
way to render a "neato" graph and can't find it, but I'm probably wrong. 
It also looks to me like you are making some major changes to the way 
node and edge attributes are passed to the rendering engine, so maybe 
the parameters I used to pass to plot(my.graphNEL) are not working.

Let me know what you think I am doing wrong. Mark

[1] "created graphAM"
[1] "created graphNEL"
Error in layoutGraph(result.gN, layout.param, layoutfun = "dot", 
nodeAttrs = nAttrs,  :
   could not find function "layoutFun"

Enter a frame number, or 0 to exit

1: result.matrix.graph.func(result.matrix = cocite.mat.sig, no.edges = 
TRUE, m
2: switch(file.output, ps = {
3: layoutGraph(result.gN, layout.param, layoutfun = "dot", nodeAttrs = 
nAttrs,

Selection:

  #font size
          if(file.output != "screen"){
            #cex.vec <-floor(22 * nodeAttrs(result.gN)$nodeWidth)
             cex.vec <- rep(48, length(nodes(result.gN)))
          } else {cex.vec <-rep(18, length(nodeAttrs(result.gN)$nodeWidth))}
          names(cex.vec) <- nodes(result.gN)

          fileName<-paste(experiment, contrast, "FDR", FDR, "Graph", 
"ps", sep=".")
          postscript(file=fileName, paper="special",width=width, 
height=height) #set up graphics device
          x <- layoutGraph(result.gN, layout.param, layoutfun = "dot", 
nodeAttrs = nAttrs, edgeAttrs = eAttrs,
               main=paste("Experiment:", experiment, ";  Contrast:", 
contrast,";  FDR:", FDR,
                 ";Total Genes:", length(nodes(result.gN)), "; Total 
Connections:",
                 round(aveNumEdges(result.gN)*length(nodes(result.gN)), 
digits=0),"; Min. connections ==",
                 min.edges, "; Min. citations per connection ==", 
min.cites, "; Additional search criteria:",
                 termAdditional, sep=" "))
                  nodeRenderInfo(x) = list(fontsize = cex.vec)
          renderGraph(x)
          dev.off()## close the graphics device

Mark W. Kimpel MD  ** Neuroinformatics ** Dept. of Psychiatry
Indiana University School of Medicine

15032 Hunter Court, Westfield, IN  46074

(317) 490-5129 Work, & Mobile & VoiceMail
(317) 204-4202 Home (no voice mail please)

mwkimpel<at>gmail<dot>com

******************************************************************


Deepayan Sarkar wrote:
> On 1/25/08, Mark W Kimpel <mwkimpel at gmail.com> wrote:
>> I would like to vary the font size of node labels in Rgraphviz as I have
>> been varying node size by fold change magnitude. Unfortunately, many
>> attempts have failed and I continue to get the same font size. Here is
>> my code followed by sessionInfo()
>>
>> nAttrs$fontsize<-floor(22 * nodeWidth)
>>
>> nodeWidth is a vector of widths which vary by node according to fold
>> change. This works nicely, but font size does not.
> 
> We have been playing an alternative rendering interface. With
> bioc-devel, I get varying node sizes and label size using
> 
> 
> set.seed(123)
> V <- letters[1:10]
> M <- 1:4
> g1 <- randomGraph(V, M, .2)
> 
> cex.list <- runif(length(nodes(g1)))
> names(cex.list) <- nodes(g1)
> 
> width.list <- seq(0.2, 2, length = length(nodes(g1)))
> names(width.list) <- nodes(g1)
> 
> x <- layoutGraph(g1, nodeAttrs = list(width = width.list))
> nodeRenderInfo(x) = list(fontsize = 50 * cex.list)
> renderGraph(x)
> 
> 
> 
> I'm not sure if this will work with Bioc 2.1.
> 
> -Deepayan
>



More information about the Bioconductor mailing list