Changes between Version 25 and Version 26 of FAQ


Ignore:
Timestamp:
04/23/24 14:25:49 (9 months ago)
Author:
xinlei.gao
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • FAQ

    v25 v26  
    248248}}}
    249249  * This command directs R to use a specific library path where Seurat version 4 is installed, ensuring compatibility with older datasets or software requirements.
    250 
     250  * However, sometimes Seurat may depend on other R packages to run certain functions, in that case, only loading the older version of Seurat may not work. Instead, we could explicitly load all R packages from the last R library set to keep the packages compatible.
     251{{{
     252set_lib_paths <- function(lib_vec) {
     253  lib_vec <- normalizePath(lib_vec, mustWork = TRUE)
     254  shim_fun <- .libPaths
     255  shim_env <- new.env(parent = environment(shim_fun))
     256  shim_env$.Library <- character()
     257  shim_env$.Library.site <- character()
     258  environment(shim_fun) <- shim_env
     259  shim_fun(lib_vec)
     260}
     261
     262set_lib_paths(c("/nfs/apps/lib/R/4.2-focal/site-library.2023q1", "/opt/R/4.2.1/lib/R/library"))
     263
     264library(Seurat)
     265# load other required packages, e.g. scPred, for cell type annotation.
     266library(scPred)
     267}}}
     268  * By running the codes above, all the required R packages will be loaded from the previous R library set (2023q1).
     269
     270