karyoploteR:基因组数据可视化 R 软件包-2。基因表达结果
最编程
2024-03-31 17:57:01
...
以来源于 Drosophila 的 RNA-seq 数据为例,经过 DESeq2 处理得到基因表达数据 karyoploteR 绘图结果如下。具体分析与绘图参考:https://bernatgel.github.io/karyoploter_tutorial//Examples/GeneExpression/GeneExpression.html。
关于 karyoploteR 更详细说明与使用教程,请参考:https://bernatgel.github.io/karyoploter_tutorial/。
·end·
—如果喜欢,快分享给你的朋友们吧—
我们一起愉快的玩
推荐阅读
-
karyoploteR:基因组数据可视化 R 软件包-2。基因表达结果
-
(1)创建并展示模拟数据实例 我们有两组各包含5个样本的30个基因表达数据(其中15个基因上调,15个基因下调)。以下是如何生成及显示这些数据: ```r set.seed(123) # 保证可复现结果 exp = matrix(rnorm(300), nrow = 30, ncol = 10) exp[1:15, 1:5] = exp[1:15, 1:5] + matrix(rnorm(75, mean = 4), nrow = 15, ncol = 5) exp[16:30, 6:10] = exp[16:30, 6:10] + matrix(rnorm(75, mean = 3), nrow = 15, ncol = 5) exp = round(exp, 2) # 四舍五入到小数点后两位 colnames(exp) = paste("样本", 1:10, sep = "") # 改为中文列名 rownames(exp) = paste("基因", 1:30, sep = "") # 改为中文行名 head(exp) ``` (2)在R中安装和加载pheatmap包 首先确保已安装pheatmap包,如果没有,请运行: ```r if (!requireNamespace("BiocManager", quietly = TRUE)) install.packages("BiocManager") BiocManager::install("pheatmap") # 安装pheatmap包 library(pheatmap) # 加载pheatmap包 packageVersion("pheatmap") # 检查版本号 ``` (3)基本的热力图绘制 使用上述示例数据 `exp`,我们可以直接调用 `pheatmap()` 函数进行基本的热力图绘制: ```r pheatmap(exp, cluster_rows = TRUE, cluster_cols = TRUE) # 对行和列进行聚类 ```