## ----- knitr-options,echo = false,message = false,警告= false,cache = true ------库(googleVis)op < - option(gvis.plot.tag ='Chart')## ----警告= false,消息= false --------------------------------------------------------------------------------------图书馆(SingleCellexperiment)库(SCMAP)头(ANN)YAN [1:3,1:3] ## -------------------------------------------------------------------------------------------------------------------------------------------------- sce <-singlecellexperiment(assays = list(normcounts = as.matrix(yan)),coldata = ann)logcounts(sce)<-log2(normcounts(sce) + 1)#使用基因名称作为功能符号rowdata(sce)$ feature_symbol <-Rownames(sce)#删除带有重复名称sce <-sce [!repeplicated(rownames(sce))的功能----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------表(rowdata(sce)$ scmap_features)## ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------indexCluster(SCE)## ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- head(metadata(sce)$scmap_cluster_index) ## ---- fig.height=7------------------------------------------------------------ heatmap(as.matrix(metadata(sce)$scmap_cluster_index)) ## ----------------------------------------------------------------------------- scmapCluster_results <- scmapCluster( projection = sce, index_list = list( yan = metadata(sce)$scmap_cluster_index ) ) ## ----------------------------------------------------------------------------- head(scmapCluster_results$scmap_cluster_labs) ## ----------------------------------------------------------------------------- head(scmapCluster_results$scmap_cluster_siml) ## ----------------------------------------------------------------------------- head(scmapCluster_results$combined_labs) ## ----results='asis', tidy=FALSE, eval=FALSE----------------------------------- # plot( # getSankey( # colData(sce)$cell_type1, # scmapCluster_results$scmap_cluster_labs[,'yan'], # plot_height = 400 # ) # ) ## ----------------------------------------------------------------------------- set.seed(1) ## ----message=FALSE, warning=FALSE--------------------------------------------- sce <- indexCell(sce) ## ----------------------------------------------------------------------------- names(metadata(sce)$scmap_cell_index) ## ----------------------------------------------------------------------------- length(metadata(sce)$scmap_cell_index$subcentroids) dim(metadata(sce)$scmap_cell_index$subcentroids[[1]]) metadata(sce)$scmap_cell_index$subcentroids[[1]][,1:5] ## ----------------------------------------------------------------------------- dim(metadata(sce)$scmap_cell_index$subclusters) metadata(sce)$scmap_cell_index$subclusters[1:5,1:5] ## ----------------------------------------------------------------------------- scmapCell_results <- scmapCell( sce, list( yan = metadata(sce)$scmap_cell_index ) ) ## ----------------------------------------------------------------------------- names(scmapCell_results) ## ----------------------------------------------------------------------------- scmapCell_results$yan$cells[,1:3] ## ----------------------------------------------------------------------------- scmapCell_results$yan$similarities[,1:3] ## ----------------------------------------------------------------------------- scmapCell_clusters <- scmapCell2Cluster( scmapCell_results, list( as.character(colData(sce)$cell_type1) ) ) ## ----------------------------------------------------------------------------- head(scmapCell_clusters$scmap_cluster_labs) ## ----------------------------------------------------------------------------- head(scmapCell_clusters$scmap_cluster_siml) ## ----------------------------------------------------------------------------- head(scmapCell_clusters$combined_labs) ## ----results='asis', tidy=FALSE, eval=FALSE----------------------------------- # plot( # getSankey( # colData(sce)$cell_type1, # scmapCell_clusters$scmap_cluster_labs[,"yan"], # plot_height = 400 # ) # ) ## ----echo=FALSE--------------------------------------------------------------- sessionInfo()