美文网首页
R包-pheatmap热图

R包-pheatmap热图

作者: 新欣enjoy | 来源:发表于2020-03-05 11:21 被阅读0次

热图在比较样本间基因的表达差异上能够比较好的反映数据内在信息,通过对样本或基因聚类,进一步分析细胞内在信息。

CRAN pheatmap 参考手册
pheatmap 操作实例

主要参数

  • 表达矩阵,行为基因,列为样本
  • 聚类参数:kmeans_k
  • 数据归一化对象及方法:scale=c("row","column")
  • 聚类计算方法: dist(), clustering_distance_cols()
drows = dist(test, method = "minkowski")
dcols = dist(t(test), method = "minkowski")
pheatmap(test, clustering_distance_rows = drows, clustering_distance_cols = dcols)
  • 给行、列添构建注释信息数据(数据框行列名一一对应):
annotation_col = data.frame(
CellType = factor(rep(c("CT1", "CT2"), 5)),
Time = 1:5)
rownames(annotation_col) = paste("Test", 1:10, sep = "")
annotation_row = data.frame(
GeneClass = factor(rep(c("Path1", "Path2", "Path3"), c(10, 4, 6))))
rownames(annotation_row) = paste("Gene", 1:20, sep = "")
# Display row and color annotations
pheatmap(test, annotation_col = annotation_col)
pheatmap(test, annotation_col = annotation_col, annotation_legend = FALSE)
pheatmap(test, annotation_col = annotation_col, annotation_row = annotation_row)
添加行、列注释信息

相关文章

网友评论

      本文标题:R包-pheatmap热图

      本文链接:https://www.haomeiwen.com/subject/jgnilhtx.html