[R-pkg-devel] How to declare Bioconductor Dependencies in the Description File of my R Package

Martin Morgan mtmorg@n@b|oc @end|ng |rom gm@||@com
Wed May 3 17:36:40 CEST 2023


CRAN is fine with Bioconductor Depends: and Imports: dependencies, as previously mentioned. This is because the CRAN maintainers explicitly configure their system to know about Bioconductor package repositories.

Users face a different challenge -- many users will not have identified (e.g., via `setRepositories()` a Bioconductor repository, so when they try to install your package it will fail in a way that you have no control over -- a generic message saying that the Bioconductor dependencies was not found.

You could mitigate this by advertising that your CRAN package should be installed via `BiocManager::install("<your CRAN package>")`, which defines appropriate repositories for both CRAN and Bioconductor, but there is no way to unambiguously communicate this to users.

Martin

From: R-package-devel <r-package-devel-bounces using r-project.org> on behalf of Ruff, Sergej <Sergej.Ruff using tiho-hannover.de>
Date: Wednesday, May 3, 2023 at 11:13 AM
To: Dirk Eddelbuettel <edd using debian.org>
Cc: r-package-devel using r-project.org <r-package-devel using r-project.org>
Subject: Re: [R-pkg-devel] How to declare Bioconductor Dependencies in the Description File of my R Package
Thank you, Dirk.


I see your dependencies are Suggested. I know that Suggested dependencies should be conditional.


Do you know if Non-Cran (Bioconductor) packages need to be conditional?  Do you have any experiece regarding Non-CRAN Dependencies

and how to handle them?


I believe Duncan Murdoch's experience and opinion regarding that topic, but i take any second and third opinion to be sure.


Thank you for your help.


Sergej

________________________________
Von: Dirk Eddelbuettel <edd using debian.org>
Gesendet: Mittwoch, 3. Mai 2023 16:22:09
An: Ruff, Sergej
Cc: Duncan Murdoch; Ivan Krylov; r-package-devel using r-project.org
Betreff: Re: [R-pkg-devel] How to declare Bioconductor Dependencies in the Description File of my R Package


Sergej,

Please consider:

  - there are nearly 20k CRAN packages

  - all of them are mirrored at https://github.com/cran so you can browse

  - pick any one 'heavy' package you like, Seurat is a good example; there
    are other examples in geospatial or bioinformatics etc

  - you can browse _and search_ these to your hearts content

Here is an example of mine. In RcppArmadillo, years ago we (thanks to fine
Google Summer of Code work by Binxiang Ni) added extended support for sparse
matrices pass-through / conversione from R to C++ / Armadillo and back. That
is clearly an optional feature as most uses of (Rcpp)Armadillo use dense
matrices. So all code and test code is _conditional_.  File DESCRIPTION has

   Suggests: [...], Matrix (>= 1.3.0), [...], reticulate, slam

mostly for tests. I.e. We have very little R code: in one single file
R/SciPy2R.R we switched to doing this via reticulate and opee the function
with

    if (!requireNamespace("reticulate", quietly=TRUE)) {
        stop("You must install the 'reticulate' package (and have SciPy).", call.=FALSE)
    }

after an actual deprecation warning (as there was scipy converter once).

Similarly, the testsuites in inst/tinytests/* have several

    if (!requireNamespace("Matrix", quietly=TRUE)) exit_file("No Matrix package")

as well as

    if (!requireNamespace("reticulate", quietly=TRUE)) exit_file("Package reticulate missing")

    if (!packageVersion("reticulate") >= package_version("1.14"))
        exit_file("SciPy not needed on newer reticulate")

and tests for slam (another sparse matrix package besides the functionality
in Matrix).

Hopefully this brief snapshot gives you an idea.  There are (likely!!)
thousandss of examples you can browse, and I am sure you will find something.
If you have further (concrete) questions please do not hesitate to use the
resource of this list.

Cheers (or I should say "mit Braunschweiger Gruessen nach Hannover),

Dirk

--
dirk.eddelbuettel.com | @eddelbuettel | edd using debian.org

        [[alternative HTML version deleted]]

______________________________________________
R-package-devel using r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel

	[[alternative HTML version deleted]]



More information about the R-package-devel mailing list