Bioconductor は、統計とグラフィックスのフリーソフトウェア環境Rのためのゲノムスケールデータの解析パッケージ集です。ゲノムスケールデータとは、マイクロアレイやSAGEなどによる大規模遺伝子発現プロファイル、SNPデータ、質量分析データ、ゲノム配列や遺伝子アノテーション、タンパク質相互作用データなどが含まれます。
Bioconductor は R の共同開発者である Prof. Robert Gentlman (Fred Hunchinson Cancer Research Center) を中心にして 2001 年から開発されています。
Bioconductorプロジェクトのゴールには次のようなものがあります。
Bioconductorプロジェクトの特徴には次のようなものがあります。
Bioconductor パッケージのスクリーンショットをいくつか紹介します。
Bioconductor パッケージを関連する作業分野ごとに階層的に分類したものです。パッケージを探すときの整理棚として利用できます。
このチュートリアルが終わったあとに参照するべき機能、書籍とウェブサイトを紹介します。
R のヘルプ機能を利用してメソッドの説明を引き出したり、パッケージの説明を引き出したり、キーワードでメソッドを検索することができます。
▼たとえば、plot メソッドについて知りたいときは、Rコンソールでつぎのように入力します。
help(plot)
△実行結果。plot メソッドに関するヘルプドキュメントが表示されます。R のヘルプドキュメントはすべておなじ形式になっています。つぎに plot のヘルプドキュメントを示します。
plot package:graphics R Documentation Generic X-Y Plotting Description: Generic function for plotting of R objects. For more details about the graphical parameter arguments, see 'par'. Usage: plot(x, y, ...) Arguments: x: the coordinates of points in the plot. Alternatively, a single plotting structure, function or _any R object with a 'plot' method_ can be provided. y: the y coordinates of points in the plot, _optional_ if 'x' is an appropriate structure. ...: Arguments to be passed to methods, such as graphical parameters (see 'par'). Many methods will accept the following arguments: 'type' what type of plot should be drawn. Possible types are * '"p"' for *p*oints, * '"l"' for *l*ines, * '"b"' for *b*oth, * '"c"' for the lines part alone of '"b"', * '"o"' for both "*o*verplotted", * '"h"' for "*h*istogram" like (or "high-density") vertical lines, * '"s"' for stair *s*teps, * '"S"' for other *s*teps, see _Details_ below, * '"n"' for no plotting. All other 'type's give a warning or an error; using, e.g., 'type = "punkte"' being equivalent to 'type = "p"' for S compatibility. 'main' an overall title for the plot: see 'title'. 'sub' a sub title for the plot: see 'title'. 'xlab' a title for the x axis: see 'title'. 'ylab' a title for the y axis: see 'title'. 'asp' the y/x aspect ratio, see 'plot.window'. Details: For simple scatter plots, 'plot.default' will be used. However, there are 'plot' methods for many R objects, including 'function's, 'data.frame's, 'density' objects, etc. Use 'methods(plot)' and the documentation for these. The two step types differ in their x-y preference: Going from (x1,y1) to (x2,y2) with x1 < x2, 'type = "s"' moves first horizontal, then vertical, whereas 'type = "S"' moves the other way around. See Also: 'plot.default', 'plot.formula' and other methods; 'points', 'lines', 'par'. Examples: plot(cars) lines(lowess(cars)) plot(sin, -pi, 2*pi) ## Discrete Distribution Plot: plot(table(rpois(100,5)), type = "h", col = "red", lwd=10, main="rpois(100,lambda=5)") ## Simple quantiles/ECDF, see ecdf() {library(stats)} for a better one: plot(x <- sort(rnorm(47)), type = "s", main = "plot(x, type = \"s\")") points(x, cex = .5, col = "dark red")
「Usage:」と「Examples:」をざっとみてメソッドの使い方の雰囲気をつかみ、必要に応じて「Arguments:」や「Details:」、「See Also:」を参考しするとよい。「Examples:」の内容はRコンソールにそのままコピー&ペーストすれば実行可能なものです。
▼パッケージの内容を調べるには、library メソッドを使用します。次の例では annaffy パッケージについて調べます。
library(help=annaffy)
△実行結果
パッケージ 'annaffy' の情報
記述:
Package: annaffy
Version: 1.6.2
Date: 2007-02-20
Title: Annotation tools for Affymetrix
biological metadata
Author: Colin A. Smith
<annaffy@colinsmith.org>
Maintainer: Colin A. Smith
<annaffy@colinsmith.org>
Depends: R (>= 2.1.0), methods, Biobase, GO (>=
1.6.0), KEGG
Suggests: hgu95av2, multtest, tcltk
Description: Functions for handling data from
Bioconductor Affymetrix annotation
data packages. Produces compact HTML
and text reports including
experimental data and URL links to
many online databases. Allows
searching biological metadata using
various criteria.
License: LGPL
SaveImage: yes
biocViews: OneChannel, Microarray, Annotation,
GO, Pathways, ReportWriting
Packaged: Tue Feb 20 13:28:36 2007; biocbuild
Built: R 2.4.1; ; 2007-02-21 06:14:43; unix
索引:
aaf.handler Handle feching annotation data columns
aafChromLoc Constructor for aafChromLoc objects
aafChromLoc-class Class aafChromLoc, a class for gene chromosome
locations
aafChromosome Constructor for aafChromosome objects
aafChromosome-class Class aafChromosome, a class for gene
chromosome assignments
aafCytoband Constructor for aafCytoband objects
aafCytoband-class Class aafCytoband, a class for cytoband data
aafDescription Constructor for aafDescription objects
aafDescription-class Class aafDescription, a class for gene
descriptions
aafExpr Sample exprSet used for demonstration purposes
aafFunction Constructor for aafFunction objects
aafFunction-class Class aafFunction, a class for gene product
functions
aafGO Constructor for aafGO objects
aafGO-class Class aafGO, a class for gene ontology ids
aafGOItem-class Class aafGOItem, a class for gene ontology id
elements
aafGenBank Constructor for aafGenBank objects
aafGenBank-class Class aafGenBank, a class for GenBank accession
numbers
aafIntensity-class Class aafIntensity, a class for gene expression
values
aafList-class Class aafList, a specialized subclass of list
aafLocusLink Constructor for aafLocusLink objects
aafLocusLink-class Class aafLocusLink, a class for LocusLink ids
aafPathway Constructor for aafPathway objects
aafPathway-class Class aafPathway, a class for KEGG pathway ids
aafPathwayItem-class Class aafPathwayItem, a class for KEGG pathway
id elements
aafProbe Constructor for aafProbe objects
aafProbe-class Class aafProbe, a class for Probe ids
aafPubMed Constructor for aafPubMed objects
aafPubMed-class Class aafPubMed, a class for PubMed ids
aafSearchGO Find probe ids corresponding to GO ids
aafSearchText Search metadata annotation text
aafSigned-class Class aafSigned, a class for signed numerical
data
aafSymbol Constructor for aafSymbol objects
aafSymbol-class Class aafSymbol, a class for gene symbols
aafTable Constructor for aafTable objects
aafTable-class Class aafTable, a tabular microarray data class
aafTableAnn Constructor for aafTable objects from
annotation data
aafTableFrame Constructor for aafTable objects from data
frames
aafTableInt Constructor for aafTable objects from exprSets
aafUniGene Constructor for aafUniGene objects
aafUniGene-class Class aafUniGene, a class for UniGene cluster
ids
getCSS-methods Methods for function getCSS
getHTML-methods Methods for function getHTML
getTD-methods Methods for function getTD
getText-methods Methods for function getText
getURL-methods Methods for function getURL
is.annpkg Determine if packages contain annotation
selectorWidget Dialog to select items from a list
これ以上の情報はディレクトリ
'/Library/Frameworks/R.framework/Resources/library/annaffy/doc'
にある以下の vignettes 中にあります:
annaffy: annaffy Primer (source, pdf)
「索引:」以下がこのパッケージに含まれるメソッドの一覧になります。
▼キーワードからメソッドを検索する。
help.search("MA plot")
Bioconductor では R のヘルプドキュメントをより高品質化をおしすすめ、背景知識を含めたレポート形式のドキュメント(通称:ヴィネット、vignette)を提供しています。
▼ヴィネットの表示。調べたいトピック(例:grid)の文章をひらきます。
vignette("grid")
vignette でつかえるトピックは、annaffy パッケージの場合は library(help=annaffy) の最後に書いてあります。
▼ vignette であつかっているトピックのリストはつぎのようにして表示します。
vignette()
no title では R のパッケージの Example にあるグラフとそのコードがすべて閲覧可能になっています。
また、Statistics with Rの3.From Data to Graphicsと4.Customizing graphicsがコードと図が豊富にあり参考になります。
すこしプログラミングに慣れてくると、ほかの人の書いたプログラムを読んで参考にすることができます。また、実際に動作する他人の書いたプログラムはプログラミングの自習に最適な教材です。
バイオインフォマティクスで利用されるソフトウェアのソースコード検索サーバ。産業技術総合研究所CBRCでサービスされています。
Google のソースコード検索では、言語指定(lang:R)すると効果的な検索がおこなえます。
中間さんによる R や Bioconductor のソースコード検索サービス。
7月出版予定の R と Bioconductor を用いたバイオインフォマティクス(シュプリンガー・ジャパン)はつぎの本の翻訳です。
プログラミング言語 R の基礎についてはつぎの本が良いです。
統計解析の基礎についてはつぎの本が良いです。
Rによる統計解析の基礎 (Computer in Education and Research)
分子進化の解析にはつぎの本を読むと良いでしょう。
Analysis of Phylogenetics And Evolution With R (Use R)
RjpWiki に幅広い話題がかかれています。ウェブで R の話題を調べるときのスタート地点にすると良いでしょう。
R は文字列として短すぎるので、R だけでは Google などの検索エンジンでは意味のある検索結果は期待できません。
Bioconductor 以外にも生物学(遺伝学、進化系統解析など)に有用な R パッケージがあります。
膨大な R パッケージが代表的な研究テーマごとに整理されています。