2009-05-28
_ [R][Bioconductor] アレイ解析練習1
今までBioconductorはあまり使ってなかったんですが、どうやらマイクロアレイのお仕事が今年は沢山入りそうな雰囲気なので、今度こそ習得しとこうかなーかと。
参考書は『RとBioconductorを用いたバイオインフォマティクス』。
出版直後に買った当時は、Rも満足に使えず、またアレイ解析も今みたいに頻繁にはやってなかったので、正直言って、少々内容が難しいと思ったのだけど、最近、わりとRを頻繁に使うようになったり、マイクロアレイ解析にどっぷり漬かっていたためか、意外に楽しく読んでいる。
チュートリアル形式で書かれていて、実用的で良い本なのだけど、ただ、実行環境、その他の影響により、本に書かれているコードをそのまま試してみても、なかなかその通りに動かないケースも所々あるようで・・・。
以下、p.75のbeta7データセット(two-color microarray)を用いたケーススタディより。(実行環境はUbuntu 9.04 + R 2.8.1)
1. Rを起動し、beta7パッケージと解析パッケージをロード。
> library("beta7") > library("arrayQuality")
2. beta7のディレクトリにある標的ファイルを読み込む。
> datadir <- system.file("beta7", package = "beta7") > TargetInfo <- read.marrayInfo(file.path(datadir, "TargetBeta7.txt"))
3. ここで、蛍光強度のraw dataの読み込みを行うと・・・
> mraw <- read.GenePix(targets = TargetInfo, path = datadir) 以下にエラー if (skip > 0) readLines(file, skip) : TRUE/FALSE が必要なところが欠損値です 追加情報: Warning messages: 1: In grep(layout.id[1], y) : 入力文字列 32 はこのロケールでは不適切です 2: In grep(info.id[1], y) : 入力文字列 32 はこのロケールでは不適切です
・・・と起こられてしまう。色々と調べてみると、どうやらロケールの設定が悪さをしているらしい。
> Sys.getlocale() [1] "LC_CTYPE=ja_JP.UTF-8;LC_NUMERIC=C;LC_TIME=ja_JP.UTF-8; LC_COLLATE=ja_JP.UTF-8;LC_MONETARY=C;LC_MESSAGES=ja_JP.UTF-8; LC_PAPER=ja_JP.UTF-8;LC_NAME=C;LC_ADDRESS=C;LC_TELEPHONE=C; LC_MEASUREMENT=ja_JP.UTF-8;LC_IDENTIFICATION=C"
そこで、ロケールの設定を変更。
> Sys.setlocale("LC_CTYPE", "C")
で、もう一度読み込んでみると・・・
> mraw <- read.GenePix(targets = TargetInfo, path = datadir) Reading ... /home/hoge/R/i486-pc-linux-gnu-library/2.8/beta7/beta7/6Hs.195.1.gpr Reading ... /home/hoge/R/i486-pc-linux-gnu-library/2.8/beta7/beta7/6Hs.168.gpr Reading ... /home/hoge/R/i486-pc-linux-gnu-library/2.8/beta7/beta7/6Hs.166.gpr Reading ... /home/hoge/R/i486-pc-linux-gnu-library/2.8/beta7/beta7/6Hs.187.1.gpr Reading ... /home/hoge/R/i486-pc-linux-gnu-library/2.8/beta7/beta7/6Hs.194.gpr Reading ... /home/hoge/R/i486-pc-linux-gnu-library/2.8/beta7/beta7/6Hs.243.1.gpr
読み込み成功!
4. アレイの品質診断プログラムを実行。
> maQualityPlots(mraw)
すると、作業フォルダに下のような各アレイの診断プロットが作成される。
5. データの正規化。
> normdata <- maNorm(mraw)
6. 正規化されたデータをローカルに保存。
> normdata <- maNorm(mraw)
7. 発現差異のある遺伝子の同定。
> LMres <- lmFit(normdata, design = c(1,-1,-1,1,1,-1), weights = NULL)
8. 発現差異のある遺伝子の調整t統計量と対数オッズを計算。
> LMres <- eBayes(LMres)
6. HTMLによる出力。
> restable <- topTable(LMres, number = 10, resort.by = "M") > table2html(restable, disp = "file")
出力結果。
BioConductor Gene Listing
ID | Name | logFC | AveExpr | t | P.Value | adj.P.Val | B |
H200012024 | ITGA1 - Integrin, alpha 1 | 1.27 | 6.98 | 8.39 | 0 | 0.28 | 0.59 |
H200014446 | P2Y5 - Purinergic receptor (family A group 5) | -0.92 | 12.23 | -6.15 | 0 | 0.61 | -0.34 |
H200001079 | EGFL5 - EGF-like-domain, multiple 5 | -0.96 | 7.74 | -6.27 | 0 | 0.61 | -0.28 |
H200001929 | EPLIN - Epithelial protein lost in neoplasm beta | -1.1 | 8.62 | -6.29 | 0 | 0.61 | -0.26 |
H200003977 | F5 - Coagulation factor V (proaccelerin, labile factor) | -1.1 | 7.5 | -6.55 | 0 | 0.61 | -0.14 |
H200007427 | CENTG2 - Centaurin, gamma 2 | -1.19 | 6.09 | -8.29 | 0 | 0.28 | 0.56 |
H200004937 | Homo sapiens cDNA FLJ12815 fis, clone NT2RP2002546 | -1.24 | 6.3 | -6.85 | 0 | 0.61 | 0.01 |
H200003784 | SEMA5A - Sema domain, seven thrombospondin repeats (type 1 and type 1-like), transmembrane domain (TM) and sh | -1.35 | 6.81 | -6.89 | 0 | 0.61 | 0.03 |
H200018884 | Homo sapiens cDNA FLJ11375 fis, clone HEMBA1000411, weakly similar to ANKYRIN | -1.6 | 6.62 | -8.76 | 0 | 0.28 | 0.71 |
H200017286 | GPR2 - G protein-coupled receptor 2 | -2.45 | 7.79 | -10.77 | 0 | 0.18 | 1.17 |
今度は、Agilentのデータを試してみよっと。
I am glad you said that!?
Great post! Maybe you could do a follow up to this topic!!!
I just added your blog site to my blogroll, I pray you would give some thought to doing the same.
My partner and I really enjoyed reading this blog post, I was just itching to know do you trade featured posts? I am always trying to find someone to make trades with and merely thought I would ask.
Nice site, nice and easy on the eyes and great content too.
Finally, an issue that I am passionate about. I have looked for information of this caliber for the last several hours. Your site is greatly appreciated.
Tetralog.. Great idea :)
Tetralog.. Great idea :)
Tetralog.. Corking :)
Hi all! <br>They do report feeling more tired in the beginning. Here are the side effects of this drug (remember these are possible side effects): indigestion, nausea, vomiting, diarrhea or constipation, dizziness, and can be toxic to the liver. The 3 things I think you need to know are: !..buy online pill!! <br>Goodluck!!!!! <br>____________________________ <br><a href=http://cilias.drugrx.info/map.html>generic wholesale</a>
[url=http://buylasixonlinenow.com/#khdty]generic furosemide[/url] - <a href=http://buylasixonlinenow.com/#caetu>lasix without prescription</a> , http://buylasixonlinenow.com/#mfcpj cheap lasix
[url=http://priligyonlinemeds.com/#qmmxa]buy priligy online[/url] - <a href=http://priligyonlinemeds.com/#staya>buy dapoxetine</a> , http://priligyonlinemeds.com/#tehrj dapoxetine online