Entering edit mode
Unger, Kristian
▴
40
@unger-kristian-3624
Last seen 10.2 years ago
Hi there
I am trying to optimise an output of pathway analysis and I am halfway
successful doing this using KEGGgraph. The most useful layout for my
purposes is the "dot" layout. The only problem I have is that I cannot
change the layout parameters for the nodes such as 'width', 'height'
or
anything.
Please find the code I am using in the following:
nAttrs <- list();
nAttrs$fillcolor <- makeAttr(mapkG, "lightgrey",
list(green=as.character(merge[,1]),red=as.character(merge2[,1])
,yellow=as.character(merge3[,1])))#green=n[1:5]))
#merge1,2 and 3 are strings of KEGG gene IDs which appear green, red
and
yellow in the plot
nAttrs$label <- nodesNames
nAttrs$height <-"3"
names(nAttrs$height) <- "height"
nAttrs$fontsize <- "20"
names(nAttrs$fontsize) <- "fontsize"
plot(mapkG, "dot", nodeAttrs=nAttrs)
I tried to set the node attributes height and fontsize by writing the
values into nAttrs$height and nAttrs$fontsize. Doing this an error
message ('Error in buildNodeList(graph, nodeAttrs, subGList,
attrs$node)
: the character vector must have names") came up. I added the names
and
the plot was generated without any errors but there still was not any
effect on height and fontsize of the nodes.
It would be great if someone could give me some ideas on this!
Best wishes
Kristian
> sessionInfo()
R version 2.11.1 (2010-05-31)
i686-pc-linux-gnu
locale:
[1] LC_CTYPE=en_GB.utf8 LC_NUMERIC=C
[3] LC_TIME=en_GB.utf8 LC_COLLATE=en_GB.utf8
[5] LC_MONETARY=en_GB.utf8 LC_MESSAGES=en_GB.utf8
[7] LC_PAPER=en_GB.utf8 LC_NAME=en_GB.utf8
[9] LC_ADDRESS=en_GB.utf8 LC_TELEPHONE=en_GB.utf8
[11] LC_MEASUREMENT=en_GB.utf8 LC_IDENTIFICATION=en_GB.utf8
attached base packages:
[1] grid stats graphics grDevices utils datasets
methods
[8] base
other attached packages:
[1] biomaRt_2.4.0 KEGGgraph_1.4.0 XML_3.2-0
[4] org.Hs.eg.db_2.4.1 RSQLite_0.9-4 DBI_0.2-5
[7] AnnotationDbi_1.10.2 Biobase_2.8.0 Rgraphviz_1.26.0
[10] graph_1.28.0 rj_0.5.0-5
loaded via a namespace (and not attached):
[1] RCurl_1.4-3 rJava_0.8-7 tools_2.11.1
--
_____
Dr Kristian Unger
Imperial College London
[[alternative HTML version deleted]]