[BioC] Rgraphviz warnings in R-2.0

Saurin Jani saurin_jani at yahoo.com
Mon Oct 18 23:26:40 CEST 2004


Hi Jeff,

I am collecting Differentially Expressed Genes
(DEscores) :

m.ranks <- rank(-abs(DEscores[,2]));
names(m.ranks) <- rownames(DEscores);

t.ranks <- rank(-abs(DEscores[,3]));
names(t.ranks) <- rownames(DEscores);

All_Ranks <- cbind(m.ranks,t.ranks)[TRUE,];

temp1.genes    <-  as.matrix(All_Ranks[,1] < 10);
temp2.genes    <-  as.matrix(All_Ranks[,2] < 10);

topgenes_m <- myDEGenes[temp1.genes];

topgenes_t <- myDEGenes[temp2.genes];

tmp <-
unique(rbind(as.matrix(topgenes_m),as.matrix(topgenes_t)));
topgenesGO <- as.character(unique(tmp));

topgenesGO <-
as.matrix(as.character(unique(topgenesGO)));

#collected top 10 highly ranked genes from whole DE
genes


# get locus link IDs

myLL <- getLL(topgenesGO,"moe430a");
myUNQLL <-
as.character(na.omit(unique(unlist(myLL))));

 gGOCC <- makeGOGraph(myUNQLL,"CC");
 gGOMF <- makeGOGraph(myUNQLL,"MF");
 gGOBP <- makeGOGraph(myUNQLL,"BP");


 CCnodes = nodes(gGOCC);
 MFnodes = nodes(gGOMF);
 BPnodes = nodes(gGOBP);

 c1 <- c("KO","KO","KO","WT","WT","WT");
 mns <- apply(exprs(esetFeature),1,function(x)
sapply(split(x,c1),mean));
 whismax <- apply(mns,2,function(x) match(max(x),x));
 maxNames <- names(mns[,1])[whismax];
 names(maxNames) = names(whismax);
 table(maxNames);

# cellular component GO graph

 CCnodes2affy = mget(CCnodes,moe430aGO2ALLPROBES);

  cts = sapply(CCnodes2affy,function(x) {
                 wh = names(whismax) %in% x
    table(maxNames[wh])
  })

KOcts = sapply(cts,function(x) x["KO"]);
KOcts = ifelse(is.na(KOcts),0,KOcts);
names(KOcts) = names(cts);

WTcts = sapply(cts,function(x) x["WT"]);
WTcts = ifelse(is.na(WTcts),0,WTcts);
names(WTcts) = names(cts);

ctmat = cbind(KOcts,WTcts);

pgLayoutCC <- agopen(gGOCC,"LayoutgGOCC");


jpeg(filename="goGraph_CC1.jpeg",width=1300,height=1300);

if(require(Rgraphviz)){

 opar = par(xpd = NA)
 plotPieChart <- function(curPlot,counts,main) {

 renderNode <- function(x) {

 force(x)
 y <- x * 100 + 1
 function(node,ur,attrs = list(),radConv = 1) {
          nodeCenter <- getNodeCenter(node)
          pieGlyph(y,xpos = getX(nodeCenter),ypos =
getY(nodeCenter),
                   radius = getNodeRW(node),col =
c("pink","green"))
         
#drawTxtLabel(txtLabel(node),getX(nodeCenter),getY(nodeCenter))
          }

      }
drawing <- vector(mode = "list",length =
nrow(counts));
for(i in 1:length(drawing)){
    drawing[[i]] <- renderNode(counts[i,])
    }
 if(missing(main))
  main = "GO: Cellular Component : Mouse Embryo
Fibroblast Pie Chart Plot"
  plot(curPlot,drawNode = drawing,main = main)
 legend(300,65,legend = c("KO","WT"), fill =
c("pink","green"))
 }

plotPieChart(pgLayoutCC,ctmat)
par(opar)
}
dev.off();


Thank you,
Saurin 





--- Jeff Gentry <jgentry at jimmy.harvard.edu> wrote:

> > Thank you so much. I asked question because when I
> do
> > below code  R-1.9 then with graphviz 1.12 and
> > Rgraphviz 1.4.0 it was working great. 
> > -----------------------------------
> > Error in FUN(X[[1]], ...) : couldn't find function
> > "convertRadius"
> > ------------------------------------
> 
> convertRadius is an old function that no longer
> exists, but you're not
> calling it directly.  Can you provide a
> 'traceback()', because the string
> 'convertRadius' doesn't show up anywhere in the
> current R code so I have
> no idea where you're piciking that up from.
> 
>



More information about the Bioconductor mailing list