Hi,
I´m trying to get the colors legend for a network made with cnetplot(fixed = F), internally calling tkplot(), to make an interactive plot.
I tried to modify netplot(), called by cnetplot_internal(), called by cnetplot(),
adding, after tkplot(), the same lines which follow plot.igraph() - for which I get the color legend instead! -inside netplot():
if (!is.null(foldChanges_old)) {
fc <- foldChanges_old
lbs <- hist(fc, breaks = col.bin - 1, plot = FALSE)$breaks
col.legend <- get.col.scale(lbs)
x <- seq(from = legend.x, by = 0.03, length.out = col.bin)
y <- rep(legend.y, col.bin)
points(x, y, pch = 15, col = col.legend, cex = 2)
idx <- c(1, seq(4, col.bin - 1, by = 3), col.bin)
text(x = x[idx], y = rep(legend.y - 0.05, length(idx)),
label = lbs[idx], cex = 0.8)
text(x = mean(x), y = legend.y + 0.05, labels = "Fold Change",
cex = 0.8, font = 2)
}
and relative sub-functions called within netplot(), but I get the following error:
"Error in cnetplot_internal_modified(inputList = gc, showCategory = showCategory, :
could not find function "list2graph"."
What does it mean?
list2graph() is there because I require library(DOSE).
Is there an easier way to get the color legend inside the interactive plot?
Thank you.
Best regards,
Cristina Della Beffa
> sessionInfo()
R version 3.2.0 (2015-04-16)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 7 x64 (build 7601) Service Pack 1
locale:
[1] LC_COLLATE=German_Germany.1252 LC_CTYPE=German_Germany.1252 LC_MONETARY=German_Germany.1252 LC_NUMERIC=C LC_TIME=German_Germany.1252
attached base packages:
[1] parallel stats4 stats graphics grDevices utils datasets methods base
other attached packages:
[1] scales_0.3.0 DOSE_2.6.6 igraph_1.0.1 pathview_1.8.0 org.Hs.eg.db_3.1.2 AnnotationDbi_1.30.1 GenomeInfoDb_1.4.3
[8] IRanges_2.4.0 S4Vectors_0.8.0 Biobase_2.28.0 BiocGenerics_0.16.0 KEGGgraph_1.26.0 graph_1.46.0 XML_3.98-1.3
[15] clusterProfiler_2.2.7 RSQLite_1.0.0 DBI_0.3.1 calibrate_1.7.2 MASS_7.3-44 openxlsx_3.0.0
loaded via a namespace (and not attached):
[1] Rcpp_0.12.1 plyr_1.8.3 XVector_0.10.0 zlibbioc_1.14.0 tools_3.2.0 digest_0.6.8 gtable_0.1.2 png_0.1-7 Rgraphviz_2.12.0
[10] curl_0.9.3 proto_0.3-10 stringr_1.0.0 httr_1.0.0 Biostrings_2.38.0 grid_3.2.0 qvalue_2.0.0 R6_2.1.1 GOSemSim_1.26.0
[19] GO.db_3.1.2 ggplot2_1.0.1 reshape2_1.4.1 DO.db_2.9 magrittr_1.5 splines_3.2.0 KEGGREST_1.8.1 colorspace_1.2-6 stringi_0.5-5
[28] munsell_0.4.2