25 min read

Package dependencies in your session

It has almost been a standard to put sessionInfo() to the end of the R markdown document to keep track of the environment where the analysis is done. sessionInfo() prints a list of packages that are loaded to the R session directly or indirectly. But how about the dependency relations among those packages? In this blog post, let’s check it out.

Let’s open a new R session and only load the ggplot2 package:

library(ggplot2)

Next we obtain the session info by the sessionInfo() function:

x1 = sessionInfo()

Let’s print x1:

x1
## R version 4.3.1 (2023-06-16)
## Platform: x86_64-apple-darwin20 (64-bit)
## Running under: macOS Ventura 13.2.1
## 
## Matrix products: default
## BLAS:   /Library/Frameworks/R.framework/Versions/4.3-x86_64/Resources/lib/libRblas.0.dylib 
## LAPACK: /Library/Frameworks/R.framework/Versions/4.3-x86_64/Resources/lib/libRlapack.dylib;  LAPACK version 3.11.0
## 
## locale:
## [1] C/UTF-8/C/C/C/C
## 
## time zone: Europe/Berlin
## tzcode source: internal
## 
## attached base packages:
## [1] stats     graphics  grDevices utils     datasets  methods   base     
## 
## other attached packages:
## [1] ggplot2_3.4.4
## 
## loaded via a namespace (and not attached):
##  [1] utf8_1.2.3       R6_2.5.1         tidyselect_1.2.0 magrittr_2.0.3   gtable_0.3.4    
##  [6] glue_1.6.2       tibble_3.2.1     pkgconfig_2.0.3  generics_0.1.3   dplyr_1.1.3     
## [11] lifecycle_1.0.3  cli_3.6.1        fansi_1.0.5      scales_1.2.1     grid_4.3.1      
## [16] vctrs_0.6.4      withr_2.5.1      compiler_4.3.1   munsell_0.5.0    pillar_1.9.0    
## [21] colorspace_2.1-0 rlang_1.1.1

It seems only a few packages are loaded in the session.

x1 is an R object as a list with several elements that correspond to the packages that are loaded directly or indirectly. Packages in session are put into three groups:

  • base packages: Base packages shipped with R, e.g. grid, methods. Note packages like lattice or MASS, although also shipped with R, they are “recommended packages”.
  • other packages: Other packages e.g. which you load by library(). They will be visible on the search path (by search()).
  • loaded packages: Other packages which are also loaded into the R session by “other packages”, but not visible on the search path.
base_pkgs = x1$basePkgs
other_pkgs = sapply(x1$otherPkgs, function(x) x$Package)
loaded_pkgs = sapply(x1$loadedOnly, function(x) x$Package)

For the packages in session, we need to know their dependency relations. Here we use the pkgndep package. All the packages installed locally are used as the “package database” for querying dependencies.

library(pkgndep)
db = reformat_db(installed.packages())
## prepare dependency table...
## prepare reverse dependency table...

Now we go through every “other packages” and obtain its direct and remote dependencies. Here we only use the “strong” dependencies, i.e. the packages with dependency relations of “Depends”, “Imports” and “LinkingTo”.

mat = matrix(nrow = 0, ncol = 3)

for(pkg in other_pkgs) {
    mat = rbind(mat, db$package_dependencies(pkg, recursive = TRUE, which = "strong"))
}
mat = unique(mat)

Base packages are bound to R, so we remove the dependency relation from base packages. And we only restrict the packages to “other packages” and “loaded packages”.

all_pkgs = c(other_pkgs, loaded_pkgs)
mat = mat[mat[, 1] %in% all_pkgs & mat[, 2] %in% all_pkgs, , drop = FALSE]
mat = mat[!mat[, 1] %in% pkgndep:::BASE_PKGS | mat[, 2] %in% pkgndep:::BASE_PKGS, , drop = FALSE]
head(mat)
##      package   dependency  dep_fields
## [1,] "ggplot2" "cli"       "Imports" 
## [2,] "ggplot2" "glue"      "Imports" 
## [3,] "ggplot2" "grid"      "Imports" 
## [4,] "ggplot2" "gtable"    "Imports" 
## [5,] "ggplot2" "lifecycle" "Imports" 
## [6,] "ggplot2" "rlang"     "Imports"

Next we use the DiagrammeR package to visualize the dependency diagram. We first generate the DOT code:

all_nodes = unique(c(mat[, 1], mat[, 2], other_pkgs, loaded_pkgs))
node_col = rep("black", length(all_nodes))
node_col[all_nodes %in% other_pkgs] = "red"
node_col[all_nodes %in% loaded_pkgs] = "blue"

library(glue)
nodes = glue("  \"{all_nodes}\" [color=\"{node_col}\"];", collapse = FALSE)

dep_col = c(2, 4, 3, 5, 6)
dep_col = rgb(t(col2rgb(dep_col)), max = 255)
names(dep_col) = c("Depends", "Imports", "LinkingTo", "Suggests", "Enhances")

edges = glue("  \"{mat[, 1]}\" -> \"{mat[, 2]}\" [color=\"{dep_col[mat[, 3]]}\"];", collapse = FALSE)

dot = paste(
    c("digraph {",
      "  nodesep=0.05",
      "  rankdir=LR;", 
      "  graph [overlap = true];",
      "  node[shape = box];",
      nodes,
      edges,
      "}"),
    collapse = "\n"
)
cat(dot)
## digraph {
##   nodesep=0.05
##   rankdir=LR;
##   graph [overlap = true];
##   node[shape = box];
##   "ggplot2" [color="red"];
##   "gtable" [color="blue"];
##   "lifecycle" [color="blue"];
##   "scales" [color="blue"];
##   "tibble" [color="blue"];
##   "vctrs" [color="blue"];
##   "munsell" [color="blue"];
##   "pillar" [color="blue"];
##   "cli" [color="blue"];
##   "glue" [color="blue"];
##   "grid" [color="blue"];
##   "rlang" [color="blue"];
##   "withr" [color="blue"];
##   "R6" [color="blue"];
##   "fansi" [color="blue"];
##   "magrittr" [color="blue"];
##   "pkgconfig" [color="blue"];
##   "colorspace" [color="blue"];
##   "utf8" [color="blue"];
##   "tidyselect" [color="blue"];
##   "generics" [color="blue"];
##   "dplyr" [color="blue"];
##   "compiler" [color="blue"];
##   "ggplot2" -> "cli" [color="#2297E6"];
##   "ggplot2" -> "glue" [color="#2297E6"];
##   "ggplot2" -> "grid" [color="#2297E6"];
##   "ggplot2" -> "gtable" [color="#2297E6"];
##   "ggplot2" -> "lifecycle" [color="#2297E6"];
##   "ggplot2" -> "rlang" [color="#2297E6"];
##   "ggplot2" -> "scales" [color="#2297E6"];
##   "ggplot2" -> "tibble" [color="#2297E6"];
##   "ggplot2" -> "vctrs" [color="#2297E6"];
##   "ggplot2" -> "withr" [color="#2297E6"];
##   "gtable" -> "cli" [color="#2297E6"];
##   "gtable" -> "glue" [color="#2297E6"];
##   "gtable" -> "grid" [color="#2297E6"];
##   "gtable" -> "lifecycle" [color="#2297E6"];
##   "gtable" -> "rlang" [color="#2297E6"];
##   "lifecycle" -> "cli" [color="#2297E6"];
##   "lifecycle" -> "glue" [color="#2297E6"];
##   "lifecycle" -> "rlang" [color="#2297E6"];
##   "scales" -> "lifecycle" [color="#2297E6"];
##   "scales" -> "munsell" [color="#2297E6"];
##   "scales" -> "R6" [color="#2297E6"];
##   "scales" -> "rlang" [color="#2297E6"];
##   "tibble" -> "fansi" [color="#2297E6"];
##   "tibble" -> "lifecycle" [color="#2297E6"];
##   "tibble" -> "magrittr" [color="#2297E6"];
##   "tibble" -> "pillar" [color="#2297E6"];
##   "tibble" -> "pkgconfig" [color="#2297E6"];
##   "tibble" -> "rlang" [color="#2297E6"];
##   "tibble" -> "vctrs" [color="#2297E6"];
##   "vctrs" -> "cli" [color="#2297E6"];
##   "vctrs" -> "glue" [color="#2297E6"];
##   "vctrs" -> "lifecycle" [color="#2297E6"];
##   "vctrs" -> "rlang" [color="#2297E6"];
##   "munsell" -> "colorspace" [color="#2297E6"];
##   "pillar" -> "cli" [color="#2297E6"];
##   "pillar" -> "fansi" [color="#2297E6"];
##   "pillar" -> "glue" [color="#2297E6"];
##   "pillar" -> "lifecycle" [color="#2297E6"];
##   "pillar" -> "rlang" [color="#2297E6"];
##   "pillar" -> "utf8" [color="#2297E6"];
##   "pillar" -> "vctrs" [color="#2297E6"];
## }

Then we send the DOT code to grViz() function.

DiagrammeR::grViz(dot)
%0 ggplot2 ggplot2 gtable gtable ggplot2->gtable lifecycle lifecycle ggplot2->lifecycle scales scales ggplot2->scales tibble tibble ggplot2->tibble vctrs vctrs ggplot2->vctrs cli cli ggplot2->cli glue glue ggplot2->glue grid grid ggplot2->grid rlang rlang ggplot2->rlang withr withr ggplot2->withr gtable->lifecycle gtable->cli gtable->glue gtable->grid gtable->rlang lifecycle->cli lifecycle->glue lifecycle->rlang scales->lifecycle munsell munsell scales->munsell scales->rlang R6 R6 scales->R6 tibble->lifecycle tibble->vctrs pillar pillar tibble->pillar tibble->rlang fansi fansi tibble->fansi magrittr magrittr tibble->magrittr pkgconfig pkgconfig tibble->pkgconfig vctrs->lifecycle vctrs->cli vctrs->glue vctrs->rlang colorspace colorspace munsell->colorspace pillar->lifecycle pillar->vctrs pillar->cli pillar->glue pillar->rlang pillar->fansi utf8 utf8 pillar->utf8 tidyselect tidyselect generics generics dplyr dplyr compiler compiler

It looks like the dependency relations are complicated than simply listing the packages. There are also isolated packages in the diagram that are not connected to ggplot2, e.g. dplyr. They are loaded to the R session as “weak dependencies” indirectly by ggplot2 or its upstream packages.

We wrap the code as a function which we will use repeatedly. Internally, we call library(pkg) in a fresh R session by using the callr package.

loaded_pkgs = function(pkg) {
    for(i in seq_along(pkg)) {
        library(pkg[i], character.only=TRUE)
    }
    session_info = sessionInfo()

    base_pkgs = session_info$basePkgs
    other_pkgs = sapply(session_info$otherPkgs, function(x)x$Package)
    loaded_pkgs = sapply(session_info$loadedOnly, function(x)x$Package)

    lt = list(base_pkgs = base_pkgs,
              other_pkgs = other_pkgs,
              loaded_pkgs = loaded_pkgs)

    jsonlite::toJSON(lt)
}

dep_in_session = function(pkg, db, dep_group = "strong", rankdir = "LR") {

    session_info = jsonlite::fromJSON(callr::r(loaded_pkgs, args = list(pkg = pkg)))

    base_pkgs = session_info$base_pkgs
    other_pkgs = session_info$other_pkgs
    loaded_pkgs = session_info$loaded_pkgs

    mat = matrix(nrow = 0, ncol = 3)

    for(pkg in other_pkgs) {
        mat = rbind(mat, db$package_dependencies(pkg, recursive = TRUE, which = dep_group))
    }
    mat = unique(mat)
    mat = mat[!mat[, 1] %in% pkgndep:::BASE_PKGS | mat[, 2] %in% pkgndep:::BASE_PKGS, , drop = FALSE]

    all_pkgs = c(other_pkgs, loaded_pkgs)
    mat = mat[mat[, 1] %in% all_pkgs & mat[, 2] %in% all_pkgs, , drop = FALSE]

    all_nodes = unique(c(mat[, 1], mat[, 2], other_pkgs, loaded_pkgs))
    node_col = rep("black", length(all_nodes))
    node_col[all_nodes %in% other_pkgs] = "red"
    node_col[all_nodes %in% loaded_pkgs] = "blue"

    nodes = glue::glue("  \"{all_nodes}\" [color=\"{node_col}\"];", collapse = FALSE)

    dep_col = c(2, 4, 3, 5, 6)
    dep_col = rgb(t(col2rgb(dep_col)), max = 255)
    names(dep_col) = c("Depends", "Imports", "LinkingTo", "Suggests", "Enhances")

    edges = glue::glue("  \"{mat[, 1]}\" -> \"{mat[, 2]}\" [color=\"{dep_col[mat[, 3]]}\"];", collapse = FALSE)

    dot = paste(
        c("digraph {",
          "  nodesep=0.05",
          glue::glue("  rankdir={rankdir};"), 
          "  graph [overlap = true];",
          "  node[shape = box];",
          nodes,
          edges,
          "}"),
        collapse = "\n"
    )

    DiagrammeR::grViz(dot)
}

In the previous example, we only consider “strong dependency relations” upstream of ggplot2. What if we include all dependency relations?

dep_in_session("ggplot2", db = db, dep_group = "all")
%0 ggplot2 ggplot2 cli cli ggplot2->cli glue glue ggplot2->glue gtable gtable ggplot2->gtable lifecycle lifecycle ggplot2->lifecycle rlang rlang ggplot2->rlang scales scales ggplot2->scales tibble tibble ggplot2->tibble vctrs vctrs ggplot2->vctrs withr withr ggplot2->withr dplyr dplyr ggplot2->dplyr munsell munsell ggplot2->munsell grid grid ggplot2->grid cli->glue cli->rlang cli->tibble cli->withr glue->ggplot2 glue->vctrs glue->withr glue->dplyr magrittr magrittr glue->magrittr gtable->ggplot2 gtable->cli gtable->glue gtable->lifecycle gtable->rlang gtable->grid lifecycle->cli lifecycle->glue lifecycle->rlang lifecycle->tibble lifecycle->vctrs lifecycle->withr rlang->cli rlang->glue rlang->tibble rlang->vctrs rlang->withr rlang->magrittr pillar pillar rlang->pillar scales->ggplot2 scales->lifecycle scales->rlang scales->munsell R6 R6 scales->R6 tibble->ggplot2 tibble->cli tibble->lifecycle tibble->rlang tibble->vctrs tibble->withr tibble->dplyr tibble->magrittr tibble->pillar fansi fansi tibble->fansi pkgconfig pkgconfig tibble->pkgconfig vctrs->cli vctrs->glue vctrs->lifecycle vctrs->rlang vctrs->tibble vctrs->withr vctrs->dplyr vctrs->pillar generics generics vctrs->generics withr->rlang dplyr->ggplot2 dplyr->cli dplyr->glue dplyr->lifecycle dplyr->rlang dplyr->tibble dplyr->vctrs dplyr->withr dplyr->magrittr dplyr->pillar dplyr->generics tidyselect tidyselect dplyr->tidyselect dplyr->R6 munsell->ggplot2 colorspace colorspace munsell->colorspace magrittr->rlang pillar->ggplot2 pillar->cli pillar->glue pillar->lifecycle pillar->rlang pillar->scales pillar->tibble pillar->vctrs pillar->withr pillar->dplyr utf8 utf8 pillar->utf8 pillar->fansi generics->tibble generics->withr tidyselect->cli tidyselect->glue tidyselect->lifecycle tidyselect->rlang tidyselect->tibble tidyselect->vctrs tidyselect->withr tidyselect->dplyr tidyselect->magrittr colorspace->ggplot2 colorspace->scales colorspace->dplyr colorspace->grid utf8->cli utf8->rlang utf8->withr compiler compiler

It becomes much more complicated! Especially we can see there are many bi-directional dependencies, e.g. A <-> B where A is a strong dependency of B, and B is a weak dependency of A.

Next let’s check a Bioconductor package DESeq2.

We first only consider the strong dependencies upstream of DESeq2.

dep_in_session("DESeq2", db = db, dep_group = "strong")
%0 DESeq2 DESeq2 S4Vectors S4Vectors DESeq2->S4Vectors IRanges IRanges DESeq2->IRanges GenomicRanges GenomicRanges DESeq2->GenomicRanges SummarizedExperiment SummarizedExperiment DESeq2->SummarizedExperiment Biobase Biobase DESeq2->Biobase BiocParallel BiocParallel DESeq2->BiocParallel locfit locfit DESeq2->locfit ggplot2 ggplot2 DESeq2->ggplot2 BiocGenerics BiocGenerics DESeq2->BiocGenerics matrixStats matrixStats DESeq2->matrixStats Rcpp Rcpp DESeq2->Rcpp DESeq2->Rcpp S4Vectors->BiocGenerics IRanges->S4Vectors IRanges->S4Vectors IRanges->BiocGenerics GenomicRanges->S4Vectors GenomicRanges->S4Vectors GenomicRanges->IRanges GenomicRanges->IRanges GenomeInfoDb GenomeInfoDb GenomicRanges->GenomeInfoDb XVector XVector GenomicRanges->XVector GenomicRanges->BiocGenerics SummarizedExperiment->S4Vectors SummarizedExperiment->IRanges SummarizedExperiment->GenomicRanges SummarizedExperiment->Biobase SummarizedExperiment->GenomeInfoDb MatrixGenerics MatrixGenerics SummarizedExperiment->MatrixGenerics Matrix Matrix SummarizedExperiment->Matrix S4Arrays S4Arrays SummarizedExperiment->S4Arrays DelayedArray DelayedArray SummarizedExperiment->DelayedArray SummarizedExperiment->BiocGenerics tools tools SummarizedExperiment->tools Biobase->BiocGenerics parallel parallel BiocParallel->parallel codetools codetools BiocParallel->codetools lattice lattice locfit->lattice gtable gtable ggplot2->gtable lifecycle lifecycle ggplot2->lifecycle scales scales ggplot2->scales tibble tibble ggplot2->tibble vctrs vctrs ggplot2->vctrs cli cli ggplot2->cli glue glue ggplot2->glue grid grid ggplot2->grid rlang rlang ggplot2->rlang GenomeInfoDb->S4Vectors GenomeInfoDb->IRanges RCurl RCurl GenomeInfoDb->RCurl GenomeInfoDb->BiocGenerics GenomeInfoDbData GenomeInfoDbData GenomeInfoDb->GenomeInfoDbData XVector->S4Vectors XVector->S4Vectors XVector->S4Vectors XVector->IRanges XVector->IRanges XVector->IRanges XVector->BiocGenerics XVector->BiocGenerics XVector->tools zlibbioc zlibbioc XVector->zlibbioc MatrixGenerics->matrixStats Matrix->lattice Matrix->grid S4Arrays->S4Vectors S4Arrays->S4Vectors S4Arrays->IRanges S4Arrays->Matrix S4Arrays->BiocGenerics abind abind S4Arrays->abind crayon crayon S4Arrays->crayon DelayedArray->S4Vectors DelayedArray->S4Vectors DelayedArray->IRanges DelayedArray->MatrixGenerics DelayedArray->Matrix DelayedArray->S4Arrays DelayedArray->BiocGenerics parallel->tools compiler compiler parallel->compiler lattice->grid gtable->lifecycle gtable->cli gtable->glue gtable->grid gtable->rlang lifecycle->cli lifecycle->glue lifecycle->rlang scales->lifecycle munsell munsell scales->munsell scales->rlang R6 R6 scales->R6 tibble->lifecycle tibble->vctrs pillar pillar tibble->pillar tibble->rlang fansi fansi tibble->fansi magrittr magrittr tibble->magrittr pkgconfig pkgconfig tibble->pkgconfig vctrs->lifecycle vctrs->cli vctrs->glue vctrs->rlang bitops bitops RCurl->bitops colorspace colorspace munsell->colorspace pillar->lifecycle pillar->vctrs pillar->cli pillar->glue pillar->rlang pillar->fansi utf8 utf8 pillar->utf8 dplyr dplyr tidyselect tidyselect generics generics

It is already very complicated, but still interesting that DESeq2’s dependencies can be nicely separated into two groups. The first group is related to Bioconductor packages and a lot of them are directly attached to the search path (red box: visible in search path; red link: the “Depends” relation); while the second group is mainly related to ggplot2 and its upstream packages, which all are loaded indirectly into the R session (blue link: the “Imports” relation).

And what if we include all dependency types? Now we need to change the layout to “top-bottom” style. As we can see, a simple command library(DESeq2) brings a dependency monster to your R session.

dep_in_session("DESeq2", db = db, dep_group = "all", rankdir = "TB")
%0 DESeq2 DESeq2 S4Vectors S4Vectors DESeq2->S4Vectors IRanges IRanges DESeq2->IRanges GenomicRanges GenomicRanges DESeq2->GenomicRanges SummarizedExperiment SummarizedExperiment DESeq2->SummarizedExperiment BiocGenerics BiocGenerics DESeq2->BiocGenerics Biobase Biobase DESeq2->Biobase BiocParallel BiocParallel DESeq2->BiocParallel matrixStats matrixStats DESeq2->matrixStats locfit locfit DESeq2->locfit ggplot2 ggplot2 DESeq2->ggplot2 Rcpp Rcpp DESeq2->Rcpp DESeq2->Rcpp S4Vectors->IRanges S4Vectors->GenomicRanges S4Vectors->SummarizedExperiment S4Vectors->BiocGenerics Matrix Matrix S4Vectors->Matrix DelayedArray DelayedArray S4Vectors->DelayedArray IRanges->S4Vectors IRanges->S4Vectors IRanges->GenomicRanges IRanges->BiocGenerics XVector XVector IRanges->XVector GenomicRanges->DESeq2 GenomicRanges->S4Vectors GenomicRanges->S4Vectors GenomicRanges->IRanges GenomicRanges->IRanges GenomicRanges->SummarizedExperiment GenomicRanges->BiocGenerics GenomicRanges->Biobase GenomicRanges->Matrix GenomicRanges->XVector GenomeInfoDb GenomeInfoDb GenomicRanges->GenomeInfoDb SummarizedExperiment->S4Vectors SummarizedExperiment->IRanges SummarizedExperiment->GenomicRanges SummarizedExperiment->BiocGenerics SummarizedExperiment->Biobase SummarizedExperiment->Matrix SummarizedExperiment->DelayedArray SummarizedExperiment->GenomeInfoDb MatrixGenerics MatrixGenerics SummarizedExperiment->MatrixGenerics S4Arrays S4Arrays SummarizedExperiment->S4Arrays tools tools SummarizedExperiment->tools BiocGenerics->DESeq2 BiocGenerics->S4Vectors BiocGenerics->IRanges BiocGenerics->GenomicRanges BiocGenerics->Biobase BiocGenerics->DelayedArray Biobase->BiocGenerics Biobase->tools BiocParallel->GenomicRanges BiocParallel->BiocGenerics parallel parallel BiocParallel->parallel BiocParallel->tools codetools codetools BiocParallel->codetools matrixStats->ggplot2 lattice lattice locfit->lattice ggplot2->lattice cli cli ggplot2->cli glue glue ggplot2->glue gtable gtable ggplot2->gtable lifecycle lifecycle ggplot2->lifecycle rlang rlang ggplot2->rlang scales scales ggplot2->scales tibble tibble ggplot2->tibble vctrs vctrs ggplot2->vctrs dplyr dplyr ggplot2->dplyr munsell munsell ggplot2->munsell grid grid ggplot2->grid Matrix->lattice Matrix->grid DelayedArray->S4Vectors DelayedArray->S4Vectors DelayedArray->IRanges DelayedArray->SummarizedExperiment DelayedArray->BiocGenerics DelayedArray->BiocParallel DelayedArray->Matrix DelayedArray->MatrixGenerics DelayedArray->S4Arrays XVector->S4Vectors XVector->S4Vectors XVector->S4Vectors XVector->IRanges XVector->IRanges XVector->IRanges XVector->BiocGenerics XVector->BiocGenerics XVector->tools zlibbioc zlibbioc XVector->zlibbioc GenomeInfoDb->S4Vectors GenomeInfoDb->IRanges GenomeInfoDb->GenomicRanges GenomeInfoDb->BiocGenerics RCurl RCurl GenomeInfoDb->RCurl GenomeInfoDbData GenomeInfoDbData GenomeInfoDb->GenomeInfoDbData MatrixGenerics->SummarizedExperiment MatrixGenerics->matrixStats MatrixGenerics->Matrix MatrixGenerics->DelayedArray S4Arrays->S4Vectors S4Arrays->S4Vectors S4Arrays->IRanges S4Arrays->BiocGenerics S4Arrays->BiocParallel S4Arrays->Matrix S4Arrays->DelayedArray abind abind S4Arrays->abind crayon crayon S4Arrays->crayon parallel->tools compiler compiler parallel->compiler colorspace colorspace lattice->colorspace lattice->grid cli->glue cli->rlang cli->tibble cli->crayon glue->ggplot2 glue->vctrs glue->dplyr magrittr magrittr glue->magrittr glue->crayon gtable->ggplot2 gtable->cli gtable->glue gtable->lifecycle gtable->rlang gtable->grid lifecycle->cli lifecycle->glue lifecycle->rlang lifecycle->tibble lifecycle->vctrs lifecycle->tools lifecycle->crayon rlang->cli rlang->glue rlang->tibble rlang->vctrs rlang->magrittr pillar pillar rlang->pillar rlang->crayon scales->ggplot2 scales->lifecycle scales->rlang scales->munsell R6 R6 scales->R6 tibble->ggplot2 tibble->cli tibble->lifecycle tibble->rlang tibble->vctrs tibble->dplyr tibble->magrittr tibble->pillar tibble->crayon fansi fansi tibble->fansi pkgconfig pkgconfig tibble->pkgconfig vctrs->cli vctrs->glue vctrs->lifecycle vctrs->rlang vctrs->tibble vctrs->dplyr vctrs->pillar generics generics vctrs->generics vctrs->crayon dplyr->ggplot2 dplyr->cli dplyr->glue dplyr->lifecycle dplyr->rlang dplyr->tibble dplyr->vctrs dplyr->magrittr dplyr->pillar dplyr->generics tidyselect tidyselect dplyr->tidyselect dplyr->R6 munsell->ggplot2 munsell->colorspace magrittr->rlang bitops bitops RCurl->bitops colorspace->ggplot2 colorspace->scales colorspace->dplyr colorspace->grid pillar->ggplot2 pillar->cli pillar->glue pillar->lifecycle pillar->rlang pillar->scales pillar->tibble pillar->vctrs pillar->dplyr utf8 utf8 pillar->utf8 pillar->fansi generics->tibble tidyselect->cli tidyselect->glue tidyselect->lifecycle tidyselect->rlang tidyselect->tibble tidyselect->vctrs tidyselect->dplyr tidyselect->magrittr tidyselect->crayon utf8->cli utf8->rlang

Last, let’s check when freshly loading a very heavy package Seurat.

dep_in_session("Seurat", db = db, dep_group = "strong")
%0 Seurat Seurat SeuratObject SeuratObject Seurat->SeuratObject cowplot cowplot Seurat->cowplot fastDummies fastDummies Seurat->fastDummies fitdistrplus fitdistrplus Seurat->fitdistrplus future future Seurat->future future.apply future.apply Seurat->future.apply ggplot2 ggplot2 Seurat->ggplot2 ggrepel ggrepel Seurat->ggrepel ggridges ggridges Seurat->ggridges httr httr Seurat->httr igraph igraph Seurat->igraph irlba irlba Seurat->irlba leiden leiden Seurat->leiden lifecycle lifecycle Seurat->lifecycle lmtest lmtest Seurat->lmtest Matrix Matrix Seurat->Matrix miniUI miniUI Seurat->miniUI patchwork patchwork Seurat->patchwork pbapply pbapply Seurat->pbapply plotly plotly Seurat->plotly progressr progressr Seurat->progressr purrr purrr Seurat->purrr RcppAnnoy RcppAnnoy Seurat->RcppAnnoy RcppHNSW RcppHNSW Seurat->RcppHNSW reticulate reticulate Seurat->reticulate RSpectra RSpectra Seurat->RSpectra Rtsne Rtsne Seurat->Rtsne scales scales Seurat->scales scattermore scattermore Seurat->scattermore sctransform sctransform Seurat->sctransform shiny shiny Seurat->shiny spatstat.explore spatstat.explore Seurat->spatstat.explore spatstat.geom spatstat.geom Seurat->spatstat.geom tibble tibble Seurat->tibble uwot uwot Seurat->uwot cluster cluster Seurat->cluster generics generics Seurat->generics grid grid Seurat->grid ica ica Seurat->ica jsonlite jsonlite Seurat->jsonlite KernSmooth KernSmooth Seurat->KernSmooth MASS MASS Seurat->MASS matrixStats matrixStats Seurat->matrixStats png png Seurat->png RANN RANN Seurat->RANN RColorBrewer RColorBrewer Seurat->RColorBrewer Rcpp Rcpp Seurat->Rcpp Seurat->Rcpp rlang rlang Seurat->rlang ROCR ROCR Seurat->ROCR tools tools Seurat->tools SeuratObject->future SeuratObject->future.apply SeuratObject->lifecycle SeuratObject->Matrix SeuratObject->progressr sp sp SeuratObject->sp spam spam SeuratObject->spam SeuratObject->generics SeuratObject->grid SeuratObject->Rcpp SeuratObject->Rcpp SeuratObject->rlang SeuratObject->tools cowplot->ggplot2 cowplot->scales gtable gtable cowplot->gtable cowplot->grid cowplot->rlang fastDummies->tibble stringr stringr fastDummies->stringr data.table data.table fastDummies->data.table survival survival fitdistrplus->survival fitdistrplus->MASS globals globals future->globals parallel parallel future->parallel parallelly parallelly future->parallelly digest digest future->digest listenv listenv future->listenv future.apply->future future.apply->globals future.apply->parallel ggplot2->lifecycle ggplot2->scales ggplot2->tibble ggplot2->gtable vctrs vctrs ggplot2->vctrs ggplot2->grid ggplot2->MASS ggplot2->rlang cli cli ggplot2->cli glue glue ggplot2->glue ggrepel->ggplot2 ggrepel->scales ggrepel->grid ggrepel->Rcpp ggrepel->Rcpp ggrepel->rlang ggridges->ggplot2 ggridges->scales ggridges->grid mime mime httr->mime httr->jsonlite R6 R6 httr->R6 igraph->lifecycle igraph->Matrix igraph->rlang igraph->cli magrittr magrittr igraph->magrittr pkgconfig pkgconfig igraph->pkgconfig irlba->Matrix irlba->Matrix leiden->igraph leiden->Matrix leiden->reticulate lifecycle->rlang lifecycle->cli lifecycle->glue zoo zoo lmtest->zoo lattice lattice Matrix->lattice Matrix->grid miniUI->shiny htmltools htmltools miniUI->htmltools patchwork->ggplot2 patchwork->gtable patchwork->grid patchwork->rlang patchwork->cli pbapply->parallel plotly->ggplot2 plotly->httr plotly->purrr plotly->scales plotly->tibble plotly->vctrs plotly->htmltools htmlwidgets htmlwidgets plotly->htmlwidgets tidyr tidyr plotly->tidyr dplyr dplyr plotly->dplyr promises promises plotly->promises plotly->jsonlite plotly->RColorBrewer plotly->rlang plotly->tools plotly->data.table plotly->digest plotly->magrittr viridisLite viridisLite plotly->viridisLite lazyeval lazyeval plotly->lazyeval progressr->digest purrr->lifecycle purrr->vctrs purrr->rlang purrr->cli purrr->cli purrr->magrittr RcppAnnoy->Rcpp RcppAnnoy->Rcpp RcppHNSW->Rcpp RcppHNSW->Rcpp reticulate->Matrix reticulate->jsonlite reticulate->png reticulate->Rcpp reticulate->Rcpp reticulate->rlang RSpectra->Matrix RSpectra->Rcpp RSpectra->Rcpp Rtsne->Rcpp Rtsne->Rcpp scales->lifecycle munsell munsell scales->munsell scales->RColorBrewer scales->rlang scales->R6 scales->viridisLite scattermore->ggplot2 scattermore->scales scattermore->grid sctransform->future sctransform->future.apply sctransform->ggplot2 sctransform->Matrix sctransform->dplyr reshape2 reshape2 sctransform->reshape2 gridExtra gridExtra sctransform->gridExtra sctransform->MASS sctransform->matrixStats sctransform->Rcpp sctransform->rlang sctransform->magrittr shiny->lifecycle shiny->mime shiny->htmltools shiny->promises httpuv httpuv shiny->httpuv later later shiny->later ellipsis ellipsis shiny->ellipsis shiny->jsonlite shiny->rlang shiny->tools shiny->digest shiny->glue shiny->R6 xtable xtable shiny->xtable fastmap fastmap shiny->fastmap spatstat.explore->Matrix spatstat.explore->spatstat.geom spatstat.data spatstat.data spatstat.explore->spatstat.data spatstat.random spatstat.random spatstat.explore->spatstat.random nlme nlme spatstat.explore->nlme spatstat.sparse spatstat.sparse spatstat.explore->spatstat.sparse spatstat.utils spatstat.utils spatstat.explore->spatstat.utils goftest goftest spatstat.explore->goftest abind abind spatstat.explore->abind spatstat.geom->spatstat.data spatstat.geom->spatstat.utils deldir deldir spatstat.geom->deldir polyclip polyclip spatstat.geom->polyclip tibble->lifecycle tibble->vctrs pillar pillar tibble->pillar tibble->rlang tibble->magrittr tibble->pkgconfig fansi fansi tibble->fansi uwot->irlba uwot->Matrix uwot->RcppAnnoy uwot->RcppAnnoy uwot->Rcpp uwot->Rcpp sp->lattice sp->grid spam->grid spam->Rcpp spam->Rcpp dotCall64 dotCall64 spam->dotCall64 gtable->lifecycle gtable->grid gtable->rlang gtable->cli gtable->glue stringr->lifecycle stringr->vctrs stringi stringi stringr->stringi stringr->rlang stringr->cli stringr->glue stringr->magrittr survival->Matrix splines splines survival->splines codetools codetools globals->codetools parallel->tools compiler compiler parallel->compiler parallelly->parallel parallelly->tools vctrs->lifecycle vctrs->rlang vctrs->cli vctrs->glue mime->tools zoo->lattice lattice->grid htmltools->ellipsis htmltools->rlang htmltools->digest htmltools->fastmap htmlwidgets->htmltools htmlwidgets->jsonlite tidyr->lifecycle tidyr->purrr tidyr->tibble tidyr->stringr tidyr->vctrs tidyr->dplyr tidyselect tidyselect tidyr->tidyselect tidyr->rlang tidyr->cli tidyr->glue tidyr->magrittr dplyr->lifecycle dplyr->tibble dplyr->vctrs dplyr->pillar dplyr->tidyselect dplyr->generics dplyr->rlang dplyr->cli dplyr->glue dplyr->R6 dplyr->magrittr promises->later promises->later promises->Rcpp promises->Rcpp promises->rlang promises->R6 promises->magrittr promises->fastmap colorspace colorspace munsell->colorspace reshape2->stringr plyr plyr reshape2->plyr reshape2->Rcpp reshape2->Rcpp gridExtra->gtable gridExtra->grid httpuv->promises httpuv->later httpuv->later httpuv->Rcpp httpuv->Rcpp httpuv->R6 later->Rcpp later->Rcpp later->rlang ellipsis->rlang spatstat.data->Matrix spatstat.data->spatstat.utils spatstat.random->spatstat.geom spatstat.random->spatstat.data spatstat.random->spatstat.utils nlme->lattice spatstat.sparse->Matrix spatstat.sparse->spatstat.utils spatstat.sparse->abind tensor tensor spatstat.sparse->tensor pillar->lifecycle pillar->vctrs pillar->rlang pillar->cli pillar->glue pillar->fansi utf8 utf8 pillar->utf8 stringi->tools tidyselect->lifecycle tidyselect->vctrs tidyselect->rlang tidyselect->cli tidyselect->glue plyr->Rcpp plyr->Rcpp

And you can try the moster below. I will not execute it in this document.

dep_in_session("Seurat", db = db, dep_group = "all")