scviR: an R package interfacing Bioconductor and scvi-tools

Overview

scvi-tools is an element of the scverse toolchest for single-cell omics data analysis.

The scviR package is a very elementary approach to interfacing between R, Bioconductor and scvi-tools. The long-term plan is to illustrate several aspects of variational inference (VI) applied to single cell genomics in a way that is convenient for Bioconductor users.

The package makes use of SingleCellExperiment and anndata representations of single-cell genomic assays.

Several points should be kept in mind when using this package:

  • scvi-tools components develop rapidly; we are using basilisk to manage R/python interoperation, and as of current writing we work with version 0.20.0 of scvi-tools. Specific versions of python components are enumerated in the file R/basilisk.R.
  • A docker container based on a PyTorch-oriented image in the NVIDIA container registry includes R 4.2.2 and sufficient python 3 infrastructure to use scvi-tools 0.20.0 and scviR 0.0.2. A Dockerfile is in scviR/inst/Docker; vjcitn/nvidpt_bioc:0.0.2 can be pulled from dockerhub, it reports size 26.5GB. Container resources will be updated as needed. Users should file issues at the package GitHub repo if the container is stale.
  • Code presented in the cite-seq tutorial vignette follows the colab notebook for scvi-tools 0.18.0. We will check for modifications in the scvi-tools 0.20.0 notebook.
  • Additional work on this package will facilitate comparisons between outcomes of Bioconductor, scVI, and other VI-oriented analytic toolkits in the single-cell domain.

Installation and use

As of Feb 2023, use BiocManager to install scviR in R 4.2.2 or above:

BiocManager::install("vjcitn/scviR")

Be sure the remotes package has been installed. If you are working at a slow internet connection, it may be useful to set options(timeout=3600) when running functions

  • getCh12AllSce() (74 MB will be retrieved and cached)
  • getCh12Sce() (58 MB will be retrieved and cached)
  • getCiteseqTutvae() (1.2 GB will be retrieved and cached)
  • getTotalVINormalized5k10k() (191 MB will be retrieved and cached)

Session information

sessionInfo()
## R version 4.4.2 (2024-10-31)
## Platform: x86_64-pc-linux-gnu
## Running under: Ubuntu 24.04.2 LTS
## 
## Matrix products: default
## BLAS:   /usr/lib/x86_64-linux-gnu/openblas-pthread/libblas.so.3 
## LAPACK: /usr/lib/x86_64-linux-gnu/openblas-pthread/libopenblasp-r0.3.26.so;  LAPACK version 3.12.0
## 
## locale:
##  [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C              
##  [3] LC_TIME=en_US.UTF-8        LC_COLLATE=C              
##  [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8   
##  [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                 
##  [9] LC_ADDRESS=C               LC_TELEPHONE=C            
## [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       
## 
## time zone: Etc/UTC
## tzcode source: system (glibc)
## 
## attached base packages:
## [1] stats4    stats     graphics  grDevices utils     datasets  methods  
## [8] base     
## 
## other attached packages:
##  [1] scater_1.35.1               scuttle_1.17.0             
##  [3] reshape2_1.4.4              ggplot2_3.5.1              
##  [5] scviR_1.7.0                 SingleCellExperiment_1.29.1
##  [7] SummarizedExperiment_1.37.0 Biobase_2.67.0             
##  [9] GenomicRanges_1.59.1        GenomeInfoDb_1.43.4        
## [11] IRanges_2.41.3              S4Vectors_0.45.4           
## [13] BiocGenerics_0.53.6         generics_0.1.3             
## [15] MatrixGenerics_1.19.1       matrixStats_1.5.0          
## [17] shiny_1.10.0                basilisk_1.19.1            
## [19] reticulate_1.41.0           BiocStyle_2.35.0           
## 
## loaded via a namespace (and not attached):
##  [1] DBI_1.2.3               gridExtra_2.3           rlang_1.1.5            
##  [4] magrittr_2.0.3          compiler_4.4.2          RSQLite_2.3.9          
##  [7] mgcv_1.9-1              dir.expiry_1.15.0       png_0.1-8              
## [10] vctrs_0.6.5             stringr_1.5.1           pkgconfig_2.0.3        
## [13] crayon_1.5.3            fastmap_1.2.0           dbplyr_2.5.0           
## [16] XVector_0.47.2          labeling_0.4.3          promises_1.3.2         
## [19] rmarkdown_2.29          UCSC.utils_1.3.1        ggbeeswarm_0.7.2       
## [22] purrr_1.0.4             bit_4.5.0.1             xfun_0.51              
## [25] cachem_1.1.0            beachmat_2.23.6         jsonlite_1.9.0         
## [28] blob_1.2.4              later_1.4.1             DelayedArray_0.33.6    
## [31] BiocParallel_1.41.2     irlba_2.3.5.1           parallel_4.4.2         
## [34] R6_2.6.1                stringi_1.8.4           bslib_0.9.0            
## [37] RColorBrewer_1.1-3      limma_3.63.5            jquerylib_0.1.4        
## [40] Rcpp_1.0.14             knitr_1.49              splines_4.4.2          
## [43] httpuv_1.6.15           Matrix_1.7-2            tidyselect_1.2.1       
## [46] abind_1.4-8             yaml_2.3.10             viridis_0.6.5          
## [49] codetools_0.2-20        curl_6.2.1              lattice_0.22-6         
## [52] tibble_3.2.1            plyr_1.8.9              basilisk.utils_1.19.1  
## [55] withr_3.0.2             evaluate_1.0.3          BiocFileCache_2.15.1   
## [58] pillar_1.10.1           BiocManager_1.30.25     filelock_1.0.3         
## [61] munsell_0.5.1           scales_1.3.0            xtable_1.8-4           
## [64] glue_1.8.0              pheatmap_1.0.12         maketools_1.3.2        
## [67] tools_4.4.2             BiocNeighbors_2.1.2     sys_3.4.3              
## [70] ScaledMatrix_1.15.0     buildtools_1.0.0        grid_4.4.2             
## [73] colorspace_2.1-1        nlme_3.1-167            GenomeInfoDbData_1.2.13
## [76] beeswarm_0.4.0          BiocSingular_1.23.0     vipor_0.4.7            
## [79] cli_3.6.4               rsvd_1.0.5              S4Arrays_1.7.3         
## [82] viridisLite_0.4.2       dplyr_1.1.4             gtable_0.3.6           
## [85] sass_0.4.9              digest_0.6.37           SparseArray_1.7.6      
## [88] ggrepel_0.9.6           farver_2.1.2            memoise_2.0.1          
## [91] htmltools_0.5.8.1       lifecycle_1.0.4         httr_1.4.7             
## [94] statmod_1.5.0           mime_0.12               bit64_4.6.0-1