IOR-Bioinformatics / PCSF

MIT License
13 stars 11 forks source link

Plotting to file does not work #1

Closed marvas74 closed 7 years ago

marvas74 commented 7 years ago

A cool library! Thanks, unfortunately the plotting to file which I would need in order to share the results with other does not work in my hands:

library(PCSF) Loading required package: igraph Attaching package: ‘igraph’ The following objects are masked from ‘package:stats’: decompose, spectrum The following object is masked from ‘package:base’: union Loading required package: visNetwork data("STRING"); ppi <- construct_interactome(STRING); data("Tgfb_phospho"); terminals <- Tgfb_phospho subnet <- PCSF(ppi, terminals, w = 2, b = 1, mu = 0.0005) 89.66% of your terminal nodes are included in the interactome Solving the PCSF... plot(subnet)

This plot comes out fine

pdf("x.pdf") plot(subnet,style=0) dev.off() null device 1

But this does not

I get a PDF file with some content, but which cannot be shown.

Changing the plotting device to something else does not seem to help.

Playing with the 'style' parameter does not help.

igraph plotting in it self works fine:

g <- make_ring(10) pdf("x.pdf") plot(g) dev.off() null device 1

Please help! Best, Mikko

sessionInfo() R version 3.4.0 (2017-04-21) Platform: x86_64-pc-linux-gnu (64-bit) Running under: Ubuntu 16.04.3 LTS

Matrix products: default BLAS: /usr/lib/atlas-base/atlas/libblas.so.3.0 LAPACK: /usr/lib/atlas-base/atlas/liblapack.so.3.0

locale: [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C LC_TIME=fi_FI.UTF-8 LC_COLLATE=en_US.UTF-8
[5] LC_MONETARY=fi_FI.UTF-8 LC_MESSAGES=en_US.UTF-8 LC_PAPER=fi_FI.UTF-8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C LC_MEASUREMENT=fi_FI.UTF-8 LC_IDENTIFICATION=C

attached base packages: [1] stats graphics grDevices utils datasets methods base

other attached packages: [1] PCSF_0.99.0 visNetwork_2.0.1 igraph_1.1.2

loaded via a namespace (and not attached): [1] graph_1.54.0 Rcpp_0.12.12 AnnotationDbi_1.38.2 magrittr_1.5 IRanges_2.10.2
[6] BiocGenerics_0.22.0 bit_1.1-12 lattice_0.20-35 R6_2.2.2 rlang_0.1.2
[11] BH_1.62.0-1 org.Hs.eg.db_3.4.1 blob_1.1.0 httr_1.2.1 tools_3.4.0
[16] grid_3.4.0 parallel_3.4.0 Biobase_2.36.2 DBI_0.7 matrixStats_0.52.2
[21] htmltools_0.3.6 yaml_2.1.14 bit64_0.9-7 digest_0.6.12 tibble_1.3.3
[26] S4Vectors_0.14.3 htmlwidgets_0.9 memoise_1.1.0 RSQLite_2.0 GO.db_3.4.1
[31] compiler_3.4.0 stats4_3.4.0 SparseM_1.77 jsonlite_1.5 topGO_2.28.0
[36] pkgconfig_2.0.1

murodzhon commented 7 years ago

Dear Mikko,

Thanks for pointing out an issue regarding a figure plotting. Since the package provides an interactive figure, it is not possible to plot a static figure directly in pdf format with the current version. However, you can export or save your figures in html as follows and print as pdf in the browser later on:

library(htmlwidgets)
saveWidget(plot(subnet), file="subnet_plot.html")