library(clusterProfiler) cnetplot(fixed = F): why can´t I get the color legend?
2
0
Entering edit mode
@cristina-della-beffa-3231
Last seen 7.1 years ago
Germany

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

 

clusterprofiler tkplot • 2.2k views
ADD COMMENT
0
Entering edit mode
Guangchuang Yu ★ 1.2k
@guangchuang-yu-5419
Last seen 2 minutes ago
China/Guangzhou/Southern Medical Univer…

Using points() and text() will not adding legend to tkplot(). I don't know how to add legend on a tkplot(), this is why cnetplot(fixed=FALSE) doesn't contain legend.

 

 

ADD COMMENT
0
Entering edit mode
@cristina-della-beffa-3231
Last seen 7.1 years ago
Germany

Hi,

the problem is that plot.igraph() in cnetplot(fixed = TRUE) is suitable only for small networks. It is not usable with bigger networks,

which are initially unreadable (with any kind of layout) and one can only separate the branches manually, with the interactive plot.

Thank you for your fast answer.

 

Best regards,

Cristina

 

 

ADD COMMENT

Login before adding your answer.

Traffic: 978 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6