跟着存档教程动手学RNAseq分析(六):差异分析流程总结
2023-06-13 09:16:26 时间
跟着存档教程动手学RNAseq分析(五):DESeq2基因水平差异表达分析
我们详细介绍了差异表达分析工作流程中的各个步骤,并提供了理论和示例代码。为了给运行DGE分析所需的代码提供更简洁的参考,我们总结了如下分析中的步骤:
- 使用tximport导入Salmon的基因水平计数数据
# Run tximport
txi <- tximport(files, type="salmon", tx2gene=t2g, countsFromAbundance = "lengthScaledTPM")
# "files" is a vector wherein each element is the path to the salmon quant.sf file, and each element is named with the name of the sample.
# "t2g" is a 2 column data frame which contains transcript IDs mapped to geneIDs (in that order)
- 创建dds对象:
# Check that the row names of the metadata equal
# the column names of the **raw counts** data
all(colnames(txi$counts) == rownames(metadata))
# Create DESeq2Dataset object
dds <- DESeqDataSetFromTximport(txi, colData = metadata, design = ~ condition)
- 探索性数据分析(PCA和层次聚类)-识别数据中的异常值和变异来源:
# Transform counts for data visualization
rld <- rlog(dds, blind=TRUE)
# Plot PCA
plotPCA(rld, intgroup="condition")
# Extract the rlog matrix from the object
# and compute pairwise correlation values
rld_mat <- assay(rld)
rld_cor <- cor(rld_mat)
# Plot heatmap
pheatmap(rld_cor, annotation = metadata)
- 运行DESeq2
# **Optional step** - Re-create DESeq2 dataset
# if the design formula has changed after QC analysis
# in include other sources of variation
# using "dds <- DESeqDataSetFromTximport(txi, colData = metadata, design = ~ covaraite + condition)"
# Run DESeq2 differential expression analysis
dds <- DESeq(dds)
# **Optional step** - Output normalized counts
# to save as a file to access outside RStudio
# using "normalized_counts <- counts(dds, normalized=TRUE)"
- 检查离散估计的拟合:
plotDispEsts(dds)
- 创建对比,对特定条件下的收缩log2折叠变化进行Wald检验:
# Output results of Wald test for contrast
contrast <- c("condition", "level_to_compare", "base_level")
res <- results(dds, contrast = contrast, alpha = 0.05)
res <- lfcShrink(dds, contrast = contrast, res=res)
- 输出显著性结果:
# Set thresholds
padj.cutoff < - 0.05
# Turn the results object into a tibble for use with tidyverse functions
res_tbl <- res %>%
data.frame() %>%
rownames_to_column(var="gene") %>%
as_tibble()
# Subset the significant results
sig_res <- filter(res_tbl, padj < padj.cutoff)
8. 可视化结果:火山图、热图、top基因的标准化计数图等。
9. 进行分析,提取结果的功能意义:GO或KEGG富集,GSEA等。
相关文章
- 第十六章.Linux系统管理-开机启动流程
- 四大国内外开源的java工作流程引擎,流程快速开发平台对比分析选型[通俗易懂]
- Activiti教程(六)activiti的流程设计_未完待续
- 全网最全最细的jmeter接口测试教程以及接口测试流程详解
- 3.5小时完成20万分子对接!一键定位分子库+全流程自动化
- Android四大组件Broadcast中注册广播registerReceiver流程源代码详解
- 湖仓一体电商项目(二十二):实时任务执行流程
- 关于量化合约代码教程及合约量化系统开发部署流程
- 从进程,线程去了解浏览器内部的流程原理
- bug生命周期流程_bug六大要素
- 苹果IOS应用上架AppStore的流程与教程
- pytorch 下载安装全流程详细教程
- 腾讯云服务器购买流程(新手教程)
- RocketMQ: 技术架构与启动流程
- 教程|你不知道的监控项预处理流程逻辑
- 用一张图说一说 ChatGPT 内部技术工作流程
- JavaScript 入门基础 - 流程控制(四)
- 国内chatgpt账号注册申请教程和OpenAI账号官网注册流程,带国外手机号解决方法
- 【Android 异步操作】线程池 ( Worker 简介 | 线程池中的工作流程 runWorker | 从线程池任务队列中获取任务 getTask )
- 【Android 启动过程】Android 应用启动流程 | Activity 启动流程
- 【Linux 内核 内存管理】memblock 分配器 ⑤ ( Linux 内核中定义 memblock 分配器的位置 | ARM64体系架构下 Linux内核初始化 memblock 分配器流程 )
- 【教程】全流程Ubuntu安装Docker版Gitlab并初始化管理员
- 2022超详细流程ios APP最新打包上线教程
- IOS实现微信支付流程详解手机开发
- 「Linux软件开发教程」:学习Linux基础知识与开发技巧,掌握软件开发流程,增强编程实践能力,提高编程效率。(linux软件开发教程)
- 尚观MySQL运维技术及全流程教程(尚观mysql运维教程)