热图
在进入下一章的 ChIP-seq 工作流程细节之前,您可以先预览一些分析结果。
本练习将演示如何使用热图可视化样本之间的差异。数据已加载并已格式化,可直接使用
heatmap() 函数进行绘图。
样本相关性矩阵存放在 sample_cor 中,每个峰的标准化读取计数存放在 read_counts 对象中。两者中,前 2 个样本来自原发肿瘤,后 2 个样本为耐受治疗的样本。
您可以在 heatmap() 函数中,将一组分组标签向量传给 ColSideColors 和 RowSideColors 参数,以在图中突出显示哪些样本属于同一组。
本练习是课程的一部分
在 R 中使用 Bioconductor 进行 ChIP-seq 分析
练习说明
- 创建一个颜色名称向量,用于在图中标注分组。
- 将样本相关性矩阵
sample_cor绘制为热图。 - 基于峰值读取计数创建一个热图。
交互式实操练习
通过完成这段示例代码来试试这个练习。
# Create a vector of colors to label groups (there are 2 samples per group)
group <- c(primary = rep("blue", ___), TURP = rep("red", ___))
# Plot the sample correlation matrix `sample_cor` as a heat map
# Use the group colors to label the rows and columns of the heat map
heatmap(___, ColSideColors = ___, RowSideColors = ___,
cexCol = 0.75, cexRow = 0.75, symm = TRUE)
# Create a heat map of peak read counts
# Use the group colors to label the columns of the heat map
___(___, ColSideColors = ___, labRow = "", cexCol = 0.75)