egeulgen / pathfindR

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

The active subnetwork file does not exist! Check the `active_snw_path` argument" #73

Closed wrightalecm closed 3 years ago

wrightalecm commented 3 years ago

Hello, I saw someone else had this error and I followed along your suggestions but unfortunately I still am having the same issue.

To Reproduce Steps to reproduce the behavior:

  1. Data is formatted as described in the vignette (see image). pathfindR

2a. Run the following function: library(pathfindR) output_df <- run_pathfindR(RA_input)

3a. There is already a directory named "pathfindR_Results". Writing the result to "pathfindR_Results(2)" 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: 572 Number of genes in input after p-value filtering: 572 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

Error in { : task 1 failed - "The active subnetwork file does not exist! Check the active_snw_path argument"

I then tried manually as you suggested in troubleshooting: 2b. processed_data <- input_processing(input = RA_input, p_val_threshold = 0.05, pin_name_path = "Biogrid", convert2alias = TRUE)

active_snws <- active_snw_search(processed_data, pin_path, snws_file = "subnetworks", search_method = "GR")

3b. Error in pin_name_path %in% valid_opts[-length(valid_opts)] : object 'pin_path' not found

I checked to make sure I have writing privileges as you suggested: file.access(".", 2) Output: 0

There is a directory created called "active_snw_searches", however there is no directories "input_for_search.txt' or "subnetworks.txt"

Expected behavior Output of run_pathfindR

Desktop (please complete the following information):

R Session Information: R version 4.0.4 (2021-02-15) Platform: x86_64-w64-mingw32/x64 (64-bit) Running under: Windows 10 x64 (build 19042)

Matrix products: default

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

Additional context I did initially have some issue with loading the library as I was getting an error that I didn't have Java installed even after I had just installed it. I was able to solve this issue by using:

Sys.setenv('JAVA_HOME'="C:/Program Files/Java/jre1.8.0_281/")

system("java -version") [1] 127

Thank you for any help and please let me know if you need any more information! Alec

egeulgen commented 3 years ago

hey @wrightalecm,

You have to supply a valid pin name (or path) to active_snw_search() (see [here]:(https://egeulgen.github.io/pathfindR/articles/manual_execution.html))

active_snws <- active_snw_search(input_for_search = RA_processed, 
                                   pin_name_path = "Biogrid",
                                   snws_file = "subnetworks", 
                                   search_method = "GR")

Let me know if you get an error with this calll.

If still getting an error, please make sure that the library is loading properly (i.e., finding the Java installation) and please share the output of sessionInfo() after loading the library

wrightalecm commented 3 years ago

Yes, this appeared to do the trick! I really appreciate you taking the time to answer. Feel free to close this thread.

Thank you, Alec

neha163 commented 3 years ago

Hello @egeulgen , I have a similar issue while running the package. I have the java installed already and Rv4.0.5. I executed run_pathfind(RA_input) and manually using

active_snws <- active_snw_search(input_for_search = RA_processed, 
                                   pin_name_path = "Biogrid", 
                                   snws_file = "active_snws",
                                   score_quan_thr = 0.8, 
                                   sig_gene_thr = 0.02, 
                                   search_method = "GR")

I can see a directory created active_snw_search with input_for_search.txt in it. The error message says : Error in pathfindR::filterActiveSnws(active_snw_path = snws_file, sig_genes_vec = input_for_search$GENE, : The active subnetwork file does not exist! Check the active_snw_path argument In addition: Warning message: In file.rename(from = "resultActiveSubnetworkSearch.txt", to = snws_file) : cannot rename file 'resultActiveSubnetworkSearch.txt' to 'active_snw_search/active_snws.txt', reason 'The system cannot find the file specified'

file.access(".") gives 0.

Could you please help me resolve this issue so that I can proceed with the analysis.

Thank you Neha

egeulgen commented 3 years ago

hey @neha163, it seems that the active subnetwork search results are not written to "resultActiveSubnetworkSearch.txt". do you mind running file.access(".", mode = 2)? This will test for write permission.

neha163 commented 3 years ago

Hello @egeulgen , The file.access(".", mode = 2) says 0.

egeulgen commented 3 years ago

hello again @neha163,

This might be an issue with R not being able to find your java installation. Running the command below (from the terminal) might resolve the issue.

R CMD javareconf

if you're comfortable with debugging, running debugonce(active_snw_search) and running your code again should help pinpoint where the issue lies.

neha163 commented 3 years ago

Hello @egeulgen, Running R CMD javareconf on terminal shoots an error of R CMD javareconf. I am not familar with the debugonce(active_snw_search). I takes me to the function internal codes which I am not confident to making edits. Is there any other solution to resolve the issue?

egeulgen commented 3 years ago

what error do you get running R CMD javareconf on the terminal?

You do not have to make edits when debugging, just run line by line and see for which command you get an error. Unfortunately, there is no other way, as this seems to be an issue related to java configuration on your computer.

neha163 commented 3 years ago

Hello @egeulgen , I am sorry for the prior typo. It gives error- 'javareconf' is not recognized as an internal or external command, operable program or batch file. Also I will check with my java configuration. Thank You for your help. Best Neha

TimbusCalin commented 2 years ago

Indeed, installing the Java Environment (even Java 18 SDK, latest at the time of writing this comment, seems to have solved the issue).