始める無料で始める

ヒートマップ

次の章でChIP-seqのワークフローを詳しく見る前に、ここでは解析結果の一部を先取りして確認します。

この演習では、ヒートマップを使ってサンプル間の違いを可視化する方法を見ていきます。データはすでに読み込まれており、heatmap() 関数でプロットできる形式に整えられています。

サンプル間の相関行列は sample_cor として、各ピークの正規化済みリードカウントは read_counts オブジェクトとして利用できます。どちらの場合も、最初の2つのサンプルは原発腫瘍、最後の2つは治療抵抗性です。

同じグループに属するサンプルを強調表示するには、heatmap() 関数の ColSideColorsRowSideColors 引数に、グループラベルのベクトルを渡します。

この演習はコースの一部です

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)
コードを編集して実行