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

errors generating PDF report #31

Open
ftwkoopmans opened this issue Jul 10, 2024 · 2 comments
Open

errors generating PDF report #31

ftwkoopmans opened this issue Jul 10, 2024 · 2 comments
Labels
documentation Improvements or additions to documentation

Comments

@ftwkoopmans
Copy link
Owner

ftwkoopmans commented Jul 10, 2024

Case 1: the R console shows an error that TeX/TinyTex needs to be updated

Recently we've seen the following error on some computers, triggered by updates to R packages/tools used by MS-DAP to create the PDF report.

A new version of TeX Live has been released. If you need to install or update any LaTeX packages, you have to upgrade TinyTeX with tinytex::reinstall_tinytex(repository = "illinois").
! LaTeX Error: File `bookmark.sty' not found.

! Emergency stop.
<read *>

Error: LaTeX failed to compile report.tex. See https://yihui.org/tinytex/r/#debugging for debugging tips. See report.log for more info.
Called from: show_latex_error(file, logfile)

solution:

Start a clean RStudio session, then run the following R command:

tinytex::reinstall_tinytex(repository = "illinois")

Case 2: general problems encountered when creating the MS-DAP PDF report

Description

MS-DAP was previously installed and working well; R, RStudio and RTools[windows only] have been installed & MS-DAP R package was installed using R command shown on the MS-DAP GitHub main page. However, now problems occur at the very last step of the MS-DAP pipeline: the PDF report is not created.

Potential cause

This might occur when you update a subset of rmarkdown-related R packages and thus some packages needed by MS-DAP to create the PDF report are outdated or the versions of mutually-dependent packages are out-of-sync.

Example errors

Some example errors that may be shown in the R console;

  • quitting from lines N-M report.Rmd
  • No output PDF file written
  • the function xfun::isFALSE() has been deprecated
  • xdvipdfmx:fatal: File ended prematurely
  • Segmentation fault (core dumped) 'xelatex' -halt-on-error -interaction=batchmode 'report.tex' > /dev/null 2> '/tmp/Rtmp6q3WSx/stderr164bf7d92f097'

Solution

Various reported issues have been traced back to outdated R packages that are related to knitr/rmarkdown. Please try the following installation steps (in order):

  • On Windows, ensure that RTools has been installed (e.g. use the R command pkgbuild::has_rtools() , which should yield TRUE). If RTools is not installed yet (although it should be prior to installing MS-DAP!); close RStudio, visit the website https://cran.r-project.org/bin/windows/Rtools/history.html, download the RTools version matching your R installation (version number is shown in the console when you start RStudio) and install it
  • Prior to installing R packages, close (all instances of) RStudio and start a fresh RStudio session (so none of the packages are in use)
  • In Rstudio, issue the following commands to ensure each R package needed for MS-DAP's RMarkdown PDF reporting is installed. One by one, run each line of code and verify that installation completed succesfully:
  • install.packages("xfun", repos = "https://cloud.r-project.org", type = "source")
  • install.packages("knitr", repos = "https://cloud.r-project.org")
  • install.packages("rmarkdown", repos = "https://cloud.r-project.org")
  • install.packages("tinytex", repos = "https://cloud.r-project.org")
  • tinytex::reinstall_tinytex()
  • now close and restart RStudio: MS-DAP report generation should work again!
@ftwkoopmans ftwkoopmans added the documentation Improvements or additions to documentation label Jul 10, 2024
@ftwkoopmans ftwkoopmans pinned this issue Jul 10, 2024
@ftwkoopmans ftwkoopmans unpinned this issue Jul 10, 2024
@medsoccer
Copy link

Thanks for clarifying as it has been some time since I used the package and just ran into it today after a day of analysis. Is there any way of generating the report without rerunning the analysis?

@ftwkoopmans
Copy link
Owner Author

Is there any way of generating the report without rerunning the analysis?

Currently not possible. But you can remove all contrasts using dataset_nostats = remove_contrasts(dataset) to remove all contrasts and store the results in a new dataset object, then use dataset_nostats = analysis_quickstart(dataset_nostats, ...) to generate the QC report without the time-consuming DEA.

For future reference, please create a separate ticket for feature requests or questions that are unrelated to the current issue.

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

No branches or pull requests

2 participants