2008年6月20日金曜日

go-perlのインストール

環境:
MacBook(Mac OS X 10.4.11)

go-perlの入手先
http://search.cpan.org/~cmungall/go-perl-0.09/

インストールはCPAN shellから行いました。

sudo perl -MCPAN -e shell
install GO::Parser

途中でData::Stagをインストールするかどうかを聞いてくるので、yesと答えます。
特にエラー無くインストールは終了。

動作確認には、go-perlのdocumentに記載されているサンプルコードを実行してみました。

tomo$ less go-perl.pl
#!/usr/bin/perl

use GO::Parser;

my $parser = new GO::Parser({handler=>'obj'}); # create parser object
$parser->parse("gene_ontology.obo"); # parse file -> objects
my $graph = $parser->handler->graph; # get L object
my $term = $graph->get_term("GO:0001303"); # fetch a term by ID
printf "Got term: %s %sn", $term->acc, $term->name;
my $ancestor_terms = $graph->get_recursive_parent_terms($term->acc);
foreach my $anc_term (@$ancestor_terms) {
printf " Ancestor term: %s %sn", $anc_term->acc, $anc_term->name;
}

こちらから、"gene_ontology.obo"ファイルをダウンロードして来て、上記go-perl.plと同じディレクトリに置いておきます。
http://www.geneontology.org/ontology/gene_ontology.obo

実行結果は以下の通り、

tomo$ perl go-perl.pl
Got term: GO:0001303 nucleolar fragmentation during replicative aging
Ancestor term: GO:0001302 replicative cell aging
Ancestor term: GO:0007569 cell aging
Ancestor term: GO:0007568 aging
Ancestor term: GO:0032502 developmental process
Ancestor term: GO:0008150 biological_process
Ancestor term: GO:0007576 nucleolar fragmentation
Ancestor term: GO:0007000 nucleolus organization and biogenesis
Ancestor term: GO:0006997 nuclear organization and biogenesis
Ancestor term: GO:0006996 organelle organization and biogenesis
Ancestor term: GO:0016043 cellular component organization and biogenesis
Ancestor term: GO:0009987 cellular process
Ancestor term: GO:0008150 biological_process
Ancestor term: GO:0007569 cell aging
Ancestor term: GO:0007568 aging
Ancestor term: GO:0032502 developmental process
Ancestor term: GO:0008150 biological_process

0 件のコメント: