ex602 - nibb-gitc/gitc2021sep-rnaseq GitHub Wiki

ex602: MDSによるデータ可視化

データセットSato_A_thaliana-P_syringae_arvRpt2_6h_expRatio_small.txt(61遺伝子x8遺伝子型)を、multidimensionality scaling (MDS)を使って可視化し、傾向をつかみましょう。 なお、クラスタリング結果の違いの可視化はedgeRパッケージのplotMDSを使う。

準備


library(edgeR)

inputMatrix <- read.delim(
  "nibb_gitc_rnaseq_20210310/gitc/data/MS/Sato_A_thaliana-P_syringae_arvRpt2_6h_expRatio_small.txt", 
  header=TRUE, 
  row.name=1
)

### plotMDSに関する説明事項

plotMDS(x, top = 500, labels = NULL, pch = NULL, cex = 1,
	        dim.plot = c(1,2), ndim = max(dim.plot), gene.selection = "pairwise",
	        xlab = NULL, ylab = NULL, method = "logFC", prior.count = 2,
	         ...)
  • top=500: デフォルトでは発現量の差の大きなものから500遺伝子のみを使って計算する
  • labels: 指定なしだとカウントデータのカラム名
  • dim.plot: 何番目の主座標を表示するか
  • gene.selection: pairwiseだと各サンプル間の遺伝子発現量全体の標準偏差を使う。commonだと指定サンプルと残りのサンプルについて標準偏差を計算して用いる。

実行

ngenes <- nrow(inputMatrix)
nlib   <- ncol(inputMatrix)
group  <- colnames(inputMatrix)

y <- DGEList(inputMatrix+10,group=group) # 非負数のみしかDGEListは受け付けないので+10を足している
mds <- plotMDS(y, top=ngenes)