module Bio::FANTOM

Public Class Methods

get_by_id(idstr, http_proxy = nil) click to toggle source
   # File lib/bio/db/fantom.rb
30 def get_by_id(idstr, http_proxy = nil)
31   addr = 'fantom.gsc.riken.go.jp'
32   port = 80
33   path = "/db/maxml/maxmlseq.cgi?masterid=#{CGI.escape(idstr.to_s)}&style=xml"
34   xml = ''
35   if http_proxy then
36     proxy = URI.parse(http_proxy.to_s)
37     Net::HTTP.start(addr, port, proxy.host, proxy.port) do |http|
38       response = http.get(path)
39       xml = response.body
40     end
41   else
42     Bio::Command.start_http(addr, port) do |http|
43       response = http.get(path)
44       xml = response.body
45     end
46   end
47   xml
48 end
query(idstr, http_proxy = nil) click to toggle source
   # File lib/bio/db/fantom.rb
23 def query(idstr, http_proxy = nil)
24   xml = get_by_id(idstr, http_proxy)
25   seqs = MaXML::Sequences.new(xml.to_s)
26   seqs[0]
27 end