Hatena::Groupbioruby

"aac".translate #=> "N" このページをアンテナに追加 RSSフィード

2008-01-10

H-InvDB REST web service client class added

|  H-InvDB REST web service client class added - "aac".translate #=> "N" を含むブックマーク はてなブックマーク -  H-InvDB REST web service client class added - "aac".translate #=> "N"  H-InvDB REST web service client class added - "aac".translate #=> "N" のブックマークコメント

Katayama-san commited a new IO class Bio::Hinv to access the H-InvDB REST web service.

H-InvDB web service provides 12 APIs.

acc2hit - HIT ID of accession number

URI:

Output:

<?xml version='1.0' encoding='UTF-8'?>
<H-Inv>
        <H-INVITATIONAL-ID>HIT000053961</H-INVITATIONAL-ID>
</H-Inv>

In bioruby,

irb(main):001:0> require 'bio'
irb(main):002:0> Bio::Hinv.acc2hit("BC053657")
=> "HIT000053961"

hit2acc - Accession No of HIT ID

URI:

Output:

<?xml version='1.0' encoding='UTF-8'?>
<H-Inv>
        <ACCESSION-NO>AK097327</ACCESSION-NO>
</H-Inv>% 

In bioruby:

irb(main):003:0> Bio::Hinv.hit2acc("HIT000022181") 
=> "AK097327"

hit_cnt - total number of HIT ID

URI:

Output:

<?xml version='1.0' encoding='UTF-8'?>
<H-Inv>
        <TRANSCRIPT_CNT>187156</TRANSCRIPT_CNT>
</H-Inv>

The last line don't have return code.

In bioruby:

irb(main):004:0> Bio::Hinv.hit_cnt 
=> 187156

hit_definition - HIT definition of HIT ID

URI:

Output:

<?xml version='1.0' encoding='UTF-8'?>
<H-Inv>
        <HIT_FUNCTION>
                <H-INVITATIONAL-ID>HIT000000001</H-INVITATIONAL-ID>
                <DATA-SOURCE_DEFINITION>Rho guanine nucleotide exchange factor 10.</DATA-SOURCE_DEFINITION>
                <CDNA_REP-H-INVITATIONAL>Representative transcript</CDNA_REP-H-INVITATIONAL>
                <CDNA_SPLICING-ISOFORM_CURATION></CDNA_SPLICING-ISOFORM_CURATION>
                <DATA-SOURCE_DB-REFERENCE_PROTEIN-MOTIF-ID>NP_055444</DATA-SOURCE_DB-REFERENCE_PROTEIN-MOTIF-ID>
                <DATA-SOURCE_IDENTITY>100.0</DATA-SOURCE_IDENTITY>
                <DATA-SOURCE_COVERAGE>100.0</DATA-SOURCE_COVERAGE>
                <DATA-SOURCE_HOMOLOGOUS_SPECIES>Homo sapiens</DATA-SOURCE_HOMOLOGOUS_SPECIES>
                <DATA-SOURCE_SIMILARITY-CATEGORY>Identical to known human protein(Category I).</DATA-SOURCE_SIMILARITY-CATEGORY>
        </HIT_FUNCTION>
</H-Inv>

In bioruby:

simple access

irb(main):006:0> Bio::Hinv.hit_definition("HIT000000001") 
=> "Rho guanine nucleotide exchange factor 10."

and full access

irb(main):007:0> serv = Bio::Hinv::HitDefinition.new
irb(main):008:0> serv.query("hit" => "HIT000000001")
irb(main):009:0> serv.result
=> "Rho guanine nucleotide exchange factor 10."
irb(main):010:0> serv.data_source_definition
=> "Rho guanine nucleotide exchange factor 10."
irb(main):011:0> serv.cdna_rep_h_invitational
=> "Representative transcript"
irb(main):012:0> serv.cdna_splicing_isoform_curation
=> nil
irb(main):013:0> serv.data_source_db_reference_protein_motif_id
=> "NP_055444"
irb(main):014:0> serv.data_source_identity
=> 100.0
irb(main):015:0> serv.data_source_coverage
=> 100.0
irb(main):016:0> serv.data_source_homologous_species
=> "Homo sapiens"
irb(main):017:0> serv.data_source_similarity_category
=> "Identical to known human protein(Category I)."

hit_pubmedid - PMID of HIT ID

URI:

Output:

<?xml version='1.0' encoding='UTF-8'?>
<H-Inv>
<CDNA_DB-REFERENCE_PUBMED>7624364</CDNA_DB-REFERENCE_PUBMED>
<CDNA_DB-REFERENCE_PUBMED>11279095</CDNA_DB-REFERENCE_PUBMED>
<CDNA_DB-REFERENCE_PUBMED>15489334</CDNA_DB-REFERENCE_PUBMED>
</H-Inv>

In bioruby:

irb(main):031:0> Bio::Hinv.hit_pubmedid("HIT000053961")
=> [7624364, 11279095, 15489334]

hit_xml - HIT XML file of HIT ID

URI:

Output:

ifier

In bioruby:

simple access

irb(main):051:0> Bio::Hinv.hit_xml("HIT000000001")
=> "<?xml version="1.0" standalone="yes" ?> ...

and (incomplete) full access

irb(main):005:0> serv = Bio::Hinv::HitXML.new
irb(main):006:0> serv.query("hit" =>"HIT000000001")
irb(main):007:0> serv.result
=> "Rho guanine nucleotide exchange factor 10."
irb(main):071:0> a.instance_eval { @xml.elements.each("//MOL-TYPE") {|x| p x.text } }
"mRNA"
=> [<MOL-TYPE> ... </>]

hix2hit - HIT ID of HIT ID

URI:

Output:

<?xml version='1.0' encoding='UTF-8'?>
<H-Inv>
<H-INVITATIONAL-ID>HIT000012846</H-INVITATIONAL-ID>
<H-INVITATIONAL-ID>HIT000022124</H-INVITATIONAL-ID>
<H-INVITATIONAL-ID>HIT000007722</H-INVITATIONAL-ID>
<H-INVITATIONAL-ID>HIT000281202</H-INVITATIONAL-ID>
<H-INVITATIONAL-ID>HIT000293297</H-INVITATIONAL-ID>
<H-INVITATIONAL-ID>HIT000283989</H-INVITATIONAL-ID>
<H-INVITATIONAL-ID>HIT000299690</H-INVITATIONAL-ID>
<H-INVITATIONAL-ID>HIT000284643</H-INVITATIONAL-ID>
<H-INVITATIONAL-ID>HIT000280349</H-INVITATIONAL-ID>
<H-INVITATIONAL-ID>HIT000297167</H-INVITATIONAL-ID>
<H-INVITATIONAL-ID>HIT000274447</H-INVITATIONAL-ID>
<H-INVITATIONAL-ID>HIT000301319</H-INVITATIONAL-ID>
<H-INVITATIONAL-ID>HIT000293727</H-INVITATIONAL-ID>
<H-INVITATIONAL-ID>HIT000261011_01</H-INVITATIONAL-ID>
<H-INVITATIONAL-ID>HIT000339817</H-INVITATIONAL-ID>
<H-INVITATIONAL-ID>HIT000301513</H-INVITATIONAL-ID>
<H-INVITATIONAL-ID>HIT000088658_01</H-INVITATIONAL-ID>
<H-INVITATIONAL-ID>HIT000393264</H-INVITATIONAL-ID>
<H-INVITATIONAL-ID>HIT000262478</H-INVITATIONAL-ID>
</H-Inv>

In bioruby:

irb(main):007:0> Bio::Hinv.hix2hit("HIX0000001")
=> ["HIT000022181"]
|ruby|<

** hix_cnt - total number of HIX ID
URI:
- http://jbirc.jbic.or.jp/hinv/hws/hix_cnt.php

Output:
>|xml|
<?xml version='1.0' encoding='UTF-8'?>
<H-Inv>
        <LOCUS_CNT>36073</LOCUS_CNT>
</H-Inv>

In bioruby:

irb(main):078:0> Bio::Hinv.hix_cnt
=> 36073

hix_represent - representative HIT ID of HIX ID

URI:

Output:

<?xml version='1.0' encoding='UTF-8'?>
<H-Inv>
        <LOCUS>
                <CLUSTER-ID>HIX0000001</CLUSTER-ID>
                <REP-H-INVITATIONAL-ID>HIT000022181</REP-H-INVITATIONAL-ID>
                <REP-ACCESSION-NO>AK097327</REP-ACCESSION-NO>
        </LOCUS>
</H-Inv>

In bioruby:

irb(main):079:0> Bio::Hinv.hix_represent("HIX0000001")
=> "HIT000022181"
irb(main):081:0> serv=Bio::Hinv::HixRepresent.new
irb(main):082:0> serv.query("hix"=>"HIX0000001")
irb(main):085:0> serv.rep_accession_no
=> "AK097327"
irb(main):086:0> serv.rep_h_invitational_id
=> "HIT000022181"

hix_xml - HIX XML file of HIX ID

URI:

Output:



			

In bioruby:



			

id_search - HIT ID of any ID

URI:


Output:

<?xml version='1.0' encoding='UTF-8'?>
<HINVDB_SEARCH>
<QUERY>HIT00002218*</QUERY>
<ID_TYPE>H-INVITATIONAL-ID</ID_TYPE>
<SIZE>8</SIZE>
<START>1</START>
<END>8</END>
<H-INVITATIONAL-ID>HIT000022181</H-INVITATIONAL-ID>
<H-INVITATIONAL-ID>HIT000022184</H-INVITATIONAL-ID>
<H-INVITATIONAL-ID>HIT000022189</H-INVITATIONAL-ID>
<H-INVITATIONAL-ID>HIT000022180</H-INVITATIONAL-ID>
<H-INVITATIONAL-ID>HIT000022185</H-INVITATIONAL-ID>
<H-INVITATIONAL-ID>HIT000022183</H-INVITATIONAL-ID>
<H-INVITATIONAL-ID>HIT000022188</H-INVITATIONAL-ID>
<H-INVITATIONAL-ID>HIT000022186</H-INVITATIONAL-ID>
</HINVDB_SEARCH>||<

In bioruby:
>|ruby|
irb(main):088:0> Bio::Hinv.id_search("HIT00002218*")
=> ["HIT000022181", "HIT000022184", "HIT000022189", "HIT000022180", "HIT000022185", "HIT000022183", "HIT000022188", "HIT000022186"]
irb(main):090:0> serv = Bio::Hinv::IdSearch.new
irb(main):093:0> serv.query("query" => "HIT00002218*", "start" => "1", "end" => "100")

keyword_search - HIT ID of any ID

URI:


Output:

<?xml version='1.0' encoding='UTF-8'?>
<HINVDB_SEARCH>
<QUERY>HIT00002218*</QUERY>
<SIZE>8</SIZE>
<START>1</START>
<END>8</END>
<H-INVITATIONAL-ID>HIT000022180</H-INVITATIONAL-ID>
<H-INVITATIONAL-ID>HIT000022181</H-INVITATIONAL-ID>
<H-INVITATIONAL-ID>HIT000022183</H-INVITATIONAL-ID>
<H-INVITATIONAL-ID>HIT000022184</H-INVITATIONAL-ID>
<H-INVITATIONAL-ID>HIT000022185</H-INVITATIONAL-ID>
<H-INVITATIONAL-ID>HIT000022186</H-INVITATIONAL-ID>
<H-INVITATIONAL-ID>HIT000022188</H-INVITATIONAL-ID>
<H-INVITATIONAL-ID>HIT000022189</H-INVITATIONAL-ID>
</HINVDB_SEARCH>

In bioruby:

irb(main):089:0> Bio::Hinv.keyword_search("HIT00002218*")
=> ["HIT000022180", "HIT000022181", "HIT000022183", "HIT000022184", "HIT000022185", "HIT000022186", "HIT000022188", "HIT000022189"]
irb(main):090:0> serv = Bio::Hinv::KeywordSearch.new
irb(main):093:0> serv.query("query" => "HIT00002218*", "start" => "1", "end" => "100")

Summary

  1. Classes for H-InvDB REST web service are available on BioRuby CVS HEAD.
  2. Access methods for some complicated outputs are no implemented.
  3. URI design of the H-InvDB REST web service is not good. For example, acc2hit api contains redundunt "acc" term twice (http://jbirc.jbic.or.jp/hinv/hws/acc2hit.php?acc=BC053657).
トラックバック - http://bioruby.g.hatena.ne.jp/nakao_mitsuteru/20080110