# #设置,包括= FALSE ----------------------------------------------------- 库(netSmooth)图书馆(pheatmap)图书馆(SingleCellExperiment) # #——netsum回声= FALSE,无花果。帽= " Network-smoothing概念 "-------------------- # 所有违约knitr: include_graphics(“bckgrnd.png ") ## ---- 回声= TRUE --------------------------------------------------------------- 数据(smallPPI)数据(smallscRNAseq ) ## ---- 回声= TRUE, eval = TRUE ---------------------------------------------------- smallscRNAseq.sm.se < - netSmooth (smallscRNAseq smallPPIα= 0.5)smallscRNAseq.sm.sce < SingleCellExperiment(化验=列表(数量=化验(smallscRNAseq.sm.se)),colData = colData (smallscRNAseq.sm.se ) ) ## ---- 回声= TRUE, eval = TRUE ---------------------------------------------------- 庵野。df <- data.frame(cell.type=colData(smallscRNAseq)$source_name_ch1) rownames(anno.df) <- colnames(smallscRNAseq) pheatmap(log2(assay(smallscRNAseq)+1), annotation_col = anno.df)df, show_rownames = FALSE, show_colnames = FALSE, main="before netSmooth") pheatmap(log2(assay(smallscRNAseq.sm.sce)+1), annotation_col = anno. df, show_rownames = FALSE, main="before netSmooth")df, show_rownames =FALSE, show_colnames =FALSE, main="after netSmooth") ## ---- echo=TRUE, eval=FALSE--------------------------------------------------- # smallscRNAseq.sm.se <- netSmooth(smallscRNAseq, smallPPI, alpha='auto') # smallscRNAseq.sm.sce <- SingleCellExperiment(# assays=list(counts=assay(smallscRNAseq.sm.se)), # colData=colData(smallscRNAseq.sm.se) #) # pheatmap(log2(assay(smallscRNAseq.sm.sce)+1), annotation_col = anno。df, # show_rownames = FALSE, show_colnames = FALSE, #主要= " netSmooth后(最优α )") ## ---- 回声= TRUE, eval = TRUE ---------------------------------------------------- yhat < - robustClusters (smallscRNAseq makeConsensusMinSize = 2, makeConsensusProportion =。9)集群yhat美元。sm <- robustClusters(smallscRNAseq.sm. sm)。, makeConsensusMinSize=2, makeConsensusProportion=.9)$群集单元格。类型<- colData(smallscRNAseq)$source_name_ch1 knitr::kable(表(单元格。类型,yhat),标题= '单元格类型和' robustClusters '在原始数据。')编织者::kable(表(单元格。类型,yhat.sm),标题= '单元格类型和' robustClusters '在平滑的数据。') ## ----echo=TRUE, eval=TRUE---------------------------------------------------- smallscRNAseq <- runPCA(smallscRNAseq, ncomponents=2) smallscRNAseq <- runTSNE(smallscRNAseq, ncomponents=2) smallscRNAseq <- runUMAP(smallscRNAseq, ncomponents=2) smallscRNAseq, plotPCA(smallscRNAseq, color_by ='source_name_ch1') + ggtitle("PCA plot") plotTSNE(smallscRNAseq, color_by ='source_name_ch1') + ggtitle("tSNE plot") plotUMAP(smallscRNAseq, color_by ='source_name_ch1') + ggtitle("tSNE plot") plotUMAP(smallscRNAseq, color_by ='source_name_ch1') + ggtitle("UMAP plot") ## ----echo=TRUE,eval = TRUE ----------------------------------------------------- pickDimReduction (smallscRNAseq ) ## ----------------------------------------------------------------------------- sessionInfo ()