egeulgen / pathfindR

pathfindR: Enrichment Analysis Utilizing Active Subnetworks
https://egeulgen.github.io/pathfindR/
Other
178 stars 25 forks source link

Error with connect #19

Closed YunielFM closed 5 years ago

YunielFM commented 5 years ago

Describe the bug Hi, I made fresh installations of R and RStudio in a new Asus laptop. Suddenly my code stop throwing the following consistent error when using pathfindR: "Error in { : task 1 failed - "cannot open the connection"

To Reproduce Steps to reproduce the behavior:

read the data containig UP and Downregulated genes

UP<-read_xlsx(path = "UPregulated.xlsx",sheet =2, col_names = T,guess_max = 50000, na = "") DOWN<-read_xlsx(path = "Downregulated.xlsx",sheet =2, col_names = T,guess_max = 50000, na = "")

mix the data, remove unnecesary columns

a<-UP%>% dplyr::select(c(2,18,19))%>%as.data.frame() DOWN %>% dplyr::select(c(2,18,19)) %>% as.data.frame() %>% rbind(a)->RA_input

Check everything is OK

head(RA_input) ID FC padj 1 LEP -1.840518 4.334716e-02 2 RNU6-353P -1.847680 2.440267e-02 3 NA -1.935300 4.421831e-02 4 BMS1P16 -1.659052 6.014805e-02 5 MIR4725 -1.593266 7.493923e-02 6 CFH 2.272345 6.610474e-05

run

RA_output <- run_pathfindR(RA_input)

this results in the following error

Testing input

The input looks OK

Processing input. Converting gene symbols, if necessary (and if human gene symbols provied)

Could not find any interactions for 275 (33.62%) genes in the PIN

Performing Active Subnetwork Search and Enrichment

Error in { : task 1 failed - "cannot open the connection" In addition: Warning messages: 1: In run_pathfindR(RA_input) : There already is a directory named "pathfindR_Results". Writing the result to "pathfindR_Results(1)" not to overwrite the previous results. 2: In pathfindR::input_processing(input, p_val_threshold, pin_path, : Duplicated genes found! Choosing the lowest p value for each gene

Desktop (please complete the following information):

R Session Information: R version 3.6.0 (2019-04-26) Platform: x86_64-w64-mingw32/x64 (64-bit) Running under: Windows 10 x64 (build 17134)

Matrix products: default

locale: [1] LC_COLLATE=English_Switzerland.1252 LC_CTYPE=English_Switzerland.1252 LC_MONETARY=English_Switzerland.1252 [4] LC_NUMERIC=C LC_TIME=English_Switzerland.1252

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

other attached packages: [1] pathfindR_1.3.1.9002 pathview_1.24.0 org.Hs.eg.db_3.8.2 AnnotationDbi_1.46.0 IRanges_2.18.0
[6] S4Vectors_0.22.0 Biobase_2.44.0 BiocGenerics_0.30.0 knitr_1.23 reshape2_1.4.3
[11] readxl_1.3.1 tidyselect_0.2.5 forcats_0.4.0 stringr_1.4.0 dplyr_0.8.1
[16] purrr_0.3.2 readr_1.3.1 tidyr_0.8.3 tibble_2.1.1 ggplot2_3.1.1
[21] tidyverse_1.2.1

loaded via a namespace (and not attached): [1] nlme_3.1-139 bitops_1.0-6 lubridate_1.7.4 bit64_0.9-7 doParallel_1.0.14 httr_1.4.0
[7] Rgraphviz_2.28.0 tools_3.6.0 backports_1.1.4 R6_2.4.0 DBI_1.0.0 lazyeval_0.2.2
[13] colorspace_1.4-1 withr_2.1.2 gridExtra_2.3 bit_1.1-14 compiler_3.6.0 graph_1.62.0
[19] cli_1.1.0 rvest_0.3.4 xml2_1.2.0 KEGGgraph_1.44.0 scales_1.0.0 digest_0.6.19
[25] rmarkdown_1.13 XVector_0.24.0 htmltools_0.3.6 pkgconfig_2.0.2 rlang_0.3.4 rstudioapi_0.10
[31] RSQLite_2.1.1 generics_0.0.2 farver_1.1.0 jsonlite_1.6 RCurl_1.95-4.12 magrittr_1.5
[37] Rcpp_1.0.1 munsell_0.5.0 viridis_0.5.1 stringi_1.4.3 ggraph_1.0.2 MASS_7.3-51.4
[43] zlibbioc_1.30.0 plyr_1.8.4 grid_3.6.0 blob_1.1.1 ggrepel_0.8.1 crayon_1.3.4
[49] lattice_0.20-38 Biostrings_2.52.0 haven_2.1.0 hms_0.4.2 KEGGREST_1.24.0 pillar_1.4.1
[55] igraph_1.2.4.1 codetools_0.2-16 XML_3.98-1.19 glue_1.3.1 evaluate_0.14 modelr_0.1.4
[61] png_0.1-7 tweenr_1.0.1 foreach_1.4.4 cellranger_1.1.0 gtable_0.3.0 polyclip_1.10-0
[67] assertthat_0.2.1 xfun_0.7 ggforce_0.2.2 broom_0.5.2 viridisLite_0.3.0 iterators_1.0.10 [73] memoise_1.1.0

egeulgen commented 5 years ago

hey @YunielFM,

do you mind running the steps of the wrapper manually (see commands below) so that we can determine where the error actually occurs? This will run active subnetwork search and enrichment steps once. This error occurs when the connection to an R session (created for parallel iterations) fails because an error occurred in that session. Since the parallel iterations consists only of the above mentioned steps, the below script should give a more informative error message.

library(pathfindR)

pin_path <- return_pin_path(pin_name_path = "Biogrid")
processed_data <- input_processing(input = RA_input, 
                                 p_val_threshold = 0.05,
                                 pin_path = pin_path,
                                 human_genes = TRUE)

###### Active Subnetwork Search - !!! This is most likely where the error occurs!!!
## This will search for active subnetworks, return them as a list and write them under active_snw_search in the current working directory
active_snws <- active_snw_search(processed_data, pin_path, snws_file = "subnetworks", search_method = "GR")

###### Enrichment analysis 
enrichment_res <- enrichment_analyses(active_snws, gene_sets = "KEGG",
                                      pin_path = pin_path,
                                      input_genes = processed_data$GENE,
                                      list_active_snw_genes = TRUE)
YunielFM commented 5 years ago

Hi @egeulgen just run the "unwrapped" version of the code and indeed the error repeats after running the subnetwork search part...Luckily, now I can see the error: "Error: opening registry key 'Software\JavaSoft\Java Runtime Environment' Error: could not find java.dll Error: Could not find Java SE Runtime Environment. Error in file(con, "r") : cannot open the connection"

Stupid me, in this new computer I forgot to install JRE...did it and everything is solved! Thanks a lot for your help, and congrats for such a nice contribution to the community.