egeulgen / pathfindR

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

Error in file(con, "w") : cannot open the connection #98

Closed evofish closed 2 years ago

evofish commented 3 years ago

Hello, I am now trying to run Pathfindr from a workstation, through bash:

$source /opt/asn/etc/asn-bash-profiles-special/modules.sh $module load anaconda/3-2019.07 $module load R/4.1.0 $module load java $R CMD BATCH pathfindr2021.r

Where the R command is

library(pathfindR) setwd('/home/aubmab/pathfindr') output_df <- run_pathfindR(RA_input, output_dir = "results/")

And I get the following error message:

Could not find any interactions for 5 (0.87%) genes in the PIN Final number of genes in input: 567

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

^M | ^M | | 0%^M | >$ Saving colored pathway diagrams of 10 KEGG pathways

^M | ^M | | 0%^M | >$ By default, the top 10 KEGG pathways are visualized Please use visualize_terms() if you'd like to plot all enriched pathways

Creating HTML report

processing file: results.Rmd ^M | ^M | | 0%^M | >$ inline R code fragments

^M | ^M |............................................... | 67% label: setup (with options) List of 1 $ include: logi FALSE

^M | ^M |......................................................................| 100% ordinary text without R code

Error in file(con, "w") : cannot open the connection Calls: run_pathfindR ... -> -> write_utf8 -> writeLines -> file In addition: Warning message: In file(con, "w") : cannot open file 'results.knit.md': Permission denied Execution halted

Any thoughts on what could be causing the error would be greatly appreciated. Thanks in advance!

egeulgen commented 3 years ago

Hey @evofish. This happens when you don’t have write permissions in the working directory, as pathfindR produces an html output. Try changing the permission settings or changing to a directory with write permissions. Hope this helps, -E

evofish commented 3 years ago

Thanks for your response!

Dane-Z commented 2 years ago

I am having this same issue when working on a server, but I have full permissions as an owner for all files and folders made.

egeulgen commented 2 years ago

@Dane-Z can you share the entire screen output to see where exactly the error occurs?

Dane-Z commented 2 years ago
image

@egeulgen

egeulgen commented 2 years ago

this does seem to be a write permission issue. Can you make sure that under the current working directory, you have write permission?

Dane-Z commented 2 years ago

drwxr-sr-x 3 33 Jun 8 14:17 pathfindR_enrichment_files

I've checked and I (owner, removed ID) have all necessary permissions and have the same permissions in the output directories.

egeulgen commented 2 years ago

I'm not sure why this should happen but will look into it. I'll update the package to make the HTML report optional soon and will mention this issue.

Meanwhile, feel free to execute what the wrapper function is doing manually following this vignette

Dane-Z commented 2 years ago

Thank you! I ran into another problem while manually performing those functions:

Error in title(...) :
R: unable to read font `helvetica' @ error/annotate.c/RenderFreetype/1474 Calls: pathfindR_enrichment ... -> plot -> plot.default -> localTitle -> title

I've been racking my brain(and the internet) over this problem and haven't found a solution. I have ImageMagick, ghostscript, and magick r pkg installed and I have helvetica listed as an available font in ImageMagick. Is this error possibly related to anything within the visualizations function that I might be able to fix or specify? I haven't found an option to specify a font for the visualizations.

Dane-Z commented 2 years ago

I believe this might be an issue with 'helvetica' being lowercase and imagemagick being case-sensitive when it searches but I don't see any specifications for 'helvetica' when looking through the visualization code in pathfindR

egeulgen commented 2 years ago

hey @Dane-Z,

for which function are you getting the error? I suspect the issue might be with ggplot2, maybe try updating that?

Dane-Z commented 2 years ago

I'm getting that when I run the visualize_terms() function. I'm running ggplot2 version 3.2.1, so I'll try updating and see if that works.

Dane-Z commented 2 years ago

Apologies, I was looking at the wrong version history for ggplot2, it's actually the latest version 3.3.6. @egeulgen

Dane-Z commented 2 years ago

I've fixed the bug by importing showtext and specifying 'helvetica' as a family then allowing showtext to automatically handle fonts using showtext_auto(). This was likely just an issue with 'helvetica' not being uppercase and the search in my font libraries by ImageMagick being case-sensitive. Thank you so much for the help and quick responses!!

egeulgen commented 1 year ago

Hello,

I just pushed a commit addressing this issue, making HTML reports optional. You may install the latest dev version via:

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

On Apr 19, 2023, at 10:33 PM, Nitin123-4 @.***> wrote:

I'm not sure why this should happen but will look into it. I'll update the package to make the HTML report optional soon and will mention this issue.

Meanwhile, feel free to execute what the wrapper function is doing manually following this vignette https://egeulgen.github.io/pathfindR/articles/manual_execution.html Is there any solution for it?

I am facing the same issue. if possible ca we avoid generating the report.html?

— Reply to this email directly, view it on GitHub https://github.com/egeulgen/pathfindR/issues/98#issuecomment-1515412955, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADCBH26PMSKLVPYHA5LN3ZTXCBK33ANCNFSM5CSJIJ5A. You are receiving this because you modified the open/close state.