tetraの外部記憶箱

«前の日記(2009-05-24) 最新 次の日記(2009-05-31)» 編集
Category;

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)

すると、作業フォルダに下のような各アレイの診断プロットが作成される。

20090528110842

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

IDNamelogFCAveExprtP.Valueadj.P.ValB
H200012024ITGA1 - Integrin, alpha 11.276.988.3900.280.59
H200014446P2Y5 - Purinergic receptor (family A group 5)-0.9212.23-6.1500.61-0.34
H200001079EGFL5 - EGF-like-domain, multiple 5-0.967.74-6.2700.61-0.28
H200001929EPLIN - Epithelial protein lost in neoplasm beta-1.18.62-6.2900.61-0.26
H200003977F5 - Coagulation factor V (proaccelerin, labile factor)-1.17.5-6.5500.61-0.14
H200007427CENTG2 - Centaurin, gamma 2-1.196.09-8.2900.280.56
H200004937Homo sapiens cDNA FLJ12815 fis, clone NT2RP2002546-1.246.3-6.8500.610.01
H200003784SEMA5A - Sema domain, seven thrombospondin repeats (type 1 and type 1-like), transmembrane domain (TM) and sh-1.356.81-6.8900.610.03
H200018884Homo sapiens cDNA FLJ11375 fis, clone HEMBA1000411, weakly similar to ANKYRIN-1.66.62-8.7600.280.71
H200017286GPR2 - G protein-coupled receptor 2-2.457.79-10.7700.181.17

今度は、Agilentのデータを試してみよっと。

RとBioconductorを用いたバイオインフォマティクス
ジェントルマン
シュプリンガー・ジャパン株式会社 ( 2007-07-09 )
ISBN: 9784431734642
おすすめ度:アマゾンおすすめ度
本日のツッコミ(全12件) [ツッコミを入れる]
_ grooming insurance (2010-10-17 09:42)

I am glad you said that!?

_ hyper performance insurance (2010-10-22 01:53)

Great post! Maybe you could do a follow up to this topic!!!

_ veterinary technician (2010-12-10 12:37)

I just added your blog site to my blogroll, I pray you would give some thought to doing the same.

_ registered nurse (2010-12-25 06:48)

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.

_ llc (2010-12-29 18:16)

Nice site, nice and easy on the eyes and great content too.

_ federal grants (2011-01-11 03:35)

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.in (2011-05-25 05:33)

Tetralog.. Great idea :)

_ tetralog.in (2011-06-03 21:25)

Tetralog.. Great idea :)

_ b15q tits nv5t (2011-07-03 03:34)

Tetralog.. Corking :)

_ lifbosissau (2012-02-14 16:20)

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>

_ gaisharasia (2013-03-22 00:13)

[url=http://buylasixonlinenow.com/#khdty]generic furosemide[/url] - <a href=http://buylasixonlinenow.com/#caetu>lasix without prescription</a> , http://buylasixonlinenow.com/#mfcpj cheap lasix

_ Bomeagelm (2013-03-22 04:23)

[url=http://priligyonlinemeds.com/#qmmxa]buy priligy online[/url] - <a href=http://priligyonlinemeds.com/#staya>buy dapoxetine</a> , http://priligyonlinemeds.com/#tehrj dapoxetine online