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

Duncan Murdoch murdoch@dunc@n @end|ng |rom gm@||@com
Fri Mar 17 13:48:21 CET 2023


You keep repeating basically the same questions, and appear to be 
ignoring the advice you've received.  That's partly understandable, 
because some of it (what you find in places like StackOverflow) is 
wrong, but I think you should trust what I said, and what Ivan, Martin 
and Uwe said.  Uwe is an authority on CRAN, Martin is an authority on 
BioConductor, and Ivan and I are experienced R users.

Duncan Murdoch

On 17/03/2023 8:29 a.m., Ruff, Sergej wrote:
> Really.Whats a problem i have when all dependencies arent prei 
> installed. I thought the problem would be solved once my package is 
> available on CRAN.
> 
> 
> Here is a recent question I had regarding the same issue:
> 
> 
> I am currently working on a r-package. I would like to submit my r 
> package to CRAN, but I have a question regarding dependency 
> installations on CRAN.
> 
> I have almost finished my package, added the required dependencies to 
> the NAMESPACE and DESCRIPTION files as Imports, and get no errors or 
> warnings
> 
> when running the check in Rstudio. The package runs on the pc, where 
> I´ve built the package, but when I install the package on a pc, where 
> the dependencies
> 
> are not preinstalled, I get the following error:
> 
> ERROR:
> 
> |dependencies 'depth', 'geometry' are not available for package 
> 'packagename' * removing 
> 'C:/Users/156932/AppData/Local/Programs/R/R-4.2.1/library/packagename' 
> Warning in install.packages : installation of package ‘packagename’ had 
> non-zero exit status |
> 
> The problem is that a local installation of my package (via USB-stick 
> for example) can´t install the dependencies from CRAN.
> 
> The package works perfectly fine, if the dependencies are preinstalled.
> 
> Now I don´t want to submit my package to CRAN if the end user gets the 
> same error message when installing my package.
> 
> Question: After I submit my package to CRAN, will CRAN install 
> dependencies automatically (via "install.packages()"), resolving the 
> issue I have right now?
> 
> Or do I have to modify the R-package or the Description-file to make 
> sure my Package can install dependencies?
> 
> I provided the dependencies to the NAMESPACE-file as @ImportFrom via the 
> devtools::document()-function. I added the dependencies to the 
> DESCRIPTION-file via |usethis::use_package("x",type="Imports")|. The 
> Description looks like this:
> 
> |License: GPL (>= 3) Encoding: UTF-8 LazyData: true RoxygenNote: 7.2.3 
> Imports: depth, geometry, graphics, grDevices, MASS, mvtnorm, nlme, rgl, 
> stats|
> 
> 
> 
> So I thought all dependencies would install automatically from CRAN? Is 
> that not the case?
> 
> 
> ------------------------------------------------------------------------
> *Von:* Duncan Murdoch <murdoch.duncan using gmail.com>
> *Gesendet:* Freitag, 17. März 2023 13:15:28
> *An:* Ruff, Sergej; Martin Morgan; Ivan Krylov
> *Cc:* r-package-devel using r-project.org
> *Betreff:* Re: AW: [R-pkg-devel] How to declare Bioconductor 
> Dependencies in the Description File of my R Package
> On 17/03/2023 6:19 a.m., Ruff, Sergej wrote:
>> In my example I have the following lines:
>> 
>> 
>> ### Differential expression analysis with limma
>> group = gl(2, n)
>> design = model.matrix(~ group)
>> fit1 = limma::lmFit(X, design)
>> fit = limma::eBayes(fit1)
>> 
>> The R CMD Check returns no Errors or Notes if Limma is pre-installed. If 
>> limma is not pre-installed I get an error, reminding me that Limma is 
>> not available.
> 
> That's a problem, and will cause your package to be rejected.  It should
> not raise an error during the tests when a suggested package is missing.
> Ivan gave you good advice on how to fix this.
> 
> I'd recommend testing your package a few times on Winbuilder and fixing
> things until you get clean results.  That won't guarantee acceptance on
> CRAN; new packages get a manual inspection as well, and they'll often
> find some problem that the automatic tests don't find, e.g. stylistic
> issues in the Description field of the DESCRIPTION file.  Here's a note
> I received recently when I submitted a new package (RmdConcord):
> 
> ----------------
> The Description field is intended to be a (one paragraph) description of
> what the package does and why it may be useful. Please add more details
> about the package functionality and implemented methods in your
> Description text.
> 
> Please always write package names, software names and API (application
> programming interface) names in single quotes in title and description.
> e.g: --> 'R Markdown'
> Please note that package names are case sensitive.
> 
> Please do not start the description with "This package", "Functions
> for", package name, title or similar.
> ---------------
> 
> 
> Duncan Murdoch
> 
>> 
>> 
>> Thats the source of my worries. Will the same error appear when CRAN 
>> checks the examples of my package? Or should I not be worried?
>> 
>> 
>> With regards,
>> 
>> 
>> Sergej
>> 
>> ------------------------------------------------------------------------
>> *Von:* Duncan Murdoch <murdoch.duncan using gmail.com>
>> *Gesendet:* Freitag, 17. März 2023 11:14:25
>> *An:* Ruff, Sergej; Martin Morgan; Ivan Krylov
>> *Cc:* 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
>> On 17/03/2023 6:06 a.m., Ruff, Sergej wrote:
>>> I was wondering how CRAN will handle Limma when running the automatic check.
>>> 
>>> 
>>> I am worried that my package will be rejected if Limma won�t install from Bioconductor on a clean version of R. Leading to an Error and Note during the check.
>>> 
>>> 
>>> I am using Limma only for an example in my functions description, not inside my actual function.
>>> 
>>> 
>>> How would CRAN�s System handle that when checking my package for submission?
>> 
>> If you have it in the Suggests list you should have written your code to
>> work (i.e. not trigger an error) whether it is installed or not, so you
>> shouldn't worry about it.
>> 
>> Duncan Murdoch
>> 
>>> 
>>> 
>>> with regards,
>>> 
>>> 
>>> Sergej
>>> 
>>> ________________________________
>>> Von: Martin Morgan <mtmorgan.bioc using gmail.com>
>>> Gesendet: Donnerstag, 16. M�rz 2023 20:12:51
>>> An: Ivan Krylov; Ruff, Sergej
>>> Cc: 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
>>> 
>>> I would not follow the instructions in RTIGER�s README for installing Bioconductor packages.
>>> 
>>> BiocManager::install(�RTIGER�) would install both CRAN and Bioconductor dependencies of RTIGER, and would be my preferred instruction in a README or INSTALL file. A complete instruction might be to install your package as if it were on Bioconductor �
>>> 
>>> If (!requireNamepace(�BiocManager�, quietly = TRUE))
>>>      install.packages(�BiocManager�)
>>> BiocManager::install(�<your package>�)
>>> 
>>> It does not make sense to me to have instructions in .onAttach / .onLoad or in each function for the user to install a �Suggests:� package, when actually the package is required for use and belongs in Imports: or perhaps Depends:.
>>> 
>>> The instruction to use �version = �3.14�� of Bioconductor in the RTIGER document is not universally correct, since different Bioconductor versions are tied to specific R versions (see https://bioconductor.org/about/release-announcements/ 
> <https://bioconductor.org/about/release-announcements/>
>> <https://bioconductor.org/about/release-announcements/ 
> <https://bioconductor.org/about/release-announcements/>> ). On one
>> version of R I am currently using, I get
>>> 
>>>> BiocManager::install(version = "3.14")
>>> Error: Bioconductor version '3.14' requires R version '4.1'; use
>>>    `BiocManager::install(version = '3.17')` with R version 4.3; see
>>>    https://bioconductor.org/install <https://bioconductor.org/install> 
> <https://bioconductor.org/install <https://bioconductor.org/install>>
>>> 
>>> The instruction to install a vector of Bioconductor packages is also unnecessary for Bioconductor packages in the Imports: or Depends: field of <your package>, or if one were to pass the argument `dependencies = TRUE` to either BiocManager::install() or  install.packages()  (to get the Suggests: packages of <your package> 
> to be installed, as
>> well as Depends:, Imports: and LinkingTo:).
>>> 
>>> Briefly, installation requires R to know the correct repositories. The command
>>> 
>>> BiocManager::repositories()
>>> 
>>> Returns a vector of Bioconductor and CRAN repositories relevant to your version of R. If one is averse to using BiocManager::install(�RTIGER�), a reasonable alternative, though still requiring that the BiocManager package is installed, is
>>> 
>>> install.packages(�RTIGER�, repos = BiocManager::repositories())
>>> 
>>> Base R also provides a mechanism for specifying Bioconductor repositories, via `setRepositories()` called before install.packages(). However, this is not recommended because, as can be seen on the web page mentioned above, there are two versions of Bioconductor for each version of R � one always gets the �old� Bioconductor
>> version, even when a newer version is available.
>>> 
>>> From: R-package-devel <r-package-devel-bounces using r-project.org> on behalf of Ivan Krylov <krylov.r00t using gmail.com>
>>> Date: Thursday, March 16, 2023 at 2:15 PM
>>> To: Ruff, Sergej <Sergej.Ruff using tiho-hannover.de>
>>> 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
>>> On Thu, 16 Mar 2023 17:01:55 +0000
>>> "Ruff, Sergej" <Sergej.Ruff using tiho-hannover.de> wrote:
>>> 
>>>> Last question: How does CRAN work with Bioconductor Dependencies?
>>>> Will CRAN accept limma as a dependency or will my submission be
>>>> rejected?
>>> 
>>> It's not explicitly spelled out in the CRAN policy
>>> <https://cran.r-project.org/web/packages/policies.html
>> <https://cran.r-project.org/web/packages/policies.html 
> <https://cran.r-project.org/web/packages/policies.html>>>, but
>>> Bioconductor and CRAN are the "mainstream repositories" for the
>>> purposes of the following rule:
>>> 
>>>>> Packages on which a CRAN package depends should be available from a
>>>>> mainstream repository
>>> 
>>> (Even non-mainstream repositories are allowed for optional dependencies
>>> if you follow a few additional rules.)
>>> 
>>> Here's an example of a CRAN package with a strong dependency on a
>>> Bioconductor package: <https://CRAN.R-project.org/package=RTIGER
>> <https://CRAN.R-project.org/package=RTIGER 
> <https://CRAN.R-project.org/package=RTIGER>>>. You
>>> can see the extra instructions for installing the Bioconductor
>>> dependencies in its README.
>>> 
>>> --
>>> Best regards,
>>> Ivan
>>> 
>>> ______________________________________________
>>> R-package-devel using r-project.org mailing list
>>> https://stat.ethz.ch/mailman/listinfo/r-package-devel 
> <https://stat.ethz.ch/mailman/listinfo/r-package-devel>
>> <https://stat.ethz.ch/mailman/listinfo/r-package-devel 
> <https://stat.ethz.ch/mailman/listinfo/r-package-devel>>
>>> 
>>>        [[alternative HTML version deleted]]
>>> 
>>> 
>>> ______________________________________________
>>> R-package-devel using r-project.org mailing list
>>> https://stat.ethz.ch/mailman/listinfo/r-package-devel 
> <https://stat.ethz.ch/mailman/listinfo/r-package-devel>
>> <https://stat.ethz.ch/mailman/listinfo/r-package-devel 
> <https://stat.ethz.ch/mailman/listinfo/r-package-devel>>
>> 
>



More information about the R-package-devel mailing list