Hatena::Groupbioruby

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

2006-09-18EBI WebServices on BioRuby

Usage for ebi_ws.rb

|  Usage for ebi_ws.rb - "aac".translate #=> "N" を含むブックマーク はてなブックマーク -  Usage for ebi_ws.rb - "aac".translate #=> "N"  Usage for ebi_ws.rb - "aac".translate #=> "N" のブックマークコメント

First off,
% bioruby
bioruby> require 'ebi_ws.rb'
bioruby> api = Bio::EBI::WS[TAB][TAB]
Bio::EBI::WSClustalW      Bio::EBI::WSInterProScan  Bio::EBI::WSTCoffee
Bio::EBI::WSDbfetch       Bio::EBI::WSMPsrch        Bio::EBI::WSWUBlast
Bio::EBI::WSEmboss        Bio::EBI::WSMuscle        
Bio::EBI::WSFasta         Bio::EBI::WSScanPS        
bioruby> p api = Bio::EBI::WSDbfetch.new
#<Bio::EBI::WSDbfetch:0x6aac84 @wsdl="http://www.ebi.ac.uk/Tools/webservices/wsdl/WSDbfetch.wsdl", @driver=#<SOAP::RPC::Driver:#<SOAP::RPC::Proxy:http://www.ebi.ac.uk/ws/services/urn:Dbfetch>>>
Show methods defind by WSDL for EBI WSDbfetch.
bioruby> p api.list_methods
["getSupportedFormats", "getSupportedDBs", "fetchData", "getSupportedStyles"]
Fetch an entry from UniProt in the default style and the raw format.
bioruby> p53 = api.fetchData("uniprot:p53_HUMAN", "default", "raw")
bioruby> p Bio::UniProt.new(p53).entry_id
"P53_HUMAN"

ebi_ws.rb

|  ebi_ws.rb - "aac".translate #=> "N" を含むブックマーク はてなブックマーク -  ebi_ws.rb - "aac".translate #=> "N"  ebi_ws.rb - "aac".translate #=> "N" のブックマークコメント

require 'bio/io/soapwsdl'

module Bio
class EBI
  SERVICES = [
    ['WSDbfetch',      'http://www.ebi.ac.uk/Tools/webservices/wsdl/WSDbfetch.wsdl'],
    ['WSInterProScan', 'http://www.ebi.ac.uk/Tools/webservices/wsdl/WSInterProScan.wsdl'],
    ['WSEmboss',       'http://www.ebi.ac.uk/Tools/webservices/wsdl/WSEmboss.wsdl'],
    ['WSClustalW',     'http://www.ebi.ac.uk/Tools/webservices/wsdl/WSClustalW.wsdl'],
    ['WSTCoffee',      'http://www.ebi.ac.uk/Tools/webservices/wsdl/WSTCoffee.wsdl'],
    ['WSMuscle',       'http://www.ebi.ac.uk/Tools/webservices/wsdl/WSMuscle.wsdl'],
    ['WSFasta',        'http://www.ebi.ac.uk/Tools/webservices/wsdl/WSFasta.wsdl'],
    ['WSWUBlast',      'http://www.ebi.ac.uk/Tools/webservices/wsdl/WSWUBlast.wsdl'],
    ['WSMPsrch',       'http://www.ebi.ac.uk/Tools/webservices/wsdl/WSMPsrch.wsdl'],
    ['WSScanPS',       'http://www.ebi.ac.uk/Tools/webservices/wsdl/WSScanPS.wsdl'],
    ['MDS',            'http://www.ebi.ac.uk/msd-srv/docs/api/msd_soap_service.wsdl'],
    ['OLS',            'http://www.ebi.ac.uk/ontology-lookup/OntologyQuery.wsdl'],
    ['Citations',      'http://www.ebi.ac.uk/citations/webservices/wsdl']
  ]

  SERVICES.each do |service, wsdl|
    class_definition = \
"class #{service.to_s} < Bio::SOAPWSDL
  def initialize
    @wsdl = '#{wsdl}'
    create_driver
  end    
end"
    eval class_definition
  end

end # module EBI
end # module Bio
トラックバック - http://bioruby.g.hatena.ne.jp/nakao_mitsuteru/20060918