[Bioc-devel] Possible problems with BiocParallel and R cmd check on Github

Henrik Bengtsson henr|k@bengt@@on @end|ng |rom gm@||@com
Wed Jul 29 19:25:25 CEST 2020


>From a very quick look at this, I think you also need to explicitly
install the package itself for it to be available in external R
session (contrary to when using forked processing as on Linux and
macOS).  Something like this:

- name: Install dependencies
    run: |
      remotes::install_deps(dependencies = TRUE)
      remotes::install_cran("rcmdcheck")
      install.packages(".", repos=NULL, type="source") ## needed by
parallel workers
      shell: Rscript {0}

That's what I had to do when testing 'future'
(https://github.com/HenrikBengtsson/future/blob/1835a122764bbc0196c78be6da6973c8063922b3/.github/workflows/R-CMD-check.yaml#L69).

/Henrik

On Wed, Jul 29, 2020 at 10:18 AM Giulia Pais <giuliapais1 using gmail.com> wrote:
>
> Hi bioconductor team,
>
> we are currently developing a package for future submission on
> bioconductor which you can find here
> https://github.com/calabrialab/ISAnalytics.
>
> We use Github actions to keep track of R cmd checks at every commit, and
> this time, surprisingly for us, we had a failure on R cmd checks for
> windows (which is odd, since we develop on windows and performing check
> on 2 different windows machines didn't raise any error or warning) and
> we suspect this could be tied to the use of BiocParallel. For Windows,
> in fact, we use SnowParam instead of MulticoreParam and as the vignette
> and manual of BiocParallel specifies we must ensure that every worker is
> loaded with the proper dependencies, but apparently this is not
> necessary if the function to execute in bplapply belongs to the package
> in question. Here is the code of the function that might raise some
> problems:
>
> .import_type <- function(q_type, files, workers) {
>    files <- files %>% dplyr::filter(.data$Quantification_type == q_type)
>    # Register backend according to platform
>    if (.Platform$OS.type == "windows") {
>      p <- BiocParallel::SnowParam(workers = workers, stop.on.error = FALSE)
>    } else {
>      p <- BiocParallel::MulticoreParam(workers = workers, stop.on.error
> = FALSE)
>    }
>    # Import every file
>    suppressMessages(suppressWarnings({
>      matrices <- BiocParallel::bptry(
>        BiocParallel::bplapply(files$Files_chosen, FUN = function(x) {
>          matrix <- ISAnalytics::import_single_Vispa2Matrix(x)
>        }, BPPARAM = p)
>      )
>      }))
>    BiocParallel::bpstop(p)
>    correct <- BiocParallel::bpok(matrices)
>    imported_files <- files %>% dplyr::mutate(Imported = correct)
>    matrices <- matrices[correct]
>    # Bind rows in single tibble for all files
>    if (purrr::is_empty(matrices)) {
>      return(NULL)
>    }
>    matrices <- purrr::reduce(matrices, function(x, y) {
>      x %>% dplyr::bind_rows(y) %>% dplyr::distinct()
>    })
>    list(matrices, imported_files)
> }
>
> The report of the Github action can be found here:
> https://github.com/calabrialab/ISAnalytics/runs/923261561
>
> The check apparently fails with these warnings: Warning - namespace
> 'ISAnalytics' is not available and has been replaced. We tried adding
> 'library(ISAnalytics)' and 'require(ISAnalytics)' but if we do that
> BiocCheck fails with a warning, prompting for removal of this lines.
> Could this be a real issue with our package or just a problem with
> Github actions?
>
> Thanks in advance,
>
> Giulia Pais
>
> _______________________________________________
> Bioc-devel using r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/bioc-devel



More information about the Bioc-devel mailing list