bootf2BCA - Folder does not exist? - Windows only (solved) [Software]

posted by yjlee168 Homepage – Kaohsiung, Taiwan, 2023-12-20 08:01 (122 d 04:09 ago) – Posting: # 23797
Views: 587

(edited by on 2023-12-20 15:56)

Dear all,

I have found a way to assess the data file for bootf2BCA v1.3.2 from its shiny UI. First, the command volumes=getVolumes() (line#15 in server.R) from package shinyFiles is OS specific and looks for volumes/drives in different places depending on the system on which shiny is running. It is very correct when it is running under Linux (Debian/Ubuntu). I mean when I click the Browse... button it shows the exact folder with all files. I guess it should be no problem too under macOS. However, When running under Windows, it shows different features. getVolume is very flexible. it searches all drives existing in your system, including all usb drives (really amazing). The following picture shows the error at the left-bottom corner - "Folder does not exist" only in Windows. I will explain this later. Using getVolume from package shinyFiles allows users to access the data files from any drive. The following picture shows that users should click the dropdown menu and select 'o(F:)' (my case only; all drives with leading 'o' should work, such as 'o(E)' or 'o(C)'), not the above one (a small folder icon + F:). Then it will show you all F drive contents. Several clicks to go to find the data files. I set the working directory with setwd("F:/bootf2BCA_v1.3.2/GUI"). Then the error message occurred ("Folder does not exist"). That was because the app went to search the folder of "F:/F:/bootf2BCA_v1.3.2/GUI". Of course, no such a folder exists. To prove this, I fixed the line#19 (in server.R) my_current_dir<- getwd() with my_current_dir<- "/bootf2BCA_v1.3.2/GUI". Then it works perfectly, just like in Linux. No need to click, click, and click anymore.


Other issues:
  1. not working? Ans: the working directory should be specified first. Since it's a Linux bash command file, we should add this line in the R script of run_shiny.R to specify the working directory fisrt, such as    
    setwd("~/bootf2BCA_v1.3.2/GUI")  ### yours may be different.

    If running under R console or RStudio, setwd() can be run separately before running run_shiny.R. In this case, we don't need to modify run_GUI.R.
  2. specifying output (result) file issue? Ans: The original UI (since v1.3?) cannot allow users to specify a new report file name, but only to select from the dropdown menu just like data files selection. The only way is to create a dummy txt file in advance first outside the app . This can be fixed using textInput() from shiny package directly with the default - "report.txt". I examined the code of ui.R and found the developer mark out textInput() line. textInput() allows users to type in or specify the file name manually. This is very convenient for a new project. If not specified, the default file name - report.txt will be used.
  3. I found the output file, report.txt, containing lots of information that we may not need to know. This information however may be very important for the developer, such as stats of each bootstrapping run, and the list of R packages installed. If we cut these outputs out of report.txt (in F2_boot.R). It can fasten the running speed significantly, especially when the # of bootstrapping >10,000 (just for fun; no need to do so; default was 1,000).
  4. to stop running (or listening) the app after finishing - Under Windows, the 'Esc' key should work when running under either R console or RStudio; For Linux, it requires 'Ctrl+C' with the terminal mode; the 'Esc' key should work under RStudio.
  5. to localize the app with different languages other than English (why not? It's a web-based UI app after all.): You need to modify two files - ui.R & server.R. With ui.R, find all strong(...) content, and replace the language you like; And server.R, you only need to modify x- & y-axis labelings & the legends. Also, there was labeling content of a small progressing bar. The progressing bar comes & goes very fast if the # bootstrapping is not enough large. You almost see it there unless the # of bootstrapping is set to 10,000 or more. Modification should be only for your own (personal) use; otherwise, you need the developer's permission first.
That's it.


All the best,
-- Yung-jin Lee
bear v2.9.1:- created by Hsin-ya Lee & Yung-jin Lee
Kaohsiung, Taiwan
Download link (updated) -> here

Complete thread:

UA Flag
 Admin contact
22,988 posts in 4,825 threads, 1,657 registered users;
99 visitors (0 registered, 99 guests [including 7 identified bots]).
Forum time: 13:11 CEST (Europe/Vienna)

The whole purpose of education is
to turn mirrors into windows.    Sydney J. Harris

The Bioequivalence and Bioavailability Forum is hosted by
BEBAC Ing. Helmut Schütz