Bioconductor is built using an extensive set of core capabilities and data structures. This leads to package developers depending on other packages for interoperability and functionality. This function extracts package dependency information from biocPkgList and returns a tidy data.frame that can be used for analysis and to build graph structures of package dependencies.

buildPkgDependencyDataFrame(dependencies = c("strong", "most", "all"), ...)

Arguments

dependencies

character() a vector listing the types of dependencies, a subset of c("Depends", "Imports", "LinkingTo", "Suggests", "Enhances"). Character string "all" is shorthand for that vector, character string "most" for the same vector without "Enhances", character string "strong" (default) for the first three elements of that vector.

...

parameters passed along to biocPkgList

Value

A data.frame (also a tbl_df) of S3 class "biocDepDF" including columns "Package", "dependency", and "edgetype".

Note

This function requires network access.

Examples

# performs a network call, so must be online.
library(BiocPkgTools)
depdf <- buildPkgDependencyDataFrame()
#> 'getOption("repos")' replaces Bioconductor standard repositories, see
#> 'help("repositories", package = "BiocManager")' for details.
#> Replacement repositories:
#>     CRAN: https://cloud.r-project.org
head(depdf)
#>   Package  dependency edgetype
#> 1      a4      a4Base  Depends
#> 2      a4   a4Preproc  Depends
#> 3      a4   a4Classif  Depends
#> 4      a4      a4Core  Depends
#> 5      a4 a4Reporting  Depends
#> 6  a4Base   a4Preproc  Depends
library(dplyr)
# filter to include only "Imports" type
# dependencies
imports_only <- depdf |> filter(edgetype=='Imports')

# top ten most imported packages
imports_only |> select(dependency) |>
  group_by(dependency) |> tally() |>
  arrange(desc(n))
#> # A tibble: 1,725 × 2
#>    dependency       n
#>    <chr>        <int>
#>  1 stats         1211
#>  2 methods       1129
#>  3 utils          998
#>  4 ggplot2        631
#>  5 graphics       599
#>  6 grDevices      574
#>  7 S4Vectors      569
#>  8 IRanges        443
#>  9 dplyr          410
#> 10 BiocGenerics   382
#> # ℹ 1,715 more rows

# The Bioconductor packages with the
# largest number of imports
largest_importers <- imports_only |>
  select(Package) |>
  group_by(Package) |> tally() |>
  arrange(desc(n))

# not sure what these packages do. Join
# to their descriptions
biocPkgList() |> select(Package, Description) |>
  left_join(largest_importers) |> arrange(desc(n)) |>
  head()
#> 'getOption("repos")' replaces Bioconductor standard repositories, see
#> 'help("repositories", package = "BiocManager")' for details.
#> Replacement repositories:
#>     CRAN: https://cloud.r-project.org
#> Joining with `by = join_by(Package)`
#> # A tibble: 6 × 3
#>   Package      Description                                                     n
#>   <chr>        <chr>                                                       <int>
#> 1 singleCellTK "The Single Cell Toolkit (SCTK) in the singleCellTK packag…    80
#> 2 ChromSCape   "ChromSCape - Chromatin landscape profiling for Single\nCe…    57
#> 3 signeR       "The signeR package provides an empirical Bayesian approac…    53
#> 4 metaseqR2    "Provides an interface to several normalization and\nstati…    51
#> 5 SpliceWiz    "Reads and fragments aligned to splice junctions can be\nu…    47
#> 6 musicatk     "Mutational signatures are carcinogenic exposures or\naber…    46