# #——回声= FALSE,结果=“隐藏”,消息= FALSE ------------------------------- 美元knitr: opts_chunk集(错误= FALSE,消息= FALSE,警告= FALSE)图书馆(BiocStyle ) ## ----------------------------------------------------------------------------- 图书馆(celldex) hpca。hpca. se <- HumanPrimaryCellAtlasData()se ## ----------------------------------------------------------------------------- 库(scRNAseq)为< - LaMannoBrainData(“人类胚胎”)为< -为[1:10 0 ] ## ----------------------------------------------------------------------------- pred库(单)。hesc <- SingleR(test = hesc, ref = hpca.)se, assay.type。测试= 1,标签= hpca.se label.main美元 ) ## ----------------------------------------------------------------------------- pred。table(pred.hesc$labels) ## ----------------------------------------------------------------------------- library(scRNAseq) sceM <- MuraroPancreasData() #此时应该进行基于单元格的质量控制,但为了简洁起见,我们将在这里删除未标记的库。sceM <- sceM[,!is.na(sceM$label)] # SingleR()期望对参考数据集进行规范化和日志转换。库(天窗)sceM < - logNormCounts (sceM ) ## ----------------------------------------------------------------------------- sceG < - GrunPancreasData () sceG < - sceG [, colSums(计数(sceG)) > 0] #删除库没有计数。sceG < - logNormCounts (sceG ) ## ----------------------------------------------------------------------------- pred。grun < -单(测试= sceG ref = sceM标签= sceM $标签,de.method = wilcox)表(pred.grun $标签 ) ## ----------------------------------------------------------------------------- plotScoreHeatmap (pred.grun ) ## ----------------------------------------------------------------------------- plotDeltaDistribution (pred。grun ncol = 3 ) ## ----------------------------------------------------------------------------- 总结(is.na (pred.grun pruned.labels美元 )) ## ----------------------------------------------------------------------------- 所有人。标记<-元数据(pred.grun)$de。基因sceG$标签<- pred。grun标签#美元β闲暇的标记库(嘘)plotHeatmap (sceG order_columns_by =“标签”功能=独特(unlist (all.markersβ美元 ))) ## ----------------------------------------------------------------------------- sessionInfo ()