[Bioc-devel] BiocCheck warnings and errors

Marcel Ramos m@rce|@r@mo@perez @end|ng |rom ro@we||p@rk@org
Tue Sep 13 20:39:21 CEST 2022

On 9/13/22 12:05 PM, Hervé Pagès wrote:
> Let's please keep this conversation on the bioc-devel list where it 
> started.
> On 13/09/2022 08:53, Christian Arnold wrote:
>> Hi Hervé!
>> On 13/09/2022 17:47, Hervé Pagès wrote:
>>> Hi Christian,
>>> On 13/09/2022 08:03, Christian Arnold wrote:
>>>> I have a few questions regarding BiocCheck errors and warnings that I
>>>> receive for a new package version that I feel are not warranted:
>>>> 1. I want to use the testthat framework in combination with
>>>> devtools::test, and from my understanding, a subdirectory /testthat/
>>>> within tests has to be used for this and is created when using
>>>> devtools::test(). I still get an ERROR when using BiocCheck because I
>>>> have no .R files in tests/ but within tests/testthat:
>>>> * Checking unit tests... * ERROR: Add a .R or .Rin file in tests/
>>>> directory or unit tests will not be run by R CMD check. See
>>>> http://bioconductor.org/developers/how-to/unitTesting-guidelines/
>>> The error message is pretty clear about **why** you must have a .R or
>>> .Rin file in tests/ It's fine that with your current setup you can run
>>> the tests with devtools::test() but that's not enough: the tests
>>> should also be run by R CMD check.
>> This is already clarified, thanks to another reply, I didnt have the
>> required testthat.R in the main test directory that starts the whole
>> testing and which is recognized by R CMD check as well.
>>>> 2. My package has many packages listed in Suggests, with a lot of 
>>>> effort
>>>> I tried to move as many packages there as possible to reduce the
>>>> installation burden. From my understanding, BiocManager does NOT 
>>>> install
>>>> the packages listed under /Suggests/. Thus, since I have 10+ 
>>>> packages in
>>>> /Suggests/ that actually enhance user functionality and may be 
>>>> needed, I
>>>> wrote a helper function that automatically installs these if the user
>>>> wants, as a convenience so users dont have to install them manually on
>>>> their own. However, no I get this error:
>>>> ERROR: Remove install() calls (found 2 times)
>>> Having BiocManager::install() calls in the package should be ok as
>>> long as those calls are **not** executed by R CMD build or R CMD
>>> check. Running R CMD build or R CMD check should never install
>>> packages on the user machine.
My 2cents is to avoid installing packages for users even if
you may find it more convenient for them. A function in any package
should have have runnable examples and these will install
packages when running R CMD check.

https://contributions.bioconductor.org recommends adding a conditional
in your code with `if (!requireNamespace(...))` to alert the user that a
package is needed.

If you'd like to be extra helpful, you can provide text that a user can copy
and paste to install the suggested packages (similar to what BiocManager
does). Otherwise, you can ask users to install the package with a
`dependencies = TRUE` argument.

Suggested packages are used sparingly, typically in one function and
therefore, asking the user to install the suggested package themselves
is not much of a burden IMO.

>> They are not executed no, but the Bioc error is still raised. I guess I
>> can then just ignore it, the package is already on Bioconductor.
>>>> 3. Minor but still: Can I use Biochceck also for the devel branch? 
>>>> I get
>>>> the following warning because I am checking the devel version and not
>>>> the release version:
>>>> WARNING: y of x.y.z version should be even in release
>>> If you are going to submit your package to Bioconductor, you must
>>> check your package against BioC devel, not against the current release.
>> See above, I used my devel branch for BiocCheck, which has an "uneven"
>> version number as required for the devel branch but BiocCheck seems to
>> check against the "release" branch and therefore throws the warning.
> Yes, you're checking the devel branch of your package, I get that. But 
> I suspect you're using BioC release (i.e. BioC 3.15). What I'm saying 
> is that you must use BioC devel. Loading BiocManager will tell you the 
> version of Bioconductor that you are using.
> Best,
> H.
>>> Hope this helps,
>>> H.
>>>> ***Thanks for your input and thoughts!****Christian*
>>>>     [[alternative HTML version deleted]]
>>>> _______________________________________________
>>>> Bioc-devel using r-project.org mailing list
>>>> https://stat.ethz.ch/mailman/listinfo/bioc-devel

Best regards,


Marcel Ramos
Bioconductor Core Team
Roswell Park Comprehensive Cancer Center
Dept. of Biostatistics & Bioinformatics
Elm St. & Carlton St.
Buffalo, New York 14263

This email message may contain legally privileged and/or...{{dropped:2}}

More information about the Bioc-devel mailing list