Updating Seurat objects

Seurat’s UpdateSeuratObject() can only update objects from the version immediately previous to the version of Seurat you currently have installed (e.g. Seurat v2 –> v3). This means you can’t import an object created in Seurat v1 and directly upgrade it to Seurat v3.

Until this problem is fixed by the Seurat developers, an intermediate solution is to create separate conda environments for each Seurat version (rather then sequentially installing and uninstalling each version of Seurat whenever you want to update an object). We have provided yaml files when can be used to create separate envs for each version of Seurat here.

Beyond object updating, having envs for each legacy version of Seurat might be helpful when running old scripts, as many of the function names and basic functionality changed across Seurat versions.

For more details, see the scKirby conda env tutorial

1. Create each conda env in command line:

#### Seurat v1 #### 
conda env create -f https://github.com/bschilder/scKirby/raw/main/inst/conda/seurat1.yml

#### Seurat v2 #### 
conda env create -f https://github.com/bschilder/scKirby/raw/main/inst/conda/seurat2.yml

#### Seurat v3 #### 
conda env create -f https://github.com/bschilder/scKirby/raw/main/inst/conda/seurat3.yml

#### Seurat v4 #### 
conda env create -f https://github.com/bschilder/scKirby/raw/main/inst/conda/seurat4.yml

2. Activate conda env

conda activate seurat3

3. Activate conda env and start radian

Each conda env comes with radian, a command line interface for R that’s much more user-friendly than the default.

conda activate seurat3
radian 

4. Update object in R

library(Seurat) 
#### Confirm Seurat version ####
packageVersion("Seurat")

#### Load object ####

obj <- readRDS("<path_to_old_seurat_object>")

#### Update object ####
new_obj <- Seurat::UpdateSeuratObject(obj)

Additional conda envs

We also provide conda envs for the single-cell analysis softwares Pegasus and Cell BLAST.

#### Pegasus #### 
conda env create -f https://github.com/bschilder/scKirby/raw/main/inst/conda/pegasus.yml

#### Cell BLAST #### 
conda env create -f https://github.com/bschilder/scKirby/raw/main/inst/conda/cellblast.yml

Session Info

utils::sessionInfo()
#> R version 4.1.0 (2021-05-18)
#> Platform: x86_64-apple-darwin17.0 (64-bit)
#> Running under: macOS Big Sur 10.16
#> 
#> Matrix products: default
#> BLAS:   /Library/Frameworks/R.framework/Versions/4.1/Resources/lib/libRblas.dylib
#> LAPACK: /Library/Frameworks/R.framework/Versions/4.1/Resources/lib/libRlapack.dylib
#> 
#> locale:
#> [1] en_GB.UTF-8/en_GB.UTF-8/en_GB.UTF-8/C/en_GB.UTF-8/en_GB.UTF-8
#> 
#> attached base packages:
#> [1] stats     graphics  grDevices utils     datasets  methods   base     
#> 
#> other attached packages:
#> [1] scKirby_0.1.0
#> 
#> loaded via a namespace (and not attached):
#>  [1] tidyselect_1.1.1  xfun_0.24         bslib_0.2.5.1     purrr_0.3.4      
#>  [5] lattice_0.20-44   colorspace_2.0-2  vctrs_0.3.8       generics_0.1.0   
#>  [9] expm_0.999-6      htmltools_0.5.1.1 yaml_2.2.1        utf8_1.2.1       
#> [13] rlang_0.4.11      e1071_1.7-7       pkgdown_1.6.1     jquerylib_0.1.4  
#> [17] pillar_1.6.1      DBI_1.1.1         glue_1.4.2        rootSolve_1.8.2.1
#> [21] lifecycle_1.0.0   stringr_1.4.0     munsell_0.5.0     gtable_0.3.0     
#> [25] ragg_1.1.3        mvtnorm_1.1-2     memoise_2.0.0     evaluate_0.14    
#> [29] knitr_1.33        fastmap_1.1.0     lmom_2.8          class_7.3-19     
#> [33] fansi_0.5.0       Rcpp_1.0.6        scales_1.1.1      cachem_1.0.5     
#> [37] desc_1.3.0        jsonlite_1.7.2    systemfonts_1.0.2 fs_1.5.0         
#> [41] textshaping_0.3.5 gld_2.6.2         Exact_2.1         ggplot2_3.3.5    
#> [45] digest_0.6.27     stringi_1.6.2     dplyr_1.0.7       rprojroot_2.0.2  
#> [49] grid_4.1.0        tools_4.1.0       magrittr_2.0.1    DescTools_0.99.42
#> [53] sass_0.4.0        proxy_0.4-26      tibble_3.1.2      pkgconfig_2.0.3  
#> [57] crayon_1.4.1      MASS_7.3-54       ellipsis_0.3.2    Matrix_1.3-4     
#> [61] data.table_1.14.0 assertthat_0.2.1  rmarkdown_2.9     rstudioapi_0.13  
#> [65] R6_2.5.0          boot_1.3-28       compiler_4.1.0