Subject: bug#44264: Doc and vignettes bundled from Bioconductor

From: zimoun <[email-masked]>
Date: Tue, 27 Oct 2020 21:36:11 +0100

Dear,

Let’s take the example:

--8<---------------cut here---------------start------------->8---
$ guix import cran -a bioconductor diffcyt -r

Starting download of /tmp/guix-file.qJmqja
>From https://bioconductor.org/packages/release/bioc/src/contrib/diffcyt_1.8.8.tar.gz...
 …8.8.tar.gz  776KiB                  585KiB/s 00:01 [##################] 100.0%

Starting download of /tmp/guix-file.qAoQ59
>From https://bioconductor.org/packages/release/bioc/src/contrib/diffcyt_1.8.8.tar.gz...
 …8.8.tar.gz  776KiB                  565KiB/s 00:01 [##################] 100.0%
(define-public r-diffcyt
  (package
    (name "r-diffcyt")
    (version "1.8.8")
    (source
      (origin
        (method url-fetch)
        (uri (bioconductor-uri "diffcyt" version))
        (sha256
          (base32
            "1kq3zisgvi6kfra2sm17d01vw3rg0nz0vz5031jp2a96j7dryp98"))))
    (properties `((upstream-name . "diffcyt")))
    (build-system r-build-system)
    (propagated-inputs
      `(("r-circlize" ,r-circlize)
        ("r-complexheatmap" ,r-complexheatmap)
        ("r-dplyr" ,r-dplyr)
        ("r-edger" ,r-edger)
        ("r-flowcore" ,r-flowcore)
        ("r-flowsom" ,r-flowsom)
        ("r-limma" ,r-limma)
        ("r-lme4" ,r-lme4)
        ("r-magrittr" ,r-magrittr)
        ("r-multcomp" ,r-multcomp)
        ("r-reshape2" ,r-reshape2)
        ("r-s4vectors" ,r-s4vectors)
        ("r-summarizedexperiment"
         ,r-summarizedexperiment)
        ("r-tidyr" ,r-tidyr)))
    (native-inputs `(("r-knitr" ,r-knitr)))
    (home-page "https://github.com/lmweber/diffcyt")
    (synopsis
      "Differential discovery in high-dimensional cytometry via high-resolution clustering")
    (description
      "Statistical methods for differential discovery analyses in
       high-dimensional cytometry data (including flow cytometry, mass
       cytometry or CyTOF, and oligonucleotide-tagged cytometry), based on
       a combination of high-resolution clustering and empirical Bayes
       moderated tests adapted from transcriptomics.")
    (license expat)))
--8<---------------cut here---------------end--------------->8---

Well, added to gnu/packages/bioconductor.scm.  Then the usual
“./pre-inst-env guix build r-diffcyt” where the relevant parts are:

--8<---------------cut here---------------start------------->8---
starting phase `unpack'

[...]

diffcyt/inst/NEWS
diffcyt/inst/doc/
diffcyt/inst/doc/diffcyt_workflow.R
diffcyt/inst/doc/diffcyt_workflow.Rmd
diffcyt/inst/doc/diffcyt_workflow.html

[...]

starting phase `install'
* installing *source* package ‘diffcyt’ ...
** using staged installation
** R
** inst
** tests
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (diffcyt)

[...]

starting phase `check'
Testing examples for package ‘diffcyt’
Running specific tests for package ‘diffcyt’
  Running ‘testthat.R’
Running vignettes for package ‘diffcyt’
  Running ‘diffcyt_workflow.Rmd’

*** Source Errors ***

File diffcyt_workflow.R:
Cannot find the file(s): "diffcyt.png"

*** Weave Errors ***

File diffcyt_workflow.Rmd:
Cannot find the file(s): "diffcyt.png"
Warning message:
In engine$weave(path, quiet = TRUE, encoding = enc) :
  The vignette engine knitr::rmarkdown is not available because the rmarkdown package is not available. Did you forget to add it to Suggests in DESCRIPTION? Please see https://github.com/yihui/knitr/issues/1864 for more information.
phase `check' succeeded after 61.9
[..]
--8<---------------cut here---------------end--------------->8---

Therefore, trying to address this error in the check phase, I am
puzzled.  Initially, I thought it was a change in ’knitr’ [1,2], I
added:

--8<---------------cut here---------------start------------->8---
    (arguments
     `(#:phases
       (modify-phases %standard-phases
         (add-before 'check 'patch-knitr-include_graphics
           (lambda _
             (substitute* "vignettes/diffcyt_workflow.Rmd"
               (("knitr::include_graphics\\(\"diffcyt.png\"\\)")
                "knitr::include_graphics(\"diffcyt.png\", error = FALSE)")
--8<---------------cut here---------------end--------------->8---

and even tried “after ’unpack” phase; idem.

Well, the error is about a missing file, however:

  tar -xvf $(./pre-inst-env guix build r-diffcyt -S)

and tree returns:

        ├── inst
        │   ├── doc
        │   │   ├── diffcyt_workflow.html
        │   │   ├── diffcyt_workflow.R
        │   │   └── diffcyt_workflow.Rmd
        │   └── NEWS

        [...]

        └── vignettes
            ├── diffcyt.png
            └── diffcyt_workflow.Rmd

and “inst/doc/diff_workflow.html“ is correct, i.e., displaying the logo
(which is diffcyt.png).

The issue for this specific package is that the check is running
inst/doc/diff_workflow.Rmd instead of vignettes/diffcyt_workflow.Rmd;
which one story.

The other story is how “inst/doc/diff_workflow.html” is generated?  I am
not sure it is locally generated.  To be sure, let fetch the tarball
from upstream:

--8<---------------cut here---------------start------------->8---
wget https://bioconductor.org/packages/release/bioc/src/contrib/diffcyt_1.8.8.tar.gz
tar xvf diffcyt_1.8.8.tar.gz
tree diffcyt
--8<---------------cut here---------------end--------------->8---

But it is not the case when cloning from upstream:

  git clone https://git.bioconductor.org/packages/diffcyt

Do I miss something?

All the best,
simon

1: <https://github.com/yihui/knitr/blob/master/NEWS.md#changes-in-knitr-version-128>
2: <https://github.com/yihui/knitr/blob/master/NEWS.md#changes-in-knitr-version-129>