Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Report generation - Windows #9

Open
DarrenLCY opened this issue Dec 1, 2021 · 10 comments
Open

Report generation - Windows #9

DarrenLCY opened this issue Dec 1, 2021 · 10 comments

Comments

@DarrenLCY
Copy link

Hello,

I'm having problems to generate reports. The error message that I'm getting is this:

-- Sending report to C:\Users\Owner\AppData\Local\Temp\RtmpsFfPir --
-- Removing C:\Users\Owner\AppData\Local\Temp\RtmpsFfPir/me_report.Rmd--
-- entering my report generator --
-- creating header --
-- setting toc ----- data processing ----- header created! --
-- build intro text --
-- merged code --
gen report try value: try-error

Here are the results from sessionInfo():

sessionInfo()
R version 4.0.2 (2020-06-22)
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 LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C LC_TIME=English_United States.1252

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

other attached packages:
[1] DESeq2_1.30.1 SummarizedExperiment_1.20.0 MatrixGenerics_1.2.1 matrixStats_0.61.0
[5] GenomicRanges_1.42.0 GenomeInfoDb_1.26.7 IRanges_2.24.1 S4Vectors_0.28.1
[9] shinyWidgets_0.6.2 shinycssloaders_1.0.0 shinydashboard_0.7.2 shinyjs_2.0.0
[13] rmarkdown_2.11 knitr_1.36 microbiomeExplorer_1.1.2 metagenomeSeq_1.32.0
[17] RColorBrewer_1.1-2 glmnet_4.1-3 Matrix_1.2-18 limma_3.46.0
[21] Biobase_2.50.0 BiocGenerics_0.36.1 magrittr_2.0.1 shiny_1.7.1

loaded via a namespace (and not attached):
[1] minqa_1.2.4 colorspace_2.0-2 glmmADMB_0.8.3.3 ellipsis_0.3.2 markdown_1.1
[6] XVector_0.30.0 rstudioapi_0.13 DT_0.19 bit64_4.0.5 lubridate_1.8.0
[11] AnnotationDbi_1.52.0 fansi_0.5.0 codetools_0.2-16 splines_4.0.2 cachem_1.0.6
[16] geneplotter_1.68.0 jsonlite_1.7.2 nloptr_1.2.2.2 broom_0.7.10 annotate_1.68.0
[21] readr_2.0.2 compiler_4.0.2 httr_1.4.2 backports_1.3.0 lazyeval_0.2.2
[26] assertthat_0.2.1 fastmap_1.1.0 later_1.3.0 htmltools_0.5.2 tools_4.0.2
[31] lmerTest_3.1-3 coda_0.19-4 gtable_0.3.0 glue_1.4.2 GenomeInfoDbData_1.2.4
[36] dplyr_1.0.7 Rcpp_1.0.7 jquerylib_0.1.4 vctrs_0.3.8 nlme_3.1-148
[41] crosstalk_1.2.0 iterators_1.0.13 xfun_0.26 stringr_1.4.0 lme4_1.1-27.1
[46] mime_0.12 lifecycle_1.0.1 gtools_3.9.2 XML_3.99-0.8 zlibbioc_1.36.0
[51] MASS_7.3-51.6 scales_1.1.1 hms_1.1.1 promises_1.2.0.1 yaml_2.2.1
[56] memoise_2.0.0 ggplot2_3.3.5 sass_0.4.0 stringi_1.7.5 RSQLite_2.2.8
[61] genefilter_1.72.1 foreach_1.5.1 caTools_1.18.2 boot_1.3-25 BiocParallel_1.24.1
[66] shape_1.4.6 R2admb_0.7.16.2 rlang_0.4.11 pkgconfig_2.0.3 bitops_1.0-7
[71] Wrench_1.8.0 fontawesome_0.2.2 evaluate_0.14 lattice_0.20-41 purrr_0.3.4
[76] htmlwidgets_1.5.4 bit_4.0.4 tidyselect_1.1.1 plyr_1.8.6 R6_2.5.1
[81] gplots_3.1.1 generics_0.1.1 DelayedArray_0.16.3 DBI_1.1.1 pillar_1.6.4
[86] withr_2.4.2 survival_3.2-13 RCurl_1.98-1.5 tibble_3.1.5 crayon_1.4.2
[91] KernSmooth_2.23-17 utf8_1.2.2 plotly_4.10.0 tzdb_0.1.2 locfit_1.5-9.4
[96] grid_4.0.2 data.table_1.14.2 blob_1.2.2 forcats_0.5.1 digest_0.6.28
[101] xtable_1.8-4 tidyr_1.1.4 httpuv_1.6.3 numDeriv_2016.8-1.1 munsell_0.5.0
[106] viridisLite_0.4.0 bslib_0.3.1

I have already tried things suggested in the link below, but they don't work. I'm thinking maybe because the solutions that were proposed are for Mac and I'm using Windows?

#3

Things I've tried so far:

  1. Install and load knitr and rmarkdown packages before running microbiomeExplorer.
  2. Install phantomjs using webshot::install_phantomjs()
  3. Install pandoc using installr::install.pandoc()

Any help would be greatly appreciated!
Thanks so much for your time,
Darren

@zoecastillo
Copy link
Owner

Hi Darren,

Yes, it might be related to the Windows environment.

I can usually go to the folder listed in the R console where the tmp file is stored
(Sending report to C:\Users\Owner\AppData\Local\Temp\RtmpsFfPir)

I use Rstudio and can usually open the directory directly within Rstudio (via the File Open dialogue) and see what is in that folder. Are you able to do this from Windows?
It would be helpful to understand which step is failing.

I don't have a windows computer available myself to test this unfortunately.

Does this happen regardless of what has been added to the report?

Best,

Janina

@DarrenLCY
Copy link
Author

Hi Janina,

Thanks for the prompt response!

The step where it's failing is immediately after I click on "GENERATE" (you can see the error in the bottom right corner of the picture below).

image

I do see the folder that you're talking about, but sadly no report there:

image

I checked all the folders, which only contain .rds files and .png files.

And yes, it seems to happen regardless of what I include in the report.

Thank you very much,
Darren

@zoecastillo
Copy link
Owner

Thanks! This is good.

It looks like you are trying to generate a "doc" report. Could you please try html instead to see if that works?
I would generally recommend html output unless it has to be one of the other options. The plots just don't look very good in the other document types.

However, based on the contents of the temp folder, it looks like the R file is produced, but the knit step fails.

What the app does, is to call this code:
knitr::spin(rscript, knit = FALSE)
rscript is the path to me_report.R which is present in the tmp folder.

To see if the problem is with knitr itself, you could do the following:

  1. Open me_report.R within the tmp folder
  2. There will be a line that loads the data meData <- filterMEData(readData(...; below it should be a comment that says the name of your data file. You should replace the value within readData with a path pointing to your data file. (data within the temp folder is not available outside of the app)
  3. Save the modified me_report.R somewhere

Then you can set rscript to your version of me_report.R rscript <- "me_report.R" and then call knitr::spin(rscript, knit = FALSE)

If that goes through without issues, you could then try calling
rmarkdown::render(rscript, output_format = "all")

@DarrenLCY
Copy link
Author

Hi Janina,

Thanks for the help!

I tried again using HTML and it still doesn't work. However, I tried all what you suggested next and I managed to get the report generated. Thanks!

I'm wondering if by any chance you think you'll be able to fix this issue on Windows soon, so that you can just click on "GENERATE" and get the report directly generated? The reason being, I'm currently making a quick ~5mins video tutorial about microbiomeExplorer for a university project and would love to see it working directly. Our deadline is this Sunday 11.59pm Newfoundland time. If that's not possible, no problem at all, I understand.

P.S: I can send you a link to the video tutorial if you're interested! (planning to post it on YouTube)

Thank you very much,
Darren

@zoecastillo
Copy link
Owner

Hi Darren,

Glad to hear at least this workaround was successful.

I think it might be the path that I am creating with this statement:
rscript <- paste0(dir, "/", filename, ".R")
This might cause issues in Windows as the file separator is wrong:
Removing C:\Users\Owner\AppData\Local\Temp\RtmpsFfPir/me_report.Rmd

I don't know if this will fix the issue or if it is something in addition to this, but you could try installing the package again using the "filePathFix" branch:
BiocManager::install("zoecastillo/microbiomeExplorer", ref = "filePathFix")

If it does work, please let me know as I cannot test it myself without a Windows environment. If not, I am afraid I will not be able to find a solution before Sunday.

Best,

Janina

@DarrenLCY
Copy link
Author

Hi Janina,

Sadly, this also doesn't work. Thanks so much for the help though, I'll manage with what I have for now.

Best,
Darren

@DarrenLCY
Copy link
Author

Hi Janina,

As mentioned, here's a YouTube link to the video: https://www.youtube.com/watch?v=Jq1Tav35Hk8

Thanks so much again for all the help!

Best regards,
Darren

@zoecastillo
Copy link
Owner

Thanks for sharing the link!

I will keep this ticket open nonetheless to remind me to find a solution for the Windows problem.

If it is not the file path, there is probably an issue with finding the required tools from the app. But, I don't know. I will need to find a windows system or simulate one to see if I can replicate the issue.

@DarrenLCY
Copy link
Author

Hi Janina,

No problem! Okay sounds like a good idea!

Thank you very much!

Best,
Darren

@riafeidaki
Copy link

Hello there,

I am facing the same problem generating the report from Windows, is there any update?

Thank you,
Ria

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants