单细胞测序的入门操作
(一)数据读入
在GEO数据库中下载数据,分别有三种文件
1.barcodes 条形码,这是drop-seq进行细胞标记,每一个细胞都有自己的barcode
2.features 里面包含了基因的特征,ensemble id以及与之相对应的symle id
3.matrix 里每个细胞基因所对应的count数
library(SingleR)
library(dplyr)
library(Seurat)
library(patchwork)
highfat.data <- Read10X(data.dir = "../../file location")
###通过CreateSeuratObject()创建一个Seurat对象,其包含矩阵数据和各类分析(如Data count 和PCA以及Cluster分析的结果
highfat<- CreateSeuratObject(counts = highfat.data , project = "highfat" , min.cells = 3 , min.features = 200)
### 所有基因都在三个以上细胞表达,每个细胞最少200个基因
View(highfat@meta.data)
(二) 数据的前处理主要包括 数据的清洗,主要是去除低质量的细胞
依据QC质控进行过滤和选择细胞,数据归一化和缩放以及高变化基因特征的选择
一.QC和细胞的选择
1.常用的QC标准 是检测每个细胞中的Unique基因的数目,
a.低质量或者空的Droplet 通常含有很少的基因
b.双个或者多个细胞通常含有异常高的基因
2.每个细胞内总的分子数目也和Unique基因相似
3.线粒体基因组的占比
a.低质量或者死细胞里表现出异常多的线粒体基因组
b.通过PercentageFeatureSet()函数来计算每个特征基因集的占比
c.通过MT-开头来标注线粒体基因组,mt小鼠,MT人类
### 通过小提琴图来可视化QC
highfat[["percent.mt"]] <- PercentageFeatureSet(highfat, pattern = "^mt-")
VlnPlot(highfat, features = c("nFeature_RNA", "nCount_RNA", "percent.mt"), ncol = 3)
plot1 <- FeatureScatter(highfat, feature1 = "nCount_RNA", feature2 = "percent.mt")
plot2 <- FeatureScatter(highfat, feature1 = "nCount_RNA", feature2 = "nFeature_RNA")
plot1 + plot2
###数据过滤,去除基因小于200,大于2500的细胞,线粒体占比小于5
highfat <- subset(highfat, subset = nFeature_RNA > 200 & nFeature_RNA < 2500 & percent.mt < 5)
###去掉了低质量的细胞之后,接下来就是数据的归一化
###主要采用的是局部缩放的LogNormalize 的方法对每个细胞的总表达量乘以缩放因子(默认10000)对每个基因进行归一化。
highfat <- NormalizeData(highfat, normalization.method = "LogNormalize", scale.factor = 10000)
### 寻找高变基因
highfat <- FindVariableFeatures(highfat, selection.method = "vst", nfeatures = 2000)
top10 <- head(VariableFeatures(highfat), 10)
plot1 <- VariableFeaturePlot(highfat)
plot2 <- LabelPoints(plot = plot1, points = top10, repel = TRUE)
plot1 + plot2
(三)数据的合并
###在合并之前要将他们赋予不同组别的信息
highfat$group<-"highfat"
control$group<-"group"
?FindIntegrationAnchors
?IntegrateData
##Find a set of anchors between a list of Seurat objects. These anchors can later be used to integrate the objects using the IntegrateData function.
##Perform dataset integration using a pre-computed AnchorSet.
diet.anchors <- FindIntegrationAnchors(object.list = list(control, highfat), dims = 1:10)
diet.combined <- IntegrateData(anchorset = diet.anchors, dims = 1:10)
DefaultAssay(diet.combined) <- "integrated"
# Run the standard workflow for visualization and clustering
diet.combined <- ScaleData(diet.combined, verbose = FALSE)
diet.combined <- RunPCA(diet.combined, npcs = 30, verbose = FALSE)
# t-SNE and Clustering
diet.combined <- RunUMAP(diet.combined, reduction = "pca", dims = 1:10)
diet.combined <- FindNeighbors(diet.combined, reduction = "pca", dims = 1:10)
diet.combined <- FindClusters(diet.combined, resolution = 0.3)
diet.combined
###取前七个簇
diet<-subset(diet.combined,seurat_clusters %in% c(0:7))
p1 <- DimPlot(diet.combined, reduction = "umap", group.by = "group")
p2 <- DimPlot(diet.combined, reduction = "umap", label = TRUE)
plot_grid(p1, p2)
DimPlot(diet.combined, reduction = "umap", split.by = "group")
(四)差异分析
###Colors single cells on a dimensional reduction plot according to a 'feature' (i.e. gene expression, PC scores, number of genes detected, etc.)
FeaturePlot(diet.combined, features = c("Ccr2", "Lyve1", "Timd4", "Cd9", "Plac8", "Lyz1", "Ear2", "Napsa", "Cd209a"), min.cutoff = "q9")
FeaturePlot(diet.combined, features = c("Ccr2", "Lyve1", "Timd4"), split.by = "group", max.cutoff = 3, cols = c("grey", "red"))
plots <- VlnPlot(diet.combined, features = c("Ccr2", "Lyve1", "Timd4","Lamp2"), split.by = "group", pt.size = 0, combine = FALSE)
CombinePlots(plots = plots, ncol = 1)
### 分组
new.cluster.ids <- c("0", "1", "2", "3", "4", "5", "6", "7")
names(new.cluster.ids)<-levels(diet.combined)
diet.combined<-RenameIdents(diet.combined,new.cluster.ids)
DimPlot(diet.combined,reduction = "umap",label = TRUE,pt.size = 0.5)+NoLegend()
DimPlot(sce,reduction = "umap",label = TRUE)
unique(Idents(sce))
sce$celltype = Idents(sce)
### 寻找差异基因
mydeg <- FindMarkers(diet,ident.1 = '0_control',ident.2 = '0_highfat', verbose = FALSE, test.use = 'wilcox',min.pct = 0.1)
top10 <- mydeg %>% top_n(n = 10, wt = avg_log2FC) %>% row.names()
cg_markers_df=mydeg[abs(mydeg$avg_log2FC) >1,]
单细胞测序的入门操作相关推荐
- 发表Nature等杂志四十多篇论文老师带您学单细胞测序数据挖掘和课题设计 2020年1月11-12日 上海...
两天一夜高强度训练,理论与实战相结合 赠送高清视频供学员复习使用 授课老师 来自中科院,长期从事单细胞多组学方面的项目研究,发表Nature等杂志四十多篇论文,目前承担国家科技部.国家自然基金委和 ...
- 单细胞测序分析之小技巧之for循环批量处理数据和出图
"harmony"整合不同平台的单细胞数据之旅生物信息学习的正确姿势 NGS系列文章包括NGS基础.转录组分析 (Nature重磅综述|关于RNA-seq你想知道的全在这).ChI ...
- 单细胞测序分析及单细胞转录组
单细胞测序技术的应用与数据分析.单细胞转录组为主题,精心设计了具有前沿性.实用性和针对性强的理论课程和上机课程.培训邀请的主讲人均是有理论和实际研究经验的人员.学员通过与专家直接交流,能够分享到这些顶 ...
- 还在单细胞测序?单核更出色
单细胞RNA-seq(single cell RNA-seq, scRNA-seq)是目前用于细胞类型.细胞状态研究的核心工具,很多实验室也同时围绕scRNA-seq技术建立了多种计算方法并且优化了建 ...
- 【单细胞测序攻略:二聚体过滤】DoubletDecon包过滤Seurat对象的二聚体(Doublet)
单细胞测序攻略:二聚体过滤--DoubletDecon包攻略 DoubletDecon介绍 提醒: 1.一直到2020年7月一直在更新,直接对接seurat比较好用 2.需要单个样本全部seurat流 ...
- 单细胞测序之基本的数据处理基本流程
参考文献: Armand EJ, Li J, Xie F, Luo C, Mukamel EA. Single-Cell Sequencing of Brain Cell Transcriptomes ...
- 单细胞测序技术及应用进展
单细胞测序技术及应用进展 作者:朱忠旭 陈新 发表于: 基因组学与应用生物学,2015 年,第34 卷,第5 期,第902-908 页 本文讲了什么? 细胞是生命的单位,然而大多数的人类基因组.癌症或 ...
- 第一批做「单细胞测序」的人,已经上云了
1980年,英国生物化学家Frederick Sanger与美国生物化学家Walter Gilbert建立了DNA测序技术并获得诺贝尔化学奖.在此后的40年时间里,测序技术发生了多次革命. 北京大学的 ...
- 2021年大数据HBase(十):Apache Phoenix的基本入门操作
全网最详细的大数据HBase文章系列,强烈建议收藏加关注! 新文章都已经列出历史文章目录,帮助大家回顾前面的知识重点. 目录 系列历史文章 前言 Apache Phoenix的基本入门操作 一.Pho ...
- v2视频服务器退出系统怎么启动,V2视频会议系统入门操作手册.doc
V2视频会议系统入门操作手册 登陆方式 打开IE(浏览器),用户访问服务器地址00,进入V2 Conference系统主界面. 首次登录视频会议服务器,系统会自动提示客户端下载安装客户端插件,用户也可 ...
最新文章
- oracle测试环境表空间清理
- 【错误记录】执行 Python 程序报错 ( NameError: name ‘reload‘ is not defined )
- 【C++深度剖析教程32】new/malloc区别 delete/free区别
- ld 指令c语言实现,C语言符号、指令表.doc
- spring注入普通java类_普通java类如何取得注入spring Ioc容器的对象
- fit函数 model_深度学习与Tensorflow学习笔记2 ——回调函数callbacks和Tensorboard
- 应用vb编程_VB编程中的列表框综合应用讲解
- 女子800米跑进4分30秒才合格,茅台回应应聘者需体测...
- Just For Fun:在windows下模拟一个windows病毒软件(windows.h)
- 计算机三级嵌入式系统
- 50个面试官最喜欢问的java微服务面试题
- 2018年大数据趋势 :人工智能… 数据分析将包含可视化模型…
- Ubuntu16.04 下安装运行 rovio-slam
- 微软 android启动器,微软启动器Mirosoft Launcher
- 第4届华为编程大赛决赛试题解答(棋盘覆盖)
- 探索R包plyr:脱离R中显式循环
- Kids Photography: At Home 儿童摄影:家庭摄影 Lynda课程中文字幕
- HealthKit 框架详细解析
- excel数据技巧:6条最实用的透视表偏方
- Hardening the media stack
热门文章
- 多屏下dde-dock切换速度太慢
- raid硬盘速度测试软件,RAID 0模式下固态硬盘性能测试
- java api微盘_新浪微盘的API Python版封装
- 【XSY3331】东非大裂谷(结论,DP)
- 免费版企业级杀毒软件mcafee使用报告。
- jQuery的$.ajax()访问json文件【亲测有效】
- Android Jetpack架构组件(十)之Slices
- 计算机应用程序无响应,电脑的程序未响应是什么原因
- 强化学习开发黑白棋、五子棋游戏
- 7-8 哈利·波特的考试 (25 分)(Floyd算法)