| Title: | Bioconductor-specific package checks |
|---|---|
| Description: | BiocCheck guides maintainers through Bioconductor best practicies. It runs Bioconductor-specific package checks by searching through package code, examples, and vignettes. Maintainers are required to address all errors, warnings, and most notes produced. |
| Authors: | Bioconductor Package Maintainer [aut], Lori Shepherd [aut], Daniel von Twisk [ctb], Kevin Rue [ctb], Marcel Ramos [aut, cre] (ORCID: <https://orcid.org/0000-0002-3242-0582>), Leonardo Collado-Torres [ctb], Federico Marini [ctb] |
| Maintainer: | Marcel Ramos <[email protected]> |
| License: | Artistic-2.0 |
| Version: | 1.49.12 |
| Built: | 2026-06-02 23:38:21 UTC |
| Source: | https://github.com/bioc/BiocCheck |
Analyzes an R package for adherence with Bioconductor package guidelines and
best practices. The check outputs are categorized into ERROR, WARNING, and
NOTE. See the vignette for more details. BiocCheck is complementary
to R CMD check, which should always be run first.
BiocCheck( package = getwd(), checkDir = dirname(package), debug = FALSE, callr = FALSE, ... )BiocCheck( package = getwd(), checkDir = dirname(package), debug = FALSE, callr = FALSE, ... )
package |
The path to an R package directory or tarball ( |
checkDir |
The directory where the |
debug |
Whether to append the names of functions that correspond to
each condition raised by |
callr |
|
... |
See the |
BiocCheck() reviews R packages for adherence with Bioconductor
package guidelines and best practices. See
https://contributions.bioconductor.org for the latest guidance for
writing Bioconductor software. Some rationale behind these best practices
can be seen in the vignette and pages in the references section. The
vignette also provides detailed explanations of all the checks performed by
BiocCheck.
BiocCheck is called within R with BiocCheck("package")
where package points to the source directory or the .tar.gz
tarball that was created using R CMD build.
Note that BiocCheck is complementary to R CMD check.
R CMD check should always be run first for best results.
To skip installation of the package during the check, set the
install option to FALSE or NULL:
BiocCheck(package, install=FALSE) ## OR BiocCheck(package, install=NULL)
To re-use an existing installation log file, set the install option
to the name of the installation log file.
For example, the following will put the install_out.txt log file in the
<package_name>.BiocCheck directory:
BiocCheck(package, install="check:install_out.txt")
BiocCheck() is chiefly called for the side effect of the check
reporting. The function also creates a <package_name>.BiocCheck folder
and returns a BiocCheck reference class with three main list elements:
error: Items to address before the package can be accepted
warning: Strongly suggested items that may require attention
note: Items to consider, though not required, before acceptance
To use the dot-options, BiocCheck can be called with named arguments
corresponding to the options below. Typically, these options are set to
TRUE to disable specific checks, e.g.,
BiocCheck(package, 'no-check-vignettes'=TRUE). Unless
otherwise stated, these options can be left unset (i.e., NULL) to enable
checks but FALSE can also be used to explicitly enable them. The available
options are:
build-output-file: file containing R CMD build output, for
additional analysis
new-package: enable checks specific to new packages
no-check-bbs: disable BBS-specific checks (for non-BioC packages).
Valid DESCRIPTION
no-check-bioc-help: disable check for registration on Bioconductor
no-check-bioc-views: disable biocViews-specific checks (for non-BioC
packages)
mailing list and support site
no-check-coding-practices: disable check for some common best coding
practices
no-check-CRAN: disable check for if package exists in CRAN
no-check-dependencies: disable check for bad dependencies
no-check-deprecated: disable check for usage of deprecated packages
no-check-description: disable DESCRIPTION file checks
no-check-file-size: disable check for individual file size
no-check-formatting: disable checks for file formatting
no-check-function-len: disable check for function length
no-check-install-self: disable check for require or library of
itself
no-check-library-calls: disable check usage of functions that
install or update packages
no-check-man-doc: disable checks for man page documentation
no-check-namespace: disable NAMESPACE file checks
no-check-news: disable checks for NEWS file
no-check-pkg-size: disable check for package tarball size
no-check-R-ver: disable check for valid R version
no-check-remotes: disable check for usage of remote packages other
than those hosted on CRAN or Bioconductor
no-check-skip-bioc-tests: disable check for tests that skip when on
bioc
no-check-unit-tests: disable checks for unit tests
no-check-version-num: disable check for valid version number
no-check-vignettes: disable vignette checks
quit-with-status: enable exit code option when performing check
install: if FALSE, the package is not installed; otherwise, if not
specified, the package is installed by default. Optionally, a
check:<file> key-value pair is provided to identify the name of the
installation output file which will be copied to the
<package_name>.BiocCheck directory.
libloc: when install is specified, the library location where the
package is installed. By default, this is .libPaths()[1].
Dan Tenenbaum, Lori Shepherd, and Marcel Ramos
https://contributions.bioconductor.org
packageDir <- system.file("testpackages", "testpkg0", package="BiocCheck") BiocCheck(packageDir, `quit-with-status`=FALSE)packageDir <- system.file("testpackages", "testpkg0", package="BiocCheck") BiocCheck(packageDir, `quit-with-status`=FALSE)
The BiocCheck class provides a framework for reporting checks
based on Bioconductor guidelines. The class has several methods for working
with the provided checks that handle and display messages and the display
of the metadata. These methods also record the output of the BiocCheck()
report in both plain text and JSON formats.
Note that currently, multiple BiocCheck runs will interfere with
each other given that they are implemented via a reference class semantic.
When running multiple checks in the same session, you can separate these
instances by running them in separate processes (e.g., via BiocParallel).
... |
|
help_text |
|
condition |
|
messages |
|
debug |
|
checkName |
|
isOnBBS |
|
file |
|
The metadata includes a number of standard fields to allow easier troubleshooting and display of potentially relevant information. Currently, the fields included are:
BiocCheckVersion: The version of the BiocCheck package
BiocVersion: The version of Bioconductor
Package: The name of the package in check
PackageVersion: The version of the package in check
sourceDir: The directory of the package source or tarball in check
installDir: The directory where the package is installed for testing, a temporary location by default
BiocCheckDir: The directory where the <package>.BiocCheck folder
is saved. Usually the same folder as the package in check
platform: The platform/OS where the check is taking place
isTarBall: Whether the package in check is a source directory or a tarball
An internal BiocCheck R5 Reference Class used to document
conditions such as errors, warnings, and notes
loglist() A running list of all conditions raised (i.e., notes,
warnings, errors)
checkcharacter(1) The title of the last check used for logging
purposes.
error,warning,notelist() Finer extraction of each condition type
metadatalist() A list of additional information relevant to the
package and its state. See details.
add: Include a condition to the BiocCheck report
addMetadata: Add metadata to the BiocCheck object from a
BiocPackage object
getLastCheck: Obtain the name of the last check run
setCheck: Create a new element in the internal list for a check
get: Extract the list of conditions raised by BiocCheck
getNum: Tally the number of condition provided by the input
zero: Reset the internal log of the condition provided
getBiocCheckDir: Report and create the <package>.BiocCheck
directory as obtained from the metadata
composeReport: Simplify the list structure from the log and
provide a character vector of conditions raised
report: Write the 00BiocCheck.log report into the BiocCheck
folder
toJSON: Write a JSON file to the location indicated with the
conditions raised
fromJSON: Read a JSON file from the location indicated with the
output of previous conditions raised in the check
show: Display the information in the class. Currently empty.
show_meta: Display the metadata information stored in the metadata
field
bc <- BiocCheck:::.BiocCheckbc <- BiocCheck:::.BiocCheck
Analyzes an R package for adherence with Bioconductor package guidelines and best practices. The check outputs are categorized into ERROR, WARNING, and NOTE. This function is typically used in the Bioconductor Build System (BBS) and not intended for general use.
BiocCheckGitClone(package = ".", ...)BiocCheckGitClone(package = ".", ...)
package |
A directory containing an R source package. Not a package tar ball. |
... |
Currently, only |
BiocCheckGitClone() reviews R packages for adherence with
Bioconductor package guidelines and best practices. See
https://contributions.bioconductor.org for the latest guidance for
writing Bioconductor software. This function should only be run on a source
directory and not on a tarball.
BiocCheckGitClone is called within R with, as
BiocCheckGitClone("package") where package is the source directory
containing the R package.
BiocCheckGitClone() is chiefly called for the side effect of the
check reporting. The function returns a BiocCheck reference class with
three main list elements:
error: Items to address before the package can be accepted
warning: Strongly suggested items that may require attention
note: Items to consider, though not required, before acceptance
Lori Shepherd
https://contributions.bioconductor.org
packageDir <- system.file("testpackages", "testpkg0", package="BiocCheck") BiocCheckGitClone(packageDir, `quit-with-status`=FALSE)packageDir <- system.file("testpackages", "testpkg0", package="BiocCheck") BiocCheckGitClone(packageDir, `quit-with-status`=FALSE)