## ----style, echo=FALSE, results='hide', message=FALSE, cache=FALSE--------- library(BiocStyle) library(knitr) opts_chunk$set(error=FALSE, message=FALSE, warning=FALSE, cache=TRUE) opts_chunk$set(figure asp=1) ## ---- cache=FALSE, echo=FALSE,结果=“隐藏 "------------------------------ simpleSingleCell::: .compile (tenx) # PBMC ## -------------------------------------------------------------------------- 南加州爱迪生公司库(TENxBrainData) < - TENxBrainData20k() #一次下载和缓存以备将来使用。南加州爱迪生公司 ## -------------------------------------------------------------------------- 计数(sce) object.size(计数(sce) file.info(路径(计数(sce))) $大小 ## -------------------------------------------------------------------------- tmp < -计数(sce) tmp < log2 (tmp + 1) tmp ## -------------------------------------------------------------------------- 南加州爱迪生公司库(嘘)< - calculateQCMetrics (sce、紧凑= TRUE) #压实对清洁输出。sce scater_qc美元 ## -------------------------------------------------------------------------- bpp < - MulticoreParam bpp (2) ## -------------------------------------------------------------------------- bpp < - SnowParam (5) bpp # # - eval = FALSE ----------------------------------------------------------- # bpp < - BatchtoolsParam(10,集群=“粘”很多,# =资源列表(walltime = 20000,内存= 8000,ncpus = 1 )) ## -------------------------------------------------------------------------- alt < calculateQCMetrics (sce BPPARAM = MulticoreParam(2),紧凑的= TRUE ) ## ---- 回声= FALSE ----------------------------------------------------------- 如果(! isTRUE(所有。平等(alt、sce))){停止(“并行化的变化结果 ") } ## -------------------------------------------------------------------------- 所有人。南加州爱迪生公司(alt,平等 ) ## -------------------------------------------------------------------------- 南加州爱迪生公司。pbmc < - readRDS(“pbmc_data.rds ") ## -------------------------------------------------------------------------- 图书馆(BiocNeighbors) snn库(食物)。gr <- buildSNNGraph(sce. exe)pbmc, BNPARAM = AnnoyParam (), use.dimred = " PCA ") ## -------------------------------------------------------------------------- 集群< - igraph: cluster_walktrap南加州爱迪生公司(snn.gr)表(确切的=。pbmc集群美元,约=美元集群成员 ) ## -------------------------------------------------------------------------- 库(BiocSingular) #顾名思义,它是随机的,所以我们需要设置种子。set.seed (999) r.out < - BiocSingular: runPCA (t (logcounts (sce.pbmc)),排名= 20,BSPARAM = RandomParam(延迟= TRUE)) str (r.out) #进行比较:i.out < - BiocSingular:: runPCA (t (logcounts (sce.pbmc)),排名= 20,BSPARAM = IrlbaParam(折=正)str (i.out ) ## -------------------------------------------------------------------------- sessionInfo ()