scRNA-seq_online 00:包准备

bioinformatics
scRNA-seq
Author

Shixiang Wang

Published

May 31, 2023

参考资料:https://hbctraining.github.io/scRNA-seq_online/

安装包

安装 CRAN 包:

install.packages("BiocManager")
BiocManager::install(c("tidyverse", "Matrix", "RCurl", "scales", "cowplot", "Seurat", "metap"))

安装 Bioc 包:

# options(BioC_mirror="https://mirrors.tuna.tsinghua.edu.cn/bioconductor")
BiocManager::install(c("AnnotationHub", "ensembldb", "multtest", "glmGamPoi"))

测试包的安装

library(Seurat)
## Attaching SeuratObject
library(tidyverse)
## ── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
## ✔ dplyr     1.1.2     ✔ readr     2.1.4
## ✔ forcats   1.0.0     ✔ stringr   1.5.0
## ✔ ggplot2   3.4.2     ✔ tibble    3.2.1
## ✔ lubridate 1.9.2     ✔ tidyr     1.3.0
## ✔ purrr     1.0.1
## ── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
## ✖ dplyr::filter() masks stats::filter()
## ✖ dplyr::lag()    masks stats::lag()
## ℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors
library(Matrix)
## 
## Attaching package: 'Matrix'
## 
## The following objects are masked from 'package:tidyr':
## 
##     expand, pack, unpack
library(RCurl)
## 
## Attaching package: 'RCurl'
## 
## The following object is masked from 'package:tidyr':
## 
##     complete
library(scales)
## 
## Attaching package: 'scales'
## 
## The following object is masked from 'package:purrr':
## 
##     discard
## 
## The following object is masked from 'package:readr':
## 
##     col_factor
library(cowplot)
## 
## Attaching package: 'cowplot'
## 
## The following object is masked from 'package:lubridate':
## 
##     stamp
library(AnnotationHub)
## Loading required package: BiocGenerics
## 
## Attaching package: 'BiocGenerics'
## 
## The following objects are masked from 'package:lubridate':
## 
##     intersect, setdiff, union
## 
## The following objects are masked from 'package:dplyr':
## 
##     combine, intersect, setdiff, union
## 
## The following objects are masked from 'package:stats':
## 
##     IQR, mad, sd, var, xtabs
## 
## The following objects are masked from 'package:base':
## 
##     anyDuplicated, aperm, append, as.data.frame, basename, cbind,
##     colnames, dirname, do.call, duplicated, eval, evalq, Filter, Find,
##     get, grep, grepl, intersect, is.unsorted, lapply, Map, mapply,
##     match, mget, order, paste, pmax, pmax.int, pmin, pmin.int,
##     Position, rank, rbind, Reduce, rownames, sapply, setdiff, sort,
##     table, tapply, union, unique, unsplit, which.max, which.min
## 
## Loading required package: BiocFileCache
## Loading required package: dbplyr
## 
## Attaching package: 'dbplyr'
## 
## The following objects are masked from 'package:dplyr':
## 
##     ident, sql
library(ensembldb)
## Loading required package: GenomicRanges
## Loading required package: stats4
## Loading required package: S4Vectors
## 
## Attaching package: 'S4Vectors'
## 
## The following objects are masked from 'package:Matrix':
## 
##     expand, unname
## 
## The following objects are masked from 'package:lubridate':
## 
##     second, second<-
## 
## The following objects are masked from 'package:dplyr':
## 
##     first, rename
## 
## The following object is masked from 'package:tidyr':
## 
##     expand
## 
## The following objects are masked from 'package:base':
## 
##     expand.grid, I, unname
## 
## Loading required package: IRanges
## 
## Attaching package: 'IRanges'
## 
## The following object is masked from 'package:lubridate':
## 
##     %within%
## 
## The following objects are masked from 'package:dplyr':
## 
##     collapse, desc, slice
## 
## The following object is masked from 'package:purrr':
## 
##     reduce
## 
## Loading required package: GenomeInfoDb
## Loading required package: GenomicFeatures
## Loading required package: AnnotationDbi
## Loading required package: Biobase
## Welcome to Bioconductor
## 
##     Vignettes contain introductory material; view with
##     'browseVignettes()'. To cite Bioconductor, see
##     'citation("Biobase")', and for packages 'citation("pkgname")'.
## 
## 
## Attaching package: 'Biobase'
## 
## The following object is masked from 'package:AnnotationHub':
## 
##     cache
## 
## 
## Attaching package: 'AnnotationDbi'
## 
## The following object is masked from 'package:dplyr':
## 
##     select
## 
## Loading required package: AnnotationFilter
## 
## Attaching package: 'ensembldb'
## 
## The following object is masked from 'package:dplyr':
## 
##     filter
## 
## The following object is masked from 'package:stats':
## 
##     filter

查看会话信息

R version 4.2.2 (2022-10-31)
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.2/Resources/lib/libRblas.0.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/4.2/Resources/lib/libRlapack.dylib

locale:
[1] zh_CN.UTF-8/zh_CN.UTF-8/zh_CN.UTF-8/C/zh_CN.UTF-8/zh_CN.UTF-8

attached base packages:
[1] stats4    stats     graphics  grDevices utils     datasets  methods  
[8] base     

other attached packages:
 [1] ensembldb_2.22.0        AnnotationFilter_1.22.0 GenomicFeatures_1.50.4 
 [4] AnnotationDbi_1.60.2    Biobase_2.58.0          GenomicRanges_1.50.2   
 [7] GenomeInfoDb_1.34.9     IRanges_2.32.0          S4Vectors_0.36.2       
[10] AnnotationHub_3.6.0     BiocFileCache_2.6.1     dbplyr_2.3.2           
[13] BiocGenerics_0.44.0     cowplot_1.1.1           scales_1.2.1           
[16] RCurl_1.98-1.12         Matrix_1.5-4.1          lubridate_1.9.2        
[19] forcats_1.0.0           stringr_1.5.0           dplyr_1.1.2            
[22] purrr_1.0.1             readr_2.1.4             tidyr_1.3.0            
[25] tibble_3.2.1            ggplot2_3.4.2           tidyverse_2.0.0        
[28] SeuratObject_4.1.3      Seurat_4.3.0           

loaded via a namespace (and not attached):
  [1] utf8_1.2.3                    spatstat.explore_3.2-1       
  [3] reticulate_1.28               tidyselect_1.2.0             
  [5] RSQLite_2.3.1                 htmlwidgets_1.6.2            
  [7] grid_4.2.2                    BiocParallel_1.32.6          
  [9] Rtsne_0.16                    munsell_0.5.0                
 [11] codetools_0.2-19              ica_1.0-3                    
 [13] future_1.32.0                 miniUI_0.1.1.1               
 [15] withr_2.5.0                   spatstat.random_3.1-5        
 [17] colorspace_2.1-0              progressr_0.13.0             
 [19] filelock_1.0.2                knitr_1.43                   
 [21] rstudioapi_0.14               ROCR_1.0-11                  
 [23] tensor_1.5                    listenv_0.9.0                
 [25] MatrixGenerics_1.10.0         GenomeInfoDbData_1.2.9       
 [27] polyclip_1.10-4               bit64_4.0.5                  
 [29] parallelly_1.36.0             vctrs_0.6.2                  
 [31] generics_0.1.3                xfun_0.39                    
 [33] timechange_0.2.0              R6_2.5.1                     
 [35] bitops_1.0-7                  spatstat.utils_3.0-3         
 [37] cachem_1.0.8                  DelayedArray_0.24.0          
 [39] promises_1.2.0.1              BiocIO_1.8.0                 
 [41] gtable_0.3.3                  globals_0.16.2               
 [43] goftest_1.2-3                 rlang_1.1.1                  
 [45] splines_4.2.2                 rtracklayer_1.58.0           
 [47] lazyeval_0.2.2                spatstat.geom_3.2-1          
 [49] BiocManager_1.30.20           yaml_2.3.7                   
 [51] reshape2_1.4.4                abind_1.4-5                  
 [53] httpuv_1.6.11                 tools_4.2.2                  
 [55] ellipsis_0.3.2                RColorBrewer_1.1-3           
 [57] ggridges_0.5.4                Rcpp_1.0.10                  
 [59] plyr_1.8.8                    progress_1.2.2               
 [61] zlibbioc_1.44.0               prettyunits_1.1.1            
 [63] deldir_1.0-9                  pbapply_1.7-0                
 [65] zoo_1.8-12                    SummarizedExperiment_1.28.0  
 [67] ggrepel_0.9.3                 cluster_2.1.4                
 [69] magrittr_2.0.3                data.table_1.14.8            
 [71] scattermore_1.1               lmtest_0.9-40                
 [73] RANN_2.6.1                    ProtGenerics_1.30.0          
 [75] fitdistrplus_1.1-11           matrixStats_0.63.0           
 [77] hms_1.1.3                     patchwork_1.1.2              
 [79] mime_0.12                     evaluate_0.21                
 [81] xtable_1.8-4                  XML_3.99-0.14                
 [83] gridExtra_2.3                 compiler_4.2.2               
 [85] biomaRt_2.54.1                KernSmooth_2.23-21           
 [87] crayon_1.5.2                  htmltools_0.5.5              
 [89] later_1.3.1                   tzdb_0.4.0                   
 [91] DBI_1.1.3                     MASS_7.3-60                  
 [93] rappdirs_0.3.3                cli_3.6.1                    
 [95] parallel_4.2.2                igraph_1.4.3                 
 [97] pkgconfig_2.0.3               GenomicAlignments_1.34.1     
 [99] sp_1.6-0                      plotly_4.10.1                
[101] spatstat.sparse_3.0-1         xml2_1.3.4                   
[103] XVector_0.38.0                digest_0.6.31                
[105] sctransform_0.3.5             RcppAnnoy_0.0.20             
[107] spatstat.data_3.0-1           Biostrings_2.66.0            
[109] rmarkdown_2.21                leiden_0.4.3                 
[111] uwot_0.1.14                   restfulr_0.0.15              
[113] curl_5.0.0                    shiny_1.7.4                  
[115] Rsamtools_2.14.0              rjson_0.2.21                 
[117] lifecycle_1.0.3               nlme_3.1-162                 
[119] jsonlite_1.8.4                viridisLite_0.4.2            
[121] fansi_1.0.4                   pillar_1.9.0                 
[123] lattice_0.21-8                KEGGREST_1.38.0              
[125] fastmap_1.1.1                 httr_1.4.6                   
[127] survival_3.5-5                interactiveDisplayBase_1.36.0
[129] glue_1.6.2                    png_0.1-8                    
[131] BiocVersion_3.16.0            bit_4.0.5                    
[133] stringi_1.7.12                blob_1.2.4                   
[135] memoise_2.0.1                 irlba_2.3.5.1                
[137] future.apply_1.11.0          

阅读

接下来就可以阅读以下两份非常好的材料了解单细胞的预备知识。