2007-12-25 23:26:44
「KEGG API はプログラムなどから KEGG を利用するためのウェブサービスです。」ということで、早速私も使ってみようと思い、説明書を読んでみた。例として、RubyとかJavaとかPerlとかPythonの使用例が載っているが、PHPはない。なぜだ。
SOAPは慣れていないので、私にはちょっと難しい。手始めに簡単なのを作ってみた。これだけでもいろいろ戸惑ったのだ。
<?php $query = $argv[1]; $wsdl = "http://soap.genome.jp/KEGG.wsdl"; $client = new SoapClient($wsdl); $top5 = $client->get_best_neighbors_by_gene($query,1,5); print_r($top5); ?>これをkegg.phpというような名前で保存して、php kegg.php eco:b0002とでも打ってみれば、
Array
(
[0] => stdClass Object
(
[genes_id1] => eco:b0002
[genes_id2] => ecv:APECO1_1976
[sw_score] => 5283
[bit_score] => 1210
[identity] => 1
[overlap] => 820
[start_position1] => 1
[end_position1] => 820
[start_position2] => 15
[end_position2] => 834
[best_flag_1to2] => 1
[best_flag_2to1] => 1
[definition1] => fused aspartokinase I and homoserine dehydrogenase I
[definition2] => bifunctional aspartokinase I/homeserine dehydrogenase I
[length1] => 820
[length2] => 834
)
[1] => stdClass Object
(
[genes_id1] => eco:b0002
[genes_id2] => ecp:ECP_0002
[sw_score] => 5283
[bit_score] => 1210
[identity] => 1
[overlap] => 820
[start_position1] => 1
[end_position1] => 820
[start_position2] => 1
[end_position2] => 820
[best_flag_1to2] => 1
[best_flag_2to1] =>
[definition1] => fused aspartokinase I and homoserine dehydrogenase I
[definition2] => aspartokinase I/homoserine dehydrogenase I
[length1] => 820
[length2] => 820
)
........
)
という結果が返ってくる。なるほどねえ。なんだか判ったような、判らないような。