egeulgen / pathfindR

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

Error in run_pathfindR command involving a term_visulisation not being found #90

Closed Tommy0398 closed 3 years ago

Tommy0398 commented 3 years ago

Describe the bug Hi, I am having an issue running the run_pathfindR command in your package where everytime I run the command on my data it has an error involving the term_visulisations not being connected to which results in the command stopping and no output being produced.

To Reproduce My input data is DE summary data from Seurat converted into the correct format and the gene sets and PIN files im using are the ones given in the vignette: https://cran.r-project.org/web/packages/pathfindR/vignettes/non_hs_analysis.html.

This is the run_pathfindR command I'm using

output_df <- run_pathfindR(input = input_df,
                                convert2alias = FALSE,
                                gene_sets = "Custom",
                                custom_genes = mmu_kegg_genes,
                                custom_descriptions = mmu_kegg_descriptions,
                                pin_name_path = "mmu_STRING",
                                plot_enrichment_chart = FALSE)

And this is the error it gives

There is already a directory named "pathfindR_Results".
Writing the result to "pathfindR_Results(3)" not to overwrite any previous results.
## Testing input
The input looks OK
## Processing input. Converting gene symbols,
          if necessary (and if human gene symbols provided)
Number of genes provided in input: 1582
Number of genes in input after p-value filtering: 1582
pathfindR cannot handle p values < 1e-13. These were changed to 1e-13
Could not find any interactions for 286 (18.08%) genes in the PIN
Final number of genes in input: 1296
## Performing Active Subnetwork Search and Enrichment
## Processing the enrichment results over all iterations
## Annotating involved genes and visualizing enriched terms
Error in file(con, "wb") : cannot open the connectionhway in cancer                                                                                                                                                                                                          
In addition: Warning message:
In file(con, "wb") :
  cannot open file 'term_visualizations/PD-L1_expression_and_PD-1_checkpoint_pathway_in_ca.png': No such file or directory

Desktop (please complete the following information):

R Session Information:

R version 4.0.3 (2020-10-10)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 8.1 x64 (build 9600)

Matrix products: default

locale:
[1] LC_COLLATE=English_United Kingdom.1252  LC_CTYPE=English_United Kingdom.1252   
[3] LC_MONETARY=English_United Kingdom.1252 LC_NUMERIC=C                           
[5] LC_TIME=English_United Kingdom.1252    

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

other attached packages:
[1] pathfindR_1.6.1.9009 pathfindR.data_1.1.1

loaded via a namespace (and not attached):
 [1] viridis_0.6.1       httr_1.4.2          msigdbr_7.4.1       pkgload_1.2.1       tidyr_1.1.3        
 [6] tidygraph_1.2.0     viridisLite_0.4.0   foreach_1.5.1       ggraph_2.0.5        assertthat_0.2.1   
[11] stats4_4.0.3        yaml_2.2.1          remotes_2.4.0       ggrepel_0.9.1       sessioninfo_1.1.1  
[16] pillar_1.6.1        glue_1.4.2          digest_0.6.27       XVector_0.30.0      polyclip_1.10-0    
[21] colorspace_2.0-1    htmltools_0.5.1.1   pkgconfig_2.0.3     devtools_2.4.2      babelgene_21.4     
[26] magick_2.7.2        zlibbioc_1.36.0     purrr_0.3.4         scales_1.1.1        processx_3.5.2     
[31] tweenr_1.0.2        ggforce_0.3.3       tibble_3.1.2        KEGGREST_1.30.1     generics_0.1.0     
[36] farver_2.1.0        IRanges_2.24.1      ggplot2_3.3.3       usethis_2.0.1       ellipsis_0.3.2     
[41] cachem_1.0.5        withr_2.4.2         BiocGenerics_0.36.1 cli_2.5.0           magrittr_2.0.1     
[46] crayon_1.4.1        memoise_2.0.0       evaluate_0.14       ps_1.6.0            fs_1.5.0           
[51] fansi_0.5.0         doParallel_1.0.16   MASS_7.3-53         pkgbuild_1.2.0      tools_4.0.3        
[56] prettyunits_1.1.1   lifecycle_1.0.0     S4Vectors_0.28.1    munsell_0.5.0       callr_3.7.0        
[61] Biostrings_2.58.0   compiler_4.0.3      rlang_0.4.10        grid_4.0.3          iterators_1.0.13   
[66] rstudioapi_0.13     igraph_1.2.6        rmarkdown_2.8       testthat_3.0.2      gtable_0.3.0       
[71] codetools_0.2-16    DBI_1.1.1           curl_4.3.1          graphlayouts_0.7.1  R6_2.5.0           
[76] gridExtra_2.3       knitr_1.33          dplyr_1.0.6         fastmap_1.1.0       utf8_1.2.1         
[81] rprojroot_2.0.2     desc_1.3.0          parallel_4.0.3      Rcpp_1.0.6          vctrs_0.3.8        
[86] png_0.1-7           tidyselect_1.1.1    xfun_0.21          

Additional context I have also tried using different databases but they also give a similar error and occasionally I get this error: Error in { : task 1 failed - "cannot open the connection" That occurs when using the exact same code as before just with R restarted or the objects cleared, I'm not sure what decides when that error occurs.

Tommy0398 commented 3 years ago

It seems like it was related to https://github.com/egeulgen/pathfindR/issues/58 , the directory I was using was within a lot of subdirectories which I guess causes problems somehow. Performing the analysis in a folder closer to the root fixed this for some reason.

egeulgen commented 3 years ago

Hey @BiostormSilver, sorry I couldn’t reply earlier. Glad you resolved the issue. best, -E