首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >seurat包分析多组对比单细胞数据

seurat包分析多组对比单细胞数据

作者头像
生信编程日常
发布2020-04-01 15:33:35
1.3K0
发布2020-04-01 15:33:35
举报
library(Seurat)
#import data
#C_data T_data 为要分析的data.frame

Control<-CreateSeuratObject(counts =C_data,min.cells = 5, min.features = 10,project = "control")
Treat<-CreateSeuratObject(counts =T_data,min.cells = 5, min.features = 10,project = "treat")
#将多个数据合成一个list
T_C<-list(Treat,Control)
names(T_C)<-c("T","C")
#分别对每个找Variable Features
for (i in 1:length(T_C)){
  T_C[[i]]<-FindVariableFeatures(T_C[[i]], selection.method = "vst", 
                       nfeatures = 2000, verbose = FALSE)
}
#找到交集的feature
T_C<- FindIntegrationAnchors(object.list = T_C, dims = 1:20)
#整合数据
T_C <- IntegrateData(anchorset = T_C, dims = 1:20)
DefaultAssay(T_C) <- "integrated"
# Run the standard workflow for visualization and clustering
T_C <- ScaleData(T_C, verbose = FALSE)
T_C <- RunPCA(T_C, npcs = 30, verbose = FALSE)
# t-SNE and Clustering
T_C <- RunUMAP(T_C, reduction = "pca", dims = 1:20)
T_C <- FindNeighbors(T_C, reduction = "pca", dims = 1:20)
T_C <- FindClusters(T_C, resolution = 0.5)
# Visualization
p1 <- DimPlot(T_C, reduction = "umap", group.by = "stim")
p2 <- DimPlot(T_C, reduction = "umap", label = TRUE)
plot_grid(p1, p2)
本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档