# #设置,包括= FALSE --------------------------------------------------- knitr: opts_chunk美元集(崩溃= TRUE,评论= " # > ",错误= FALSE,警告= FALSE,消息= FALSE ) ## ---- 安装,eval = FALSE ------------------------------------------------------ # 如果(!requireNamespace(“BiocManager”,静静地= TRUE) # install.packages (BiocManager) # BiocManager::安装(“HCAData ") ## ---- loadpkg ------------------------------------------------------------------ 图书馆(“HCAData ") ## ---- firstcall ---------------------------------------------------------------- HCAData () ## ---- fetchingdata ------------------------------------------------------------- suppressPackageStartupMessages({库(ExperimentHub)图书馆(SingleCellExperiment)})呃< - ExperimentHub()查询(呃,"HCAData") #这三个是骨髓数据集bonemarrow_h5densematrix <- eh[["EH2047"]] bonemarrow_coldata <- eh[["EH2048"]] bonemarrow_rowdata <- eh[["EH2049"]] #的组件,当调用…sce_bonemarrow < HCAData (ica_bone_marrow) sce_bonemarrow #同样,访问数据集脐带血sce_cordblood < - HCAData(“ica_cord_blood”)sce_cordblood # #——子集 ------------------------------------------------------------------- 库(“残渣”)图书馆(BiocSingular)库(“嘘”)库(“天窗”)set.seed南加州爱迪生公司(42)< - sce_bonemarrow[、样品(seq_len (ncol (sce_bonemarrow)), 1000年,取代= FALSE )] ## ---- featureanno -------------------------------------------------------------- 构成了rowData (rownames (sce) < - uniquifyFeatureNames (sce) $ ID, rowData (sce) $符号)头(rownames (sce))。水户< - grep (MT -“rownames (sce)计数(sce) < - as.matrix南加州爱迪生公司(计数(sce)) <——天窗::addPerCellQC (sce子集=(水= is.mito列表 )) ## ---- clustnorm ---------------------------------------------------------------- lib.sf.bonemarrow < - librarySizeFactors (sce)总结(lib.sf.bonemarrow) set.seed(42)集群< - quickCluster南加州爱迪生公司(sce)表(集群)< - computeSumFactors (sce min.mean = 0.1,南加州爱迪生公司集群=集群)< - logNormCounts (sce) assayNames (sce) # #——hvg ---------------------------------------------------------------------- dec.bonemarrow < - modelGeneVarByPoisson (sce) top.dec < - dec.bonemarrow [(dec。bonemarrow$bio, declined =TRUE),] head(top.dec)适合。Bonemarrow <-元数据(12 . Bonemarrow) plot(适合。bonemarrow意味着美元,健康。bonemarrow $ var, xlab =“日志表达式的意思是”,ylab =“日志表达式的差异”,pch = 16)曲线(fit.bonemarrow美元趋势(x) =上校“dodgerblue”,添加= TRUE, lwd = 2) plotExpression (sce、特性= rownames (top.dec) [1:10 ]) ## ---- dimred ------------------------------------------------------------------- hvg。bonemarrow <- getTopHVGs(dec.;bone bone, prop = 0.1) set.seed(42) sce <- denoisePCA(sce, technical=dec。bonemarrow子集。Row = hvg。bonemarrow BSPARAM = IrlbaParam ()) ncol (reducedDim (, PCA))情节(attr (reducedDim (sce),“percentVar”),xlab =“个人电脑”,ylab =“比例的方差解释”)abline (v = ncol (reducedDim (, PCA)), lty = 2, =“红色”)上校plotPCA (sce ncomponents = 3, colour_by =“subsets_Mito_percent”)set.seed南加州爱迪生公司(42)< - runTSNE (sce dimred =“PCA困惑= 30)plotTSNE (sce colour_by = " subsets_Mito_percent ") ## ---- 集群 ----------------------------------------------------------------- snn。gr < - buildSNNGraph (sce use.dimred = PCA)集群< - igraph:: cluster_walktrap南加州爱迪生公司(snn.gr) < - $集群因子(集群成员美元)表(sce集群美元)plotTSNE (sce colour_by =”集群 ") ## ---- launchisee eval = FALSE --------------------------------------------------- # 如果需要(iSEE)) {# iSEE (sce ) # } ## ---- 保存,eval = FALSE --------------------------------------------------------- # 目的地< -“/ /商店/ /处理/数据。rds“# saveRDS (sce、文件=目的地)# #——sessioninfo -------------------------------------------------------------- sessionInfo ()