head(cluster2.markers, n = 6) #获取每个cluster的positive标记基因; pbmc.markers <- FindAllMarkers(pbmc, only.pos = TRUE, min.pct = 0.25, logfc.threshold = 0.25) #提取每个cluster差异倍数最大的两个标记基因; library(dplyr) max2<- pbmc.markers %>% group_by(cluster) %>% slice_max(n =...
sce[['cell_type']] = unname(cluster2celltype[sce@meta.data$seurat_clusters]) #绘制散点图,reduction:使用哪种降维。如果没有指定,首先搜索 umap,然后是 tsne,然后是 pca;label:是否标记分群 DimPlot(sce, reduction = 'umap', group.by = 'cell_type', label = TRUE, pt.size = 0.5) + NoLegend...
cluster1.ers <- Finders(pbmc, ident.1 = 0, logfc.threshold = 0.25, test.use = "roc", only.pos = TRUE) 默认情况下,识别单个分簇的 positive and negative ers FindAllers会识别每个分簇的ers,可以测试该分簇与其他分簇或全部细胞的差异 min.pct参数,在两组细胞中的任何一组中检测到的最小百分 ...
head(cluster2.markers, n = 6) #获取每个cluster的positive标记基因; pbmc.markers <- FindAllMarkers(pbmc, only.pos = TRUE, min.pct = 0.25, logfc.threshold = 0.25) #提取每个cluster差异倍数最大的两个标记基因; library(dplyr) max2<- pbmc.markers %>% group_by(cluster) %>% slice_max(n =...
这里会针对每个“batch”分别进行NormalizeData 和 FindVariableFeatures。 2 数据直接合并(不去批次)先尝试直接合并的方式,查看数据的批次情况 #直接整合obj <- FindNeighbors(obj, dims = 1:30, reduction = "pca")obj <- FindClusters(obj, resolution = 2, cluster.name = "unintegrated_clusters")obj <-...
pbmc <- FindNeighbors(pbmc, dims = 1:10) pbmc <- FindClusters(pbmc, resolution = 0.5) # Look at cluster IDs of the first 5 cells head(Idents(pbmc), 5) 非线性降维 Seurat 提供了多种非线性降维技术,例如tSNE和UMAP,以可视化和探索这些数据集。这些算法的目标是学习数据的底层流形,以便将相似的单...
该函数是基于FindNeighbors()构建的SNN图来进行分群。其中参数 resolution 是设置下游聚类分群重要参数,该参数一般设置在0.3-1之间即可,还需针对每个单独的实验数据进行优化。分辨率值越高,簇的数量就越多,对于较大的数据集且复杂组织来说高分辨率能够区分更多的细胞。
该步骤使用FindNeighbors和FindClusters两个函数完成: #计算最邻近距离 pbmc <- FindNeighbors(pbmc, dims = 1:10) #聚类,包含设置下游聚类的“间隔尺度”的分辨率参数resolution ,增加值会导致更多的聚类。 pbmc <- FindClusters(pbmc, resolution = 0.5)
slide.seq <- FindNeighbors(slide.seq, dims = 1:30) slide.seq <- FindClusters(slide.seq, resolution = 0.3, verbose = FALSE) 然后,我们可以在 UMAP space或bead coordinate space中可视化聚类的结果。 plot1 <- DimPlot(slide.seq, reduction ="umap", label = TRUE) ...
obj<-FindNeighbors(obj,dims=1:30,reduction="pca")obj<-FindClusters(obj,resolution=2,cluster.name="unintegrated_clusters")obj<-RunUMAP(obj,dims=1:30,reduction="pca",reduction.name="umap.unintegrated")DimPlot(obj,reduction="umap.unintegrated",group.by=c("stim","seurat_annotations")) ...