egeulgen / pathfindR

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

Issue with download.file, cannot open URL #35

Closed hanyin88 closed 4 years ago

hanyin88 commented 4 years ago

Hello sir,

Thank you so much for the wonderful work in make the package. I found it tremendously helpful.

I run into this issue when trying pathfindR() with test data RA_Input. Here's what it says:

Final number of genes in input: 561 Performing Active Subnetwork Search and Enrichment Processing the enrichment results over all iterations Annotating involved genes and visualizing enriched terms Downloading pathway diagrams of 10 KEGG pathways | 0% Error in download.file(url, t, quiet = TRUE) : cannot open URL 'https://www.kegg.jp/kegg-bin/show_pathway?hsa03040/hsa%3a9879%09white,black/hsa%3a7919%09white,black/hsa%3a6625%09white,black/hsa%3a6626%09white,black/hsa%3a6631%09white,black/hsa%3a8449%09white,black/hsa%3a9785%09white,black/hsa%3a51362%09white,black/hsa%3a58517%09white,black/hsa%3a1659%09white,black/hsa%3a1665%09white,black/hsa%3a1655%09white,black/hsa%3a10915%09white,black/hsa%3a6627%09white,black/hsa%3a6629%09white,black/hsa%3a22827%09%2300FF00,black/hsa%3a10285%09white,black/hsa%3a84991%09white,black/hsa%3a10523%09white,black/hsa%3a23350%09white,black/hsa%3a27339%09white,black/hsa%3a988%09white,black/hsa%3a10286%09white,black/hsa%3a5356%09white,black/hsa%3a51503%09white,black/hsa%3a56259%09white,black/hsa%3a10084%09white,black/hsa%3a51729%09white,black/hsa%3a22938%09white,black/hsa%3a51645%09white,black/hsa%3a10450%09white,black/hsa%3a151903%09white,black/hsa%3a55696%09white,black/hsa%3a9716%09white,black/hsa%3a26121%09white,black/hsa%3a10465%09white,bla

I use Windows. My R version is 3.6.2. I have been looking things up and have added Kegg to the trusted site in IE as people suggested without help. I did use my institution laptop/laptop.

Many thanks for the kind help!

egeulgen commented 4 years ago

Hello @hanyin88,

Downloading the latest development version should fix this issue:

install.packages("pak") # if you have not installed "pak"
pak::pkg_install("egeulgen/pathfindR")

Hope this helps

hanyin88 commented 4 years ago

Thank you so much for the rapid reply! I just did that, now now have a new error message using same test data set:

Downloading pathway diagrams of 10 KEGG pathways

|===============================================| 100% Saving colored pathway diagrams of 10 KEGG pathways

| | 0%Error in magick_image_readpath(enc2native(path), density, depth, strip) : rsession.exe: ImproperImageHeader `C:\Users\M123753\AppData\Local\Temp\Rtmpg3QTK3\hsa03040_pathfindR.png' @ error/png.c/ReadPNGImage/4050

Deeply appreciate further guidance!

egeulgen commented 4 years ago

This seems to be an issue with the package magick. can you make sure you have the latest version of magick by downloading via:

install.packages("magick")
hanyin88 commented 4 years ago
```r
install.packages("magick")

Thank you for the kind reply. I just did that, but unfortunately the same error message remains. I am wondering if this could be related to my Wget configuration under windows, as I tried a few approaches to get it work. This is the way I installed my Wget (https://builtvisible.com/download-your-website-with-wget/).

Thank you so much for the wonderful help.

egeulgen commented 4 years ago

I don't think the wget installation could be the issue because you would get an error reflecting that. Nevertheless, after getting the error, could you check whether the download worked (in the same session)? For the error above, the check would be:

file.exists("C:\Users\M123753\AppData\Local\Temp\Rtmpg3QTK3\hsa03040_pathfindR.png")
egeulgen commented 4 years ago

Btw, if visualization is not necessary, set visualize_enriched_terms=FALSE in run_pathfindR() and you could also visualize the enriched terms later via visualize_terms()

hanyin88 commented 4 years ago

Btw, if visualization is not necessary, set visualize_enriched_terms=FALSE in run_pathfindR() and you could also visualize the enriched terms later via visualize_terms()

Thank you so much. It seems the file was downloaded. I tried the data on a MAC and everything works OK, so not sure if it's a window thing. Thanks for the kind help.

egeulgen commented 4 years ago

glad it worked out. closing the issue for now